Skip to content

Commit fb13c34

Browse files
Merge pull request #1597 from allcentury/defaults
feat(core): show defaults in CLI output
2 parents bf32849 + ea4765d commit fb13c34

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

commands/new.command.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,38 @@ export class NewCommand extends AbstractCommand {
1313
.option(
1414
'-d, --dry-run',
1515
'Report actions that would be performed without writing out results.',
16+
false
1617
)
17-
.option('-g, --skip-git', 'Skip git repository initialization.')
18-
.option('-s, --skip-install', 'Skip package installation.')
18+
.option('-g, --skip-git', 'Skip git repository initialization.', false)
19+
.option('-s, --skip-install', 'Skip package installation.', false)
1920
.option(
2021
'-p, --package-manager [package-manager]',
21-
'Specify package manager.',
22+
'Specify package manager.'
2223
)
2324
.option(
2425
'-l, --language [language]',
25-
'Programming language to be used (TypeScript or JavaScript).',
26+
'Programming language to be used (TypeScript or JavaScript)',
27+
'TypeScript',
2628
)
2729
.option(
2830
'-c, --collection [collectionName]',
29-
'Schematics collection to use.',
31+
'Schematics collection to use',
32+
Collection.NESTJS,
3033
)
31-
.option('--strict', 'Enables strict mode in TypeScript.')
34+
.option('--strict', 'Enables strict mode in TypeScript.', false)
3235
.action(async (name: string, command: Command) => {
3336
const options: Input[] = [];
3437
const availableLanguages = ['js', 'ts', 'javascript', 'typescript'];
3538
options.push({ name: 'directory', value: command.directory });
36-
options.push({ name: 'dry-run', value: !!command.dryRun });
37-
options.push({ name: 'skip-git', value: !!command.skipGit });
38-
options.push({ name: 'skip-install', value: !!command.skipInstall });
39-
options.push({ name: 'strict', value: !!command.strict });
39+
options.push({ name: 'dry-run', value: command.dryRun });
40+
options.push({ name: 'skip-git', value: command.skipGit });
41+
options.push({ name: 'skip-install', value: command.skipInstall });
42+
options.push({ name: 'strict', value: command.strict });
4043
options.push({
4144
name: 'package-manager',
4245
value: command.packageManager,
4346
});
47+
options.push({ name: 'collection', value: command.collection });
4448

4549
if (!!command.language) {
4650
const lowercasedLanguage = command.language.toLowerCase();
@@ -64,11 +68,7 @@ export class NewCommand extends AbstractCommand {
6468
}
6569
options.push({
6670
name: 'language',
67-
value: !!command.language ? command.language : 'ts',
68-
});
69-
options.push({
70-
name: 'collection',
71-
value: command.collection || Collection.NESTJS,
71+
value: command.language,
7272
});
7373

7474
const inputs: Input[] = [];

0 commit comments

Comments
 (0)