@@ -79,8 +79,8 @@ func New(prime *primer.Values, args ...string) *CmdTree {
7979 cleanCmd := newCleanCommand (prime )
8080 cleanCmd .AddChildren (
8181 newCleanUninstallCommand (prime , globals ),
82- newCleanCacheCommand (prime , globals ),
83- newCleanConfigCommand (prime ),
82+ newCleanCacheCommand (prime ),
83+ newCleanConfigCommand (prime , globals ),
8484 )
8585
8686 deployCmd := newDeployCommand (prime )
@@ -137,8 +137,8 @@ func New(prime *primer.Values, args ...string) *CmdTree {
137137
138138 updateCmd := newUpdateCommand (prime )
139139 updateCmd .AddChildren (
140- newUpdateLockCommand (prime , globals ),
141- newUpdateUnlockCommand (prime , globals ))
140+ newUpdateLockCommand (prime ),
141+ newUpdateUnlockCommand (prime ))
142142
143143 branchCmd := newBranchCommand (prime )
144144 branchCmd .AddChildren (
@@ -157,7 +157,7 @@ func New(prime *primer.Values, args ...string) *CmdTree {
157157
158158 useCmd := newUseCommand (prime )
159159 useCmd .AddChildren (
160- newUseResetCommand (prime , globals ),
160+ newUseResetCommand (prime ),
161161 newUseShowCommand (prime ),
162162 )
163163
@@ -204,8 +204,8 @@ func New(prime *primer.Values, args ...string) *CmdTree {
204204 prepareCmd ,
205205 newProtocolCommand (prime ),
206206 newExecCommand (prime , args ... ),
207- newRevertCommand (prime , globals ),
208- newResetCommand (prime , globals ),
207+ newRevertCommand (prime ),
208+ newResetCommand (prime ),
209209 secretsCmd ,
210210 branchCmd ,
211211 newLearnCommand (prime ),
@@ -234,6 +234,7 @@ type globalOptions struct {
234234 Output string
235235 Monochrome bool
236236 NonInteractive bool
237+ Force bool
237238}
238239
239240// Group instances are used to group command help output.
@@ -301,8 +302,16 @@ func newStateCommand(globals *globalOptions, prime *primer.Values) *captain.Comm
301302 Description : locale .T ("flag_state_non_interactive_description" ),
302303 Shorthand : "n" ,
303304 Persist : true ,
305+ OnUse : func () { prime .Prompt ().SetInteractive (false ) },
304306 Value : & globals .NonInteractive ,
305307 },
308+ {
309+ Name : "force" ,
310+ Description : locale .T ("flag_state_force_description" ),
311+ Persist : true ,
312+ OnUse : func () { prime .Prompt ().SetForce (true ) },
313+ Value : & globals .Force ,
314+ },
306315 {
307316 Name : "version" ,
308317 Description : locale .T ("flag_state_version_description" ),
@@ -318,10 +327,6 @@ func newStateCommand(globals *globalOptions, prime *primer.Values) *captain.Comm
318327 },
319328 []* captain.Argument {},
320329 func (ccmd * captain.Command , args []string ) error {
321- if globals .Verbose {
322- logging .CurrentHandler ().SetVerbose (true )
323- }
324-
325330 return runner .Run (ccmd .Usage )
326331 },
327332 )
0 commit comments