Skip to content

Commit

Permalink
Don't sort env or export flags
Browse files Browse the repository at this point in the history
This ensures that `--help` comes after our defined flags, and looks a
little more consistent and professional. Might add it to other flags
in a separate PR but this is a good start.
  • Loading branch information
mckern committed May 10, 2023
1 parent b23f58c commit 76d59b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
)

func init() {
envCmd.Flags().SortFlags = false
envCmd.Flags().BoolVarP(&preserveCase, "preserve-case", "p", false, "preserve variable name case")
envCmd.Flags().BoolVarP(&escapeSpecials, "escape-strings", "e", false, "escape special characters in values")
RootCmd.AddCommand(envCmd)
Expand Down
1 change: 1 addition & 0 deletions cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var (
)

func init() {
exportCmd.Flags().SortFlags = false
exportCmd.Flags().StringVarP(&exportFormat, "format", "f", "json", "Output format (json, yaml, java-properties, csv, tsv, dotenv, tfvars)")
exportCmd.Flags().StringVarP(&exportOutput, "output-file", "o", "", "Output file (default is standard output)")

Expand Down

0 comments on commit 76d59b4

Please sign in to comment.