Files
hamview/internal/cmd/all.go
maze fb898bb058
Some checks failed
Run tests / test (1.25) (push) Has been cancelled
Run tests / test (stable) (push) Has been cancelled
Initial import
2026-02-22 20:27:07 +01:00

28 lines
543 B
Go

package cmd
import (
"errors"
"os"
"os/signal"
"syscall"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v3"
)
func AllFlags(configFile string) []cli.Flag {
return append(ConfigFlags(configFile), LoggerFlags()...)
}
func WaitForInterrupt(logger *logrus.Logger, what string) error {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
logger.Infof("%s: running, interrupt with ^C", what)
for sig := range sigs {
return errors.New("terminating on signal " + sig.String())
}
return nil
}