From fcdc2f460c30a739806e3a1b950647f2bc92bfb5 Mon Sep 17 00:00:00 2001 From: David Dansby <39511285+DataDavD@users.noreply.github.com> Date: Mon, 6 May 2024 18:36:16 -0700 Subject: [PATCH] refactor: make run options have shorthand vars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 <39511285+DataDavD@users.noreply.github.com> --- docs/commands.md | 4 ++-- options/run.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index 14078fd2..58a07fa9 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -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 ``` diff --git a/options/run.go b/options/run.go index 472d1336..05e087b9 100644 --- a/options/run.go +++ b/options/run.go @@ -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...)