Skip to content

Commit

Permalink
refactor: make all run options have shorthand vars (#441)
Browse files Browse the repository at this point in the history
refactor: make run options have shorthand vars

Simple nitpick refactor to have all run option flags (except hashes
since there isn't really a good shorthand right now, given h is used for
help, and it would be a good idea to be explicit for≠ hashes) have
shorthand vars.

Signed-off-by: David Dansby <[email protected]>
  • Loading branch information
DataDavD authored Jun 13, 2024
1 parent f5f2ae6 commit f07725e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ witness run [cmd] [flags]
--signer-vault-ttl duration Time to live for the generated certificate. Defaults to the vault role policy's configured TTL if not provided
--signer-vault-url string Base url of the Vault instance to connect to
-s, --step string Name of the step being run
--timestamp-servers strings Timestamp Authority Servers to use when signing envelope
--trace Enable tracing for the command
-t, --timestamp-servers strings Timestamp Authority Servers to use when signing envelope
-r, --trace Enable tracing for the command
-d, --workingdir string Directory from which commands will run
```

Expand Down
4 changes: 2 additions & 2 deletions options/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func (ro *RunOptions) AddFlags(cmd *cobra.Command) {
cmd.Flags().StringSliceVar(&ro.Hashes, "hashes", []string{"sha256"}, "Hashes selected for digest calculation. Defaults to SHA256")
cmd.Flags().StringVarP(&ro.OutFilePath, "outfile", "o", "", "File to write signed data to")
cmd.Flags().StringVarP(&ro.StepName, "step", "s", "", "Name of the step being run")
cmd.Flags().BoolVar(&ro.Tracing, "trace", false, "Enable tracing for the command")
cmd.Flags().StringSliceVar(&ro.TimestampServers, "timestamp-servers", []string{}, "Timestamp Authority Servers to use when signing envelope")
cmd.Flags().BoolVarP(&ro.Tracing, "trace", "r", false, "Enable tracing for the command")
cmd.Flags().StringSliceVarP(&ro.TimestampServers, "timestamp-servers", "t", []string{}, "Timestamp Authority Servers to use when signing envelope")

cmd.MarkFlagsRequiredTogether(RequiredRunFlags...)

Expand Down

0 comments on commit f07725e

Please sign in to comment.