Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: force flags with -- #1051

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/heimdalld/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,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