diff options
| author | Petter Rasmussen | 2016-01-23 15:21:58 +0100 |
|---|---|---|
| committer | Petter Rasmussen | 2016-01-23 15:21:58 +0100 |
| commit | dffebe0c1729fa9cf3fb0ff3be270bec53fb6820 (patch) | |
| tree | c4494086bbdeefd63660560f499e0a9a4771d16a /handlers_meta.go | |
| parent | 6b3da5bcd3891cb6f084a755aea966d7c23f811a (diff) | |
| download | gdrive-dffebe0c1729fa9cf3fb0ff3be270bec53fb6820.tar.bz2 | |
Use variadic function
Diffstat (limited to 'handlers_meta.go')
| -rw-r--r-- | handlers_meta.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/handlers_meta.go b/handlers_meta.go index f0f7ef7..6394cb3 100644 --- a/handlers_meta.go +++ b/handlers_meta.go @@ -20,17 +20,15 @@ func printHelp(ctx cli.Context) { func printCommandHelp(ctx cli.Context) { args := ctx.Args() - prefix := []string{args.String("command")} - printCommandPrefixHelp(prefix, ctx) + printCommandPrefixHelp(ctx, args.String("command")) } func printSubCommandHelp(ctx cli.Context) { args := ctx.Args() - prefix := []string{args.String("command"), args.String("subcommand")} - printCommandPrefixHelp(prefix, ctx) + printCommandPrefixHelp(ctx, args.String("command"), args.String("subcommand")) } -func printCommandPrefixHelp(prefix []string, ctx cli.Context) { +func printCommandPrefixHelp(ctx cli.Context, prefix ...string) { handler := getHandler(ctx.Handlers(), prefix) if handler == nil { |
