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

Function validateBoxArgs

internal/cmd/box.go:47–56  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

45}
46
47func validateBoxArgs(cmd *cobra.Command, args []string) error {
48 switch len(args) {
49 case 1:
50 return nil
51 case 0:
52 return usageErrorf("%s <name|id> (example: hey box imbox)", cmd.CommandPath())
53 default:
54 return fmt.Errorf("expected 1 mailbox argument, got %d", len(args))
55 }
56}
57
58func (c *boxCommand) run(cmd *cobra.Command, args []string) error {
59 if err := requireAuth(); err != nil {

Callers 1

TestValidateBoxArgsFunction · 0.85

Calls 1

usageErrorfFunction · 0.85

Tested by 1

TestValidateBoxArgsFunction · 0.68