Skip to content

Commit

Permalink
Add default val var
Browse files Browse the repository at this point in the history
  • Loading branch information
triole committed Aug 14, 2024
1 parent e45faf6 commit 30b2d76
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/argparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ var CLI struct {
} `cmd:"" help:"check if file(s) exists, return non-zero exitcode if not"`

Compress struct {
Format string `help:"compression format, if files are not removed" short:"g" default:"gz" enum:"snappy,gz,xz"`
} `cmd:"" help:"rotate matching files, compress and truncate after successful compression"`
Format string `help:"compression format, supports: ${compressionFormats}" short:"g" default:"gz" enum:"${compressionFormats}"`
} `cmd:"" help:"compress matching files, compress and truncate after successful compression"`

Rotate struct {
Format string `help:"compression format, if files are not removed" short:"g" default:"gz" enum:"snappy,gz,xz"`
Format string `help:"compression format, if files are not removed, supports: ${compressionFormats}" short:"g" default:"gz" enum:"${compressionFormats}"`
SkipTruncate bool `help:"skip file truncation, don't empty compressed log files" short:"k"`
} `cmd:"" help:"rotate matching files, compress and truncate after successful compression"`

Expand Down Expand Up @@ -80,7 +80,8 @@ func parseArgs() {
FlagsLast: false,
}),
kong.Vars{
"curdir": curdir,
"curdir": curdir,
"compressionFormats": "gz,snappy,xz",
},
)
CLI.SubCommand = ctx.Command()
Expand Down

0 comments on commit 30b2d76

Please sign in to comment.