/
reset.go
32 lines (29 loc) · 1.05 KB
/
reset.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cmdtree
import (
"github.com/ActiveState/cli/internal/captain"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/primer"
"github.com/ActiveState/cli/internal/runners/reset"
)
func newResetCommand(prime *primer.Values, globals *globalOptions) *captain.Command {
runner := reset.New(prime)
params := &reset.Params{}
return captain.NewCommand(
"reset",
locale.Tl("reset_title", "Reset to a Commit"),
locale.Tl("reset_description", "Reset local checkout to a particular commit."),
prime,
[]*captain.Flag{},
[]*captain.Argument{
{
Name: locale.Tl("arg_state_reset_target", "target"),
Description: locale.Tl("arg_state_reset_target_description", "The commit ID or branch name to reset to. If not specified, resets local checkout to be equal to the project on the platform"),
Value: ¶ms.Target,
},
},
func(ccmd *captain.Command, args []string) error {
params.Force = globals.NonInteractive
return runner.Run(params)
},
).SetGroup(VCSGroup).SetSupportsStructuredOutput()
}