@@ -9,6 +9,7 @@ import { removeSocketWrapper } from './remove-socket-wrapper.mts'
99import constants from '../../constants.mts'
1010import { commonFlags } from '../../flags.mts'
1111import { checkCommandInput } from '../../utils/check-input.mts'
12+ import { isTestingV1 } from '../../utils/config.mts'
1213import { getOutputKind } from '../../utils/get-output-kind.mts'
1314import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
1415import { getFlagListOutput } from '../../utils/output-formatting.mts'
@@ -71,21 +72,37 @@ async function run(
7172 parentName,
7273 } )
7374
74- const { disable, enable, json, markdown } = cli . flags
75+ const { json, markdown } = cli . flags
76+ let { disable, enable } = cli . flags
7577 const outputKind = getOutputKind ( json , markdown ) // TODO: impl json/md further
7678
79+ if ( isTestingV1 ( ) ) {
80+ const [ arg ] = cli . input
81+ if ( arg === 'on' || arg === 'enable' || arg === 'enabled' ) {
82+ enable = true
83+ disable = false
84+ } else if ( arg === 'off' || arg === 'disable' || arg === 'disabled' ) {
85+ enable = false
86+ disable = true
87+ }
88+ }
89+
7790 const wasValidInput = checkCommandInput (
7891 outputKind ,
7992 {
8093 test : ! ! ( enable || disable ) ,
81- message : 'Must use --enabled or --disable' ,
94+ message : isTestingV1 ( )
95+ ? 'Must use on or off argument'
96+ : 'Must use --enable or --disable' ,
8297 pass : 'ok' ,
8398 fail : 'missing' ,
8499 } ,
85100 {
86101 nook : true ,
87102 test : ! enable || ! disable ,
88- message : 'Do not use both --enable and --disable' ,
103+ message : isTestingV1 ( )
104+ ? 'Do not use both on and off'
105+ : 'Do not use both --enable and --disable' ,
89106 pass : 'ok' ,
90107 fail : 'missing' ,
91108 } ,
0 commit comments