Skip to content

Commit 6fdf953

Browse files
authored
feat: enable allowUnknownFlags for specific commands
1 parent f1e1465 commit 6fdf953

File tree

7 files changed

+35
-0
lines changed

7 files changed

+35
-0
lines changed

commands/make/controller.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import string from '@poppinss/utils/string'
1111
import { stubsRoot } from '../../stubs/main.js'
1212
import { args, flags, BaseCommand } from '../../modules/ace/main.js'
13+
import { CommandOptions } from '../../types/ace.js'
1314

1415
/**
1516
* The make controller command to create an HTTP controller
@@ -18,6 +19,10 @@ export default class MakeController extends BaseCommand {
1819
static commandName = 'make:controller'
1920
static description = 'Create a new HTTP controller class'
2021

22+
static options: CommandOptions = {
23+
allowUnknownFlags: true,
24+
}
25+
2126
@args.string({ description: 'The name of the controller' })
2227
declare name: string
2328

commands/make/event.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import { stubsRoot } from '../../stubs/main.js'
1111
import { args, BaseCommand } from '../../modules/ace/main.js'
12+
import { CommandOptions } from '../../types/ace.js'
1213

1314
/**
1415
* The make event command to create a class based event
@@ -17,6 +18,10 @@ export default class MakeEvent extends BaseCommand {
1718
static commandName = 'make:event'
1819
static description = 'Create a new event class'
1920

21+
static options: CommandOptions = {
22+
allowUnknownFlags: true,
23+
}
24+
2025
@args.string({ description: 'Name of the event' })
2126
declare name: string
2227

commands/make/exception.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import { stubsRoot } from '../../stubs/main.js'
1111
import { args, BaseCommand } from '../../modules/ace/main.js'
12+
import { CommandOptions } from '../../types/ace.js'
1213

1314
/**
1415
* Make a new exception class
@@ -17,6 +18,10 @@ export default class MakeException extends BaseCommand {
1718
static commandName = 'make:exception'
1819
static description = 'Create a new custom exception class'
1920

21+
static options: CommandOptions = {
22+
allowUnknownFlags: true,
23+
}
24+
2025
@args.string({ description: 'Name of the exception' })
2126
declare name: string
2227

commands/make/listener.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import { stubsRoot } from '../../stubs/main.js'
1111
import { args, flags, BaseCommand } from '../../modules/ace/main.js'
12+
import { CommandOptions } from '../../types/ace.js'
1213

1314
/**
1415
* The make listener command to create a class based event
@@ -18,6 +19,10 @@ export default class MakeListener extends BaseCommand {
1819
static commandName = 'make:listener'
1920
static description = 'Create a new event listener class'
2021

22+
static options: CommandOptions = {
23+
allowUnknownFlags: true,
24+
}
25+
2126
@args.string({ description: 'Name of the event listener' })
2227
declare name: string
2328

commands/make/middleware.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { basename, extname, relative } from 'node:path'
1313

1414
import { stubsRoot } from '../../stubs/main.js'
1515
import { args, BaseCommand, flags } from '../../modules/ace/main.js'
16+
import { CommandOptions } from '../../types/ace.js'
1617

1718
/**
1819
* The make middleware command to create a new middleware
@@ -22,6 +23,10 @@ export default class MakeMiddleware extends BaseCommand {
2223
static commandName = 'make:middleware'
2324
static description = 'Create a new middleware class for HTTP requests'
2425

26+
static options: CommandOptions = {
27+
allowUnknownFlags: true,
28+
}
29+
2530
@args.string({ description: 'Name of the middleware' })
2631
declare name: string
2732

commands/make/service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import { stubsRoot } from '../../stubs/main.js'
1111
import { args, BaseCommand } from '../../modules/ace/main.js'
12+
import { CommandOptions } from '../../types/ace.js'
1213

1314
/**
1415
* Make a new service class
@@ -17,6 +18,10 @@ export default class MakeService extends BaseCommand {
1718
static commandName = 'make:service'
1819
static description = 'Create a new service class'
1920

21+
static options: CommandOptions = {
22+
allowUnknownFlags: true,
23+
}
24+
2025
@args.string({ description: 'Name of the service' })
2126
declare name: string
2227

commands/make/validator.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import { stubsRoot } from '../../stubs/main.js'
1111
import { args, flags, BaseCommand } from '../../modules/ace/main.js'
12+
import { CommandOptions } from '../../types/ace.js'
1213

1314
/**
1415
* Make a new VineJS validator
@@ -17,6 +18,10 @@ export default class MakeValidator extends BaseCommand {
1718
static commandName = 'make:validator'
1819
static description = 'Create a new file to define VineJS validators'
1920

21+
static options: CommandOptions = {
22+
allowUnknownFlags: true,
23+
}
24+
2025
@args.string({ description: 'Name of the validator file' })
2126
declare name: string
2227

0 commit comments

Comments
 (0)