diff --git a/README.md b/README.md index 243a107..dddf6cd 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,13 @@ [![CircleCI](https://circleci.com/gh/royeo/git-checkout-branch.svg?style=shield)](https://circleci.com/gh/royeo/git-checkout-branch) [![Go Report Card](https://goreportcard.com/badge/royeo/git-checkout-branch)](https://goreportcard.com/report/royeo/git-checkout-branch) -Switch git branches interactively. - The `git checkout-branch` command is a custom git command to improve the efficiency of switching branches. +## Features + +- switch git branch interactively +- search git branch dynamically + ## Overview ![](https://raw.githubusercontent.com/royeo/static/master/gif/git-checkout-branch.gif) @@ -43,15 +46,16 @@ git config --global alias.cb checkout-branch Use `git checkout-branch help` for help information. ``` -Switch git branch interactively. +Checkout git branches more efficiently. Usage: git checkout-branch [flags] Flags: - -r List the remote-tracking branches - -a List both remote-tracking branches and local branches - -n Set the number of branches displayed in the list, defaults to 10 + -a, --all List both remote-tracking branches and local branches + -r, --remotes List the remote-tracking branches + -n, --number Set the number of branches displayed in the list (default 10) + --hide-help Hide the help information ``` ## License diff --git a/main.go b/main.go index 5ce247e..ff06b24 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ var rootCmd = &cobra.Command{ Short: "Checkout git branches more efficiently.", Run: func(cmd *cobra.Command, args []string) { if len(args) > 0 { - cmd.Usage() + cmd.Help() os.Exit(1) } @@ -63,8 +63,7 @@ Flags: -a, --all List both remote-tracking branches and local branches -r, --remotes List the remote-tracking branches -n, --number Set the number of branches displayed in the list (default 10) - --hide-help Hide the help information - -h, --help Help for git-checkout-branch` + --hide-help Hide the help information` fmt.Println(usage) os.Exit(1) return nil