diff --git a/commands/runner.go b/commands/runner.go index b960d70b..9d988002 100644 --- a/commands/runner.go +++ b/commands/runner.go @@ -17,7 +17,7 @@ func (r *Runner) Execute() error { } expandAlias(args) - args.Noop = true + slurpGlobalFlags(args) for _, cmd := range All() { if cmd.Name() == args.Command && cmd.Runnable() { @@ -51,6 +51,15 @@ func (r *Runner) Execute() error { return git.SysExec(args.Command, args.Params...) } +func slurpGlobalFlags(args *Args) { + for i, p := range args.Params { + if p == "--no-op" { + args.Noop = true + args.RemoveParam(i) + } + } +} + func printCommands(cmds []*cmd.Cmd) { for _, c := range cmds { fmt.Println(c)