| 37 | } |
| 38 | |
| 39 | func GetFirstBoolArgument(ctx *cli.Context) bool { |
| 40 | if ctx.NArg() != 1 { |
| 41 | log.Fatal("Invalid length of arguments", "want", 1, "got", ctx.NArg()) |
| 42 | } |
| 43 | |
| 44 | arg := ctx.Args().Get(0) |
| 45 | if arg == "true" || arg == "True" || arg == "TRUE" { |
| 46 | return true |
| 47 | } else if arg == "false" || arg == "False" || arg == "FALSE" { |
| 48 | return false |
| 49 | } else { |
| 50 | log.Fatal("Invalid argument", "want", "bool", "got", arg) |
| 51 | } |
| 52 | |
| 53 | return false |
| 54 | } |
| 55 | |
| 56 | // GetFirstStringArgument returns the value of the first string argument |
| 57 | func GetFirstStringArgument(ctx *cli.Context) string { |