File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { Flags } from '@oclif/core'
1+ import { Args , Flags } from '@oclif/core'
22import chalk from 'chalk' ;
33
44import { BaseCommand } from '../common/base-command.js' ;
@@ -27,6 +27,10 @@ For more information, visit: https://docs.codifycli.com/commands/apply
2727 } ) ,
2828 }
2929
30+ static args = {
31+ pathArgs : Args . string ( ) ,
32+ }
33+
3034 static examples = [
3135 '<%= config.bin %> <%= command.id %>' ,
3236 '<%= config.bin %> <%= command.id %> --path ~' ,
@@ -40,10 +44,14 @@ For more information, visit: https://docs.codifycli.com/commands/apply
4044 }
4145
4246 public async run ( ) : Promise < void > {
43- const { flags } = await this . parse ( Apply )
47+ const { flags, args } = await this . parse ( Apply )
48+
49+ if ( flags . path && args . pathArgs ) {
50+ throw new Error ( 'Cannot specify both --path and path argument' ) ;
51+ }
4452
4553 await ApplyOrchestrator . run ( {
46- path : flags . path ,
54+ path : flags . path ?? args . pathArgs ,
4755 verbosityLevel : flags . debug ? 3 : 0 ,
4856 // secure: flags.secure,
4957 } , this . reporter ) ;
Original file line number Diff line number Diff line change 11import chalk from 'chalk' ;
22import { BaseCommand } from '../common/base-command.js' ;
33import { PlanOrchestrator } from '../orchestrators/plan.js' ;
4+ import { Args } from '@oclif/core' ;
45
56export default class Plan extends BaseCommand {
67 static description =
@@ -22,16 +23,24 @@ For more information, visit: https://docs.codifycli.com/commands/plan`
2223 '<%= config.bin %> <%= command.id %> -p ../' ,
2324 ]
2425
26+ static args = {
27+ pathArgs : Args . string ( ) ,
28+ }
29+
2530 async init ( ) : Promise < void > {
2631 return super . init ( ) ;
2732 }
2833
2934 public async run ( ) : Promise < void > {
30- const { flags } = await this . parse ( Plan )
35+ const { flags, args } = await this . parse ( Plan )
36+
37+ if ( flags . path && args . pathArgs ) {
38+ throw new Error ( 'Cannot specify both --path and path argument' ) ;
39+ }
3140
3241 await PlanOrchestrator . run ( {
3342 verbosityLevel : flags . debug ? 3 : 0 ,
34- path : flags . path ,
43+ path : flags . path ?? args . pathArgs ,
3544 secureMode : flags . secure ,
3645 } , this . reporter ) ;
3746
You can’t perform that action at this time.
0 commit comments