commands: add "show --field humanId"

Michael Muré created

Change summary

commands/show.go       | 4 +++-
doc/man/git-bug-show.1 | 2 +-
doc/md/git-bug_show.md | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)

Detailed changes

commands/show.go 🔗

@@ -45,6 +45,8 @@ func runShowBug(cmd *cobra.Command, args []string) error {
 			fmt.Printf("%s\n", firstComment.Author.Email())
 		case "createTime":
 			fmt.Printf("%s\n", firstComment.FormatTime())
+		case "humanId":
+			fmt.Printf("%s\n", snapshot.HumanId())
 		case "id":
 			fmt.Printf("%s\n", snapshot.Id())
 		case "labels":
@@ -124,5 +126,5 @@ var showCmd = &cobra.Command{
 func init() {
 	RootCmd.AddCommand(showCmd)
 	showCmd.Flags().StringVarP(&showFieldsQuery, "field", "f", "",
-		"Select field to display. Valid values are [author,authorEmail,createTime,id,labels,shortId,status,title]")
+		"Select field to display. Valid values are [author,authorEmail,createTime,humanId,id,labels,shortId,status,title]")
 }

doc/man/git-bug-show.1 🔗

@@ -21,7 +21,7 @@ Display the details of a bug.
 .SH OPTIONS
 .PP
 \fB\-f\fP, \fB\-\-field\fP=""
-    Select field to display. Valid values are [author,authorEmail,createTime,id,labels,shortId,status,title]
+    Select field to display. Valid values are [author,authorEmail,createTime,humanId,id,labels,shortId,status,title]
 
 .PP
 \fB\-h\fP, \fB\-\-help\fP[=false]

doc/md/git-bug_show.md 🔗

@@ -13,7 +13,7 @@ git-bug show [<id>] [flags]
 ### Options
 
 ```
-  -f, --field string   Select field to display. Valid values are [author,authorEmail,createTime,id,labels,shortId,status,title]
+  -f, --field string   Select field to display. Valid values are [author,authorEmail,createTime,humanId,id,labels,shortId,status,title]
   -h, --help           help for show
 ```