MCPcopy Create free account
hub / github.com/cloudflare/cfssl / PopFirstArgument

Function PopFirstArgument

cli/cli.go:74–79  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
74func 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.
82func Start(cmds map[string]*Command) error {

Callers 9

genkeyMainFunction · 0.92
printDefaultsFunction · 0.92
gencertMainFunction · 0.92
signerMainFunction · 0.92
scanMainFunction · 0.92
gencrlMainFunction · 0.92
gencsrMainFunction · 0.92
selfSignMainFunction · 0.92
TestPopFirstArgFunction · 0.85

Calls 1

NewMethod · 0.80

Tested by 1

TestPopFirstArgFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…