File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1+ import { Args } from '@oclif/core' ;
12import { BaseCommand } from '../common/base-command.js' ;
23import { ValidateOrchestrator } from '../orchestrators/validate.js' ;
34import { CodifyParser } from '../parser/index.js' ;
5+ import Apply from './apply.js' ;
46
57export default class Validate extends BaseCommand {
68 static description =
@@ -11,6 +13,10 @@ For more information, visit: https://docs.codifycli.com/commands/validate
1113
1214 static flags = { }
1315
16+ static args = {
17+ pathArgs : Args . string ( ) ,
18+ }
19+
1420 static examples = [
1521 '<%= config.bin %> <%= command.id %>' ,
1622 '<%= config.bin %> <%= command.id %> --path=../../import.codify.jsonc' ,
@@ -22,13 +28,17 @@ For more information, visit: https://docs.codifycli.com/commands/validate
2228 }
2329
2430 public async run ( ) : Promise < void > {
25- const { flags } = await this . parse ( Validate )
31+ const { flags, args } = await this . parse ( Apply )
32+
33+ if ( flags . path && args . pathArgs ) {
34+ throw new Error ( 'Cannot specify both --path and path argument' ) ;
35+ }
2636
2737 await ValidateOrchestrator . run ( {
28- path : flags . path ,
38+ path : flags . path ?? args . pathArgs ,
2939 } , this . reporter )
3040
31- await CodifyParser . parse ( flags . path ) ;
41+ await CodifyParser . parse ( flags . path ?? args . pathArgs ?? '.' ) ;
3242
3343 process . exit ( 0 ) ;
3444 }
You can’t perform that action at this time.
0 commit comments