Skip to content

Commit d785c9b

Browse files
committed
improvement: update command template to create settings object with defaults
1 parent 1772b9d commit d785c9b

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

templates/command.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,30 @@ import { BaseCommand } from '@adonisjs/core/build/standalone'
22

33
export default class {{ filename }} extends BaseCommand {
44

5-
/**
6-
* Command Name is used to run the command
7-
*/
5+
/**
6+
* Command Name is used to run the command
7+
*/
88
public static commandName = '{{#toCommandName}}{{ filename }}{{/toCommandName}}'
99

10-
/**
11-
* Command Name is displayed in the "help" output
12-
*/
10+
/**
11+
* Command Name is displayed in the "help" output
12+
*/
1313
public static description = ''
1414

15+
public static settings = {
16+
/**
17+
* Set the following value to true, if you want to load the application
18+
* before running the command
19+
*/
20+
loadApp: false,
21+
22+
/**
23+
* Set the following value to true, if you want this command to keep running until
24+
* you manually decide to exit the process
25+
*/
26+
stayAlive: false,
27+
}
28+
1529
public async run () {
1630
this.logger.info('Hello world!')
1731
}

0 commit comments

Comments
 (0)