(env *execenv.Env)
| 24 | } |
| 25 | |
| 26 | func newBridgePullCommand(env *execenv.Env) *cobra.Command { |
| 27 | options := bridgePullOptions{} |
| 28 | |
| 29 | cmd := &cobra.Command{ |
| 30 | Use: "pull [NAME]", |
| 31 | Short: "Pull updates from a remote bug tracker", |
| 32 | PreRunE: execenv.LoadBackend(env), |
| 33 | RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error { |
| 34 | return runBridgePull(env, options, args) |
| 35 | }), |
| 36 | Args: cobra.MaximumNArgs(1), |
| 37 | ValidArgsFunction: completion.Bridge(env), |
| 38 | } |
| 39 | |
| 40 | flags := cmd.Flags() |
| 41 | flags.SortFlags = false |
| 42 | |
| 43 | flags.BoolVarP(&options.noResume, "no-resume", "n", false, "force importing all bugs") |
| 44 | flags.StringVarP(&options.importSince, "since", "s", "", "import only bugs updated after the given date (ex: \"200h\" or \"june 2 2019\")") |
| 45 | |
| 46 | return cmd |
| 47 | } |
| 48 | |
| 49 | func runBridgePull(env *execenv.Env, opts bridgePullOptions, args []string) error { |
| 50 | if opts.noResume && opts.importSince != "" { |
no test coverage detected