From ce0314d2a25d4615d4584896129b4c3642e84ab7 Mon Sep 17 00:00:00 2001 From: Anthony Camarillo Date: Mon, 8 Apr 2024 17:34:39 -0700 Subject: [PATCH] add remotes shorthand and call help when no args passed --- cmd/root.go | 5 ++++- cmd/run.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index afccd65..3db84da 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -14,7 +14,10 @@ var rootCmd = &cobra.Command{ "Includes options for viewing remote references.\n" + "Documentation can be found at https://pkg.go.dev/github.com/a-camarillo/broom.", Run: func(cmd *cobra.Command, args[]string) { - //TODO add commands lmao + //TODO add commands lmao + if len(args) == 0 { + cmd.Help() + } }, } diff --git a/cmd/run.go b/cmd/run.go index f64fab6..c061486 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -8,7 +8,7 @@ var Remotes bool func init() { rootCmd.AddCommand(runCmd) - runCmd.Flags().BoolVar(&Remotes,"with-remotes",false,"Additionally show remote branches") + runCmd.Flags().BoolVarP(&Remotes,"with-remotes","w",false,"Additionally show remote branches") } var runCmd = &cobra.Command{