diff --git a/packages/react-native/scripts/featureflags/index.js b/packages/react-native/scripts/featureflags/index.js index 14b12078685..c88a46560de 100644 --- a/packages/react-native/scripts/featureflags/index.js +++ b/packages/react-native/scripts/featureflags/index.js @@ -19,6 +19,11 @@ if (require.main === module) { command = 'verify-unchanged'; } else if (process.argv.includes('--print')) { command = 'print'; + } else if (process.argv.includes('--help')) { + command = 'help'; + } else { + console.log('Defaulting to `--update`. See all options using `--help`.'); + command = 'update'; } switch (command) { @@ -31,10 +36,12 @@ if (require.main === module) { case 'print': require('./print').default(process.argv.includes('--json')); break; - default: - console.error( - 'Usage: node featureflags.js [--update|--verify-unchanged|--print]', + case 'help': + console.log( + 'Usage: node featureflags.js [--update|--verify-unchanged|--print|--help]', ); - process.exit(1); + break; + default: + throw new Error('Unexpected script execution.'); } }