提交 d5c3fb87 编写于 作者: T Theodore Kokkoris 提交者: Jingwen Owen Ou

Using IndexOfParam to search for help flag

上级 192f2a3e
......@@ -58,11 +58,9 @@ func getRemotes(args *Args) (remotes []string, idx int) {
}
func fixHelp(args *Args) {
for _, i := range args.Params {
if i == "--help" && args.ParamsSize() == 1 {
args.Params = []string{"--help"}
return
}
if i := args.IndexOfParam("--help"); i != -1 && args.ParamsSize() == 1 {
args.Params = []string{"--help"}
return
}
os.Exit(0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册