func (handler *SignalHandler) AddListener(listener net.Listener) {
	handler.listeners = append(handler.listeners, listener)
}
AddListener to listeners list
package cmd
import (
	"context"
	"errors"
	flag_ "flag"
	"fmt"
	"github.com/cossacklabs/acra/logging"
	"io"
	"io/ioutil"
	"net"
	"os"
	"os/signal"
	"path/filepath"
	"reflect"
	"encoding/base64"
	"github.com/cossacklabs/acra/keystore"
	"github.com/cossacklabs/acra/utils"
	log "github.com/sirupsen/logrus"
	"gopkg.in/yaml.v2"
	"math/rand"
	"strconv"
	"strings"
	"time"
)
var (
	config                   = flag_.String("config_file", "", "path to config")
	dumpconfig               = flag_.Bool("dump_config", false, "dump config")
	generateMarkdownArgTable = flag_.Bool("generate_markdown_args_table", false, "Generate with yaml config markdown text file with descriptions of all args")
)
var (
	ErrDumpRequested = errors.New("configurtion dump requested")
)
func init() {
	flag_.CommandLine.Usage = func() {
		PrintFlags(flag_.CommandLine)
	}
}
type SignalCallback func()
type SignalHandler struct {
	ch        chan os.Signal
	listeners []net.Listener
	callbacks []SignalCallback
	signals   []os.Signal
}
func NewSignalHandler(handledSignals []os.Signal) (*SignalHandler, error) {
	return &SignalHandler{ch: make(chan os.Signal), signals: handledSignals}, nil
}