@@ -6,6 +6,10 @@ import { encodeSVGDatauri, decodeSVGDatauri } from './tools.js';
66import { loadConfig , optimize } from '../svgo-node.js' ;
77import { builtin } from '../builtin.js' ;
88
9+ /**
10+ * @typedef {import('commander').Command } Command
11+ */
12+
913const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
1014const pkgPath = path . join ( __dirname , '../../package.json' ) ;
1115const PKG = JSON . parse ( fs . readFileSync ( pkgPath , 'utf-8' ) ) ;
@@ -25,14 +29,15 @@ export function checkIsDir(filePath) {
2529 }
2630}
2731
32+ /**
33+ * @param {Command } program
34+ */
2835export default function makeProgram ( program ) {
2936 program
3037 . name ( PKG . name )
31- . description ( PKG . description , {
32- INPUT : 'Alias to --input' ,
33- } )
38+ . description ( PKG . description )
3439 . version ( PKG . version , '-v, --version' )
35- . arguments ( '[INPUT...]' )
40+ . argument ( '[INPUT...]' , 'Alias to --input ')
3641 . option ( '-i, --input <INPUT...>' , 'Input files, "-" for STDIN' )
3742 . option ( '-s, --string <STRING>' , 'Input SVG data string' )
3843 . option (
0 commit comments