From b877d23352ed43861dae8263b69b3d652d6d0969 Mon Sep 17 00:00:00 2001 From: Mohi <58784914+mrostamii@users.noreply.github.com> Date: Thu, 16 Nov 2023 18:27:46 +0800 Subject: [PATCH] feat: force flags with -- (#1051) - to don't ignore all of the flags without -- - one problem is with the `bridge` flag so it simply was ignored --- cmd/heimdalld/service/service.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/heimdalld/service/service.go b/cmd/heimdalld/service/service.go index e4b4aef44c..d93f284cc4 100644 --- a/cmd/heimdalld/service/service.go +++ b/cmd/heimdalld/service/service.go @@ -251,6 +251,13 @@ For profiling and benchmarking purposes, CPU profiling can be enabled via the '- which accepts a path for the resulting pprof file. `, RunE: func(cmd *cobra.Command, args []string) error { + for _, arg := range args { + if !strings.HasPrefix(arg, "--") { + return fmt.Errorf( + "\tinvalid argument: %s \n\tall flags must start with --", + arg) + } + } LogsWriterFile := viper.GetString(helper.LogsWriterFileFlag) if LogsWriterFile != "" { logWriter := helper.GetLogsWriter(LogsWriterFile)