diff --git a/.gitignore b/.gitignore index 66774e1..4a2e898 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ monolinie +ml diff --git a/cmd/root.go b/cmd/root.go index 6da5b81..4a8dca9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "os" + "path/filepath" "github.com/spf13/cobra" ) @@ -14,6 +15,11 @@ var rootCmd = &cobra.Command{ } func Execute() { + // Allow invoking as "ml" (short alias) or "monolinie" + if name := filepath.Base(os.Args[0]); name == "ml" { + rootCmd.Use = "ml" + } + if err := rootCmd.Execute(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1)