Revert "GODT-2013: CLI flag for frontend is required."

This reverts commit 4bb29b1b5c.
This commit is contained in:
James Houlahan
2022-11-04 00:53:03 +01:00
parent 7cb9546d21
commit f965d01922
4 changed files with 16 additions and 36 deletions

View File

@ -40,10 +40,10 @@ import (
)
const (
flagLogIMAP = "log-imap"
flagLogSMTP = "log-smtp"
flagNonInteractive = "noninteractive"
flagNonInteractiveShort = "n"
flagLogIMAP = "log-imap"
flagLogSMTP = "log-smtp"
flagNonInteractive = "noninteractive"
// Memory cache was estimated by empirical usage in the past, and it was set to 100MB.
// NOTE: This value must not be less than maximal size of one email (~30MB).
inMemoryCacheLimit = 100 * (1 << 20)
@ -62,9 +62,8 @@ func New(base *base.Base) *cli.App {
Usage: "Enable logging of SMTP communications (may contain decrypted data!)",
},
&cli.BoolFlag{
Name: flagNonInteractive,
Aliases: []string{flagNonInteractiveShort},
Usage: "Start Bridge entirely non-interactively",
Name: flagNonInteractive,
Usage: "Start Bridge entirely non-interactively",
},
}...)
@ -73,11 +72,6 @@ func New(base *base.Base) *cli.App {
func main(b *base.Base, c *cli.Context) error { //nolint:funlen
frontendType := getFrontendTypeFromCLIParams(c)
if frontendType == frontend.Unknown {
_ = cli.ShowAppHelp(c)
return errors.New("no frontend was specified. Use --grpc, --cli or --noninteractive")
}
f := frontend.New(
frontendType,
!c.Bool(base.FlagNoWindow),
@ -177,14 +171,12 @@ func main(b *base.Base, c *cli.Context) error { //nolint:funlen
func getFrontendTypeFromCLIParams(c *cli.Context) frontend.Type {
switch {
case c.Bool(base.FlagGRPC):
return frontend.GRPC
case c.Bool(base.FlagCLI):
return frontend.CLI
case c.Bool(flagNonInteractive):
return frontend.NonInteractive
default:
return frontend.Unknown
return frontend.GRPC
}
}