INNER CODE UNIT · Go
RunGitCommandWithArgs
chriswalz/bit · cmd/bit_cmd.go:153
func RunGitCommandWithArgs(args []string) {
var err error
err = RunInTerminalWithColor("git", args)
if err != nil {
log.Debug().Msg("Command may not exist: " + err.Error())
}
return
}
func HijackGitCommandOccurred(args []string, suggestionMap *complete.CompTree, version string) bool {
sub := args[0]
// handle checkout,switch,co commands as checkout
// if "-b" flag is not provided and branch does not exist
// user would be prompted asking whether to create a branch or not
// expected usage format
// bit (checkout|switch|co) [-b] branch-name
if args[len(args)-1] == "--version" || args[len(args)-1] == "version" {
fmt.Println("bit version " + version)