PopFirstArgument returns the first element and the rest of a string slice and return error if failed to do so. It is a helper function to parse non-flag arguments previously used in cfssl commands.
(args []string)
| 72 | // slice and return error if failed to do so. It is a helper function |
| 73 | // to parse non-flag arguments previously used in cfssl commands. |
| 74 | func PopFirstArgument(args []string) (string, []string, error) { |
| 75 | if len(args) < 1 { |
| 76 | return "", nil, errors.New("not enough arguments are supplied --- please refer to the usage") |
| 77 | } |
| 78 | return args[0], args[1:], nil |
| 79 | } |
| 80 | |
| 81 | // Start is the entrance point of cfssl command line tools. |
| 82 | func Start(cmds map[string]*Command) error { |
searching dependent graphs…