mirror of
https://github.com/strapi/strapi.git
synced 2025-08-07 08:16:35 +00:00
Cleanup some useless option config
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
c81af9a1d0
commit
b8d206ede7
@ -9,8 +9,6 @@ const program = new Command();
|
|||||||
|
|
||||||
const packageJSON = require('../package.json');
|
const packageJSON = require('../package.json');
|
||||||
|
|
||||||
program.storeOptionsAsProperties(false).passCommandToAction(false);
|
|
||||||
|
|
||||||
const checkCwdIsStrapiApp = name => {
|
const checkCwdIsStrapiApp = name => {
|
||||||
let logErrorAndExit = () => {
|
let logErrorAndExit = () => {
|
||||||
console.log(
|
console.log(
|
||||||
@ -56,20 +54,14 @@ const getLocalScript = name => (...args) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
// Initial program setup
|
||||||
* Normalize version argument
|
program
|
||||||
*
|
.storeOptionsAsProperties(false)
|
||||||
* `$ strapi -v`
|
.passCommandToAction(false)
|
||||||
* `$ strapi -V`
|
.allowUnknownOption(true);
|
||||||
* `$ strapi --version`
|
|
||||||
* `$ strapi version`
|
|
||||||
*/
|
|
||||||
|
|
||||||
program.allowUnknownOption(true);
|
|
||||||
|
|
||||||
program.option('-v, --version', 'output the version number');
|
|
||||||
|
|
||||||
// `$ strapi version` (--version synonym)
|
// `$ strapi version` (--version synonym)
|
||||||
|
program.option('-v, --version', 'output the version number');
|
||||||
program
|
program
|
||||||
.command('version')
|
.command('version')
|
||||||
.description('output your version of Strapi')
|
.description('output your version of Strapi')
|
||||||
@ -115,7 +107,7 @@ program
|
|||||||
program
|
program
|
||||||
.command('develop')
|
.command('develop')
|
||||||
.alias('dev')
|
.alias('dev')
|
||||||
.option('--no-build', 'Disable build', false)
|
.option('--no-build', 'Disable build')
|
||||||
.option('--watch-admin', 'Enable watch', false)
|
.option('--watch-admin', 'Enable watch', false)
|
||||||
.option('--browser <name>', 'Open the browser', true)
|
.option('--browser <name>', 'Open the browser', true)
|
||||||
.description('Start your Strapi application in development mode')
|
.description('Start your Strapi application in development mode')
|
||||||
@ -128,7 +120,7 @@ program
|
|||||||
.option('-p, --plugin <api>', 'Name of the local plugin')
|
.option('-p, --plugin <api>', 'Name of the local plugin')
|
||||||
.option('-e, --extend <api>', 'Name of the plugin to extend')
|
.option('-e, --extend <api>', 'Name of the plugin to extend')
|
||||||
.option('-c, --connection <connection>', 'The name of the connection to use')
|
.option('-c, --connection <connection>', 'The name of the connection to use')
|
||||||
.option('--draft-and-publish <value>', 'Enable draft/publish', false)
|
.option('--draft-and-publish', 'Enable draft/publish', false)
|
||||||
.description('generate a basic API')
|
.description('generate a basic API')
|
||||||
.action((id, attributes, cliArguments) => {
|
.action((id, attributes, cliArguments) => {
|
||||||
cliArguments.attributes = attributes;
|
cliArguments.attributes = attributes;
|
||||||
@ -150,7 +142,7 @@ program
|
|||||||
.option('-a, --api <api>', 'API name to generate a sub API')
|
.option('-a, --api <api>', 'API name to generate a sub API')
|
||||||
.option('-p, --plugin <api>', 'plugin name')
|
.option('-p, --plugin <api>', 'plugin name')
|
||||||
.option('-c, --connection <connection>', 'The name of the connection to use')
|
.option('-c, --connection <connection>', 'The name of the connection to use')
|
||||||
.option('--draft-and-publish <value>', 'Enable draft/publish', false)
|
.option('--draft-and-publish', 'Enable draft/publish', false)
|
||||||
.description('generate a model for an API')
|
.description('generate a model for an API')
|
||||||
.action((id, attributes, cliArguments) => {
|
.action((id, attributes, cliArguments) => {
|
||||||
cliArguments.attributes = attributes;
|
cliArguments.attributes = attributes;
|
||||||
@ -184,7 +176,7 @@ program
|
|||||||
program
|
program
|
||||||
.command('build')
|
.command('build')
|
||||||
.option('--clean', 'Remove the build and .cache folders', false)
|
.option('--clean', 'Remove the build and .cache folders', false)
|
||||||
.option('--no-optimization', 'Build the Administration without assets optimization', false)
|
.option('--no-optimization', 'Build the Administration without assets optimization')
|
||||||
.description('Builds the strapi admin app')
|
.description('Builds the strapi admin app')
|
||||||
.action(getLocalScript('build'));
|
.action(getLocalScript('build'));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user