()
| 29 | } |
| 30 | |
| 31 | func (cli *cliPapi) NewCommand() *cobra.Command { |
| 32 | cmd := &cobra.Command{ |
| 33 | Use: "papi [action]", |
| 34 | Short: "Manage interaction with Polling API (PAPI)", |
| 35 | DisableAutoGenTag: true, |
| 36 | Args: args.NoArgs, |
| 37 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 38 | return cmd.Usage() |
| 39 | }, |
| 40 | PersistentPreRunE: func(_ *cobra.Command, _ []string) error { |
| 41 | cfg := cli.cfg() |
| 42 | if err := require.LAPI(cfg); err != nil { |
| 43 | return err |
| 44 | } |
| 45 | if err := require.CAPI(cfg); err != nil { |
| 46 | return err |
| 47 | } |
| 48 | |
| 49 | return require.PAPI(cfg) |
| 50 | }, |
| 51 | } |
| 52 | |
| 53 | cmd.AddCommand(cli.newStatusCmd()) |
| 54 | cmd.AddCommand(cli.newSyncCmd()) |
| 55 | |
| 56 | return cmd |
| 57 | } |
| 58 | |
| 59 | func (cli *cliPapi) Status(ctx context.Context, out io.Writer, db *database.Client) error { |
| 60 | cfg := cli.cfg() |
nothing calls this directly
no test coverage detected