File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -92,4 +92,32 @@ func mapFields(fields []string) (map[string]string, error) {
92
92
return mappedFields , nil
93
93
}
94
94
95
- const apiCmdUsage string = `TODO`
95
+ const apiCmdUsage string = `Usage:{{if .Runnable}}
96
+ {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
97
+ {{.CommandPath}}{{end}}{{if gt (len .Aliases) 0}}
98
+ Aliases:
99
+ {{.NameAndAliases}}{{end}}{{if .HasExample}}
100
+
101
+ Examples:
102
+ {{.Example}}{{end}}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}}
103
+
104
+ Available Commands:{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
105
+ {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}}
106
+
107
+ {{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}}
108
+ {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}}
109
+
110
+ Additional Commands:{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}}
111
+ {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
112
+
113
+ Flags:
114
+ {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
115
+
116
+ Global Flags:
117
+ {{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}}
118
+
119
+ Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
120
+ {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}
121
+
122
+ Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}}
123
+ `
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ var rootCmd = &cobra.Command{
24
24
gh-slack read <slack-permalink>
25
25
gh-slack read -i <issue-url> <slack-permalink>
26
26
gh-slack send -m <message> -c <channel-name> -t <team-name>
27
+ gh-slack api post chat.postMessage -b '{"channel":"123","blocks":[...]}
27
28
` + sendConfigExample ,
28
29
}
29
30
You can’t perform that action at this time.
0 commit comments