@@ -78,49 +78,48 @@ program
7878const completion = tab ( program ) ;
7979
8080// Configure custom completions
81- // This needs rewriting with config passed into tab(program)?
82- // for (const command of completion.commands.values()) {
83- // if (command.value === 'lint') {
84- // // Note: Direct handler assignment is not supported in the current API
85- // // Custom completion logic would need to be implemented differently
86- // }
81+ for ( const command of completion . commands . values ( ) ) {
82+ if ( command . value === 'lint' ) {
83+ // Note: Direct handler assignment is not supported in the current API
84+ // Custom completion logic would need to be implemented differently
85+ }
8786
88- // for (const [option, config] of command.options.entries()) {
89- // if (option === '--port') {
90- // config.handler = () => {
91- // return [
92- // { value: '3000', description: 'Default port' },
93- // { value: '8080', description: 'Alternative port' },
94- // ];
95- // };
96- // }
97- // if (option === '--host') {
98- // config.handler = () => {
99- // return [
100- // { value: 'localhost', description: 'Local development' },
101- // { value: '0.0.0.0', description: 'All interfaces' },
102- // ];
103- // };
104- // }
105- // if (option === '--mode') {
106- // config.handler = () => {
107- // return [
108- // { value: 'development', description: 'Development mode' },
109- // { value: 'production', description: 'Production mode' },
110- // { value: 'test', description: 'Test mode' },
111- // ];
112- // };
113- // }
114- // if (option === '--config') {
115- // config.handler = () => {
116- // return [
117- // { value: 'config.json', description: 'JSON config file' },
118- // { value: 'config.yaml', description: 'YAML config file' },
119- // ];
120- // };
121- // }
122- // }
123- // }
87+ for ( const [ option , config ] of command . options . entries ( ) ) {
88+ if ( option === '--port' ) {
89+ config . handler = ( ) => {
90+ return [
91+ { value : '3000' , description : 'Default port' } ,
92+ { value : '8080' , description : 'Alternative port' } ,
93+ ] ;
94+ } ;
95+ }
96+ if ( option === '--host' ) {
97+ config . handler = ( ) => {
98+ return [
99+ { value : 'localhost' , description : 'Local development' } ,
100+ { value : '0.0.0.0' , description : 'All interfaces' } ,
101+ ] ;
102+ } ;
103+ }
104+ if ( option === '--mode' ) {
105+ config . handler = ( ) => {
106+ return [
107+ { value : 'development' , description : 'Development mode' } ,
108+ { value : 'production' , description : 'Production mode' } ,
109+ { value : 'test' , description : 'Test mode' } ,
110+ ] ;
111+ } ;
112+ }
113+ if ( option === '--config' ) {
114+ config . handler = ( ) => {
115+ return [
116+ { value : 'config.json' , description : 'JSON config file' } ,
117+ { value : 'config.yaml' , description : 'YAML config file' } ,
118+ ] ;
119+ } ;
120+ }
121+ }
122+ }
124123
125124// Parse command line arguments
126125program . parse ( ) ;
0 commit comments