mirror of https://github.com/knative/func.git
fix: use full root name for cmd help prefixes (#873)
This commit is contained in:
parent
02fa79e8e9
commit
3f30c91116
|
@ -172,7 +172,7 @@ func runCreateHelp(cmd *cobra.Command, args []string, newClient ClientFactory) {
|
|||
Name string
|
||||
}{
|
||||
Options: options,
|
||||
Name: cmd.Root().Name(),
|
||||
Name: cmd.Root().Use,
|
||||
}
|
||||
if err := tpl.Execute(cmd.OutOrStdout(), data); err != nil {
|
||||
fmt.Fprintf(cmd.ErrOrStderr(), "unable to display help text: %v", err)
|
||||
|
|
|
@ -183,7 +183,7 @@ func runInvokeHelp(cmd *cobra.Command, args []string, newClient ClientFactory) {
|
|||
var data = struct {
|
||||
Name string
|
||||
}{
|
||||
Name: cmd.Root().Name(),
|
||||
Name: cmd.Root().Use,
|
||||
}
|
||||
|
||||
if err := tpl.Execute(cmd.OutOrStdout(), data); err != nil {
|
||||
|
|
|
@ -43,6 +43,8 @@ func NewRootCmd(config RootCommandConfig) (*cobra.Command, error) {
|
|||
var err error
|
||||
|
||||
root := &cobra.Command{
|
||||
// Use must be set to exactly config.Name, as this field is overloaded to
|
||||
// be used in subcommand help text as the command with possible prefix:
|
||||
Use: config.Name,
|
||||
Short: "Serverless Functions",
|
||||
SilenceErrors: true, // we explicitly handle errors in Execute()
|
||||
|
|
Loading…
Reference in New Issue