MCPcopy Create free account
hub / github.com/basecamp/hey-cli / usageExactOneArg

Function usageExactOneArg

internal/cmd/args.go:22–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func usageExactOneArg() cobra.PositionalArgs {
23 return func(cmd *cobra.Command, args []string) error {
24 if len(args) == 1 {
25 return nil
26 }
27
28 if len(args) == 0 {
29 return usageErrorf("%s", cleanUseLine(cmd.UseLine()))
30 }
31
32 return fmt.Errorf("expected 1 argument, got %d", len(args))
33 }
34}
35
36func usageMinOneArg() cobra.PositionalArgs {
37 return func(cmd *cobra.Command, args []string) error {

Callers 9

newTodoCompleteCommandFunction · 0.85
newTodoUncompleteCommandFunction · 0.85
newTodoDeleteCommandFunction · 0.85
TestUsageExactArgsFunction · 0.85
newReplyCommandFunction · 0.85
newRecordingsCommandFunction · 0.85
newThreadsCommandFunction · 0.85
newHabitCompleteCommandFunction · 0.85

Calls 2

usageErrorfFunction · 0.85
cleanUseLineFunction · 0.85

Tested by 1

TestUsageExactArgsFunction · 0.68