Skip to content

Commit

Permalink
feat: force flags with -- (#1051)
Browse files Browse the repository at this point in the history
- to don't ignore all of the flags without --
- one problem is with the `bridge` flag so it simply was ignored
  • Loading branch information
mrostamii authored and Raneet10 committed Feb 13, 2024
1 parent cddb386 commit b877d23
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/heimdalld/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b877d23

Please sign in to comment.