(cmd *cobra.Command, args []string)
| 45 | } |
| 46 | |
| 47 | func 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 | |
| 58 | func (c *boxCommand) run(cmd *cobra.Command, args []string) error { |
| 59 | if err := requireAuth(); err != nil { |