Skip to content

Commit

Permalink
Use binary name as the root cmd in cobra help docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcardarelli committed May 1, 2024
1 parent 4784861 commit da88c93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ package cmd
import (
"fmt"
"os"
"path/filepath"

figure "github.com/common-nighthawk/go-figure"
"github.com/spf13/cobra"
)

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "fancy-cli",
// Use the name of the binary generated from `go build -o name` as the
// root cmd that cobra shows in the help menu
Use: filepath.Base(os.Args[0]),
Short: "Restaurant database manager",
Long: `Restaurant database`,
// Uncomment the following line if your bare application
Expand Down

0 comments on commit da88c93

Please sign in to comment.