Skip to content

Commit 4f23f65

Browse files
authored
add config file option to flare command for improved flexibility (#2107)
1 parent 0900566 commit 4f23f65

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/launcher/flare.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ func runFlare(systemMultiSlogger *multislogger.MultiSlogger, args []string) erro
3737
flSave = flagset.String("save", "upload", "local | upload")
3838
flOutputDir = flagset.String("output_dir", ".", "path to directory to save flare output")
3939
flUploadRequestURL = flagset.String("upload_request_url", "https://api.kolide.com/api/agent/flare", "URL to request a signed upload URL")
40+
flConfigFilePath = flagset.String("config", launcher.DefaultConfigFilePath, "config file to parse options from (optional)")
4041
)
4142

4243
if err := ff.Parse(flagset, args); err != nil {
4344
return fmt.Errorf("parsing flags: %w", err)
4445
}
4546

46-
// were passing an empty array here just to get the default options
47-
opts, err := launcher.ParseOptions("flareupload", make([]string, 0))
47+
opts, err := launcher.ParseOptions("flare", []string{"-config", *flConfigFilePath})
4848
if err != nil {
4949
return err
5050
}
@@ -104,6 +104,7 @@ func runFlare(systemMultiSlogger *multislogger.MultiSlogger, args []string) erro
104104
"flare creation complete",
105105
"status", successMessage,
106106
"file", flareDest.Name(),
107+
"config_path", *flConfigFilePath,
107108
)
108109

109110
return nil

0 commit comments

Comments
 (0)