-
Notifications
You must be signed in to change notification settings - Fork 13
/
refresh.go
38 lines (34 loc) · 1.07 KB
/
refresh.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
33
34
35
36
37
38
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/refresh"
"github.com/ActiveState/cli/pkg/project"
)
func newRefreshCommand(prime *primer.Values) *captain.Command {
runner := refresh.New(prime)
params := &refresh.Params{
Namespace: &project.Namespaced{AllowOmitOwner: true},
}
cmd := captain.NewCommand(
"refresh",
"",
locale.Tl("refresh_description", "Updates the given project runtime based on its current configuration"),
prime,
[]*captain.Flag{},
[]*captain.Argument{
{
Name: locale.T("arg_state_activate_namespace"),
Description: locale.Tl("arg_state_refresh_namespace_description", "The namespace of the project to update, or just the project name if previously used"),
Value: params.Namespace,
},
},
func(_ *captain.Command, _ []string) error {
return runner.Run(params)
},
)
cmd.SetGroup(EnvironmentUsageGroup)
cmd.SetSupportsStructuredOutput()
return cmd
}