From 064d88582c5a740b55ac5bcf9f363bfb40fa00c0 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 11 Jun 2024 07:48:46 -0400 Subject: [PATCH] Add -O shorthand for --omit-digest-tags to crane. --omit-digest-tags is hard to remember and easy to typo. Support -O as an alias. Signed-off-by: Scott Moser --- cmd/crane/cmd/list.go | 2 +- cmd/crane/doc/crane_ls.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/crane/cmd/list.go b/cmd/crane/cmd/list.go index 76d71a3dc..33957d685 100644 --- a/cmd/crane/cmd/list.go +++ b/cmd/crane/cmd/list.go @@ -40,7 +40,7 @@ func NewCmdList(options *[]crane.Option) *cobra.Command { }, } cmd.Flags().BoolVar(&fullRef, "full-ref", false, "(Optional) if true, print the full image reference") - cmd.Flags().BoolVar(&omitDigestTags, "omit-digest-tags", false, "(Optional), if true, omit digest tags (e.g., ':sha256-...')") + cmd.Flags().BoolVarP(&omitDigestTags, "omit-digest-tags", "O", false, "(Optional), if true, omit digest tags (e.g., ':sha256-...')") return cmd } diff --git a/cmd/crane/doc/crane_ls.md b/cmd/crane/doc/crane_ls.md index 6616820b1..844771da4 100644 --- a/cmd/crane/doc/crane_ls.md +++ b/cmd/crane/doc/crane_ls.md @@ -11,7 +11,7 @@ crane ls REPO [flags] ``` --full-ref (Optional) if true, print the full image reference -h, --help help for ls - --omit-digest-tags (Optional), if true, omit digest tags (e.g., ':sha256-...') + -O, --omit-digest-tags (Optional), if true, omit digest tags (e.g., ':sha256-...') ``` ### Options inherited from parent commands