()
| 20 | } |
| 21 | |
| 22 | func (cli *cliLapi) NewCommand() *cobra.Command { |
| 23 | cmd := &cobra.Command{ |
| 24 | Use: "lapi [action]", |
| 25 | Short: "Manage interaction with Local API (LAPI)", |
| 26 | DisableAutoGenTag: true, |
| 27 | Args: args.NoArgs, |
| 28 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 29 | return cmd.Usage() |
| 30 | }, |
| 31 | PersistentPreRunE: func(_ *cobra.Command, _ []string) error { |
| 32 | if err := cli.cfg().LoadAPIClient(); err != nil { |
| 33 | return fmt.Errorf("loading api client: %w", err) |
| 34 | } |
| 35 | |
| 36 | return nil |
| 37 | }, |
| 38 | } |
| 39 | |
| 40 | cmd.AddCommand(cli.newRegisterCmd()) |
| 41 | cmd.AddCommand(cli.newStatusCmd()) |
| 42 | cmd.AddCommand(cli.newContextCmd()) |
| 43 | |
| 44 | return cmd |
| 45 | } |
nothing calls this directly
no test coverage detected