@@ -16,8 +16,8 @@ import net from "net";
1616 */
1717export function mergeArgsAndExec ( command : Command , func : Function ) {
1818 const options = {
19- ...( command . parent ! . opts ( ) ) ,
20- ...( command . opts ( ) ) ,
19+ ...command . parent ! . opts ( ) ,
20+ ...command . opts ( ) ,
2121 } ;
2222
2323 const resolvedLogLevel =
@@ -162,9 +162,10 @@ export const serve = program
162162/* Adding the 'host' option to the serve command */ {
163163 serve . option (
164164 "-H, --host <ip-address>" ,
165- "The host to use ports from." ,
165+ "The host to use ports from." ,
166166 ( value ) => {
167- if ( ! net . isIP ( value ) ) throw new Error ( `${ value } is not a valid IP address` ) ;
167+ if ( ! net . isIP ( value ) )
168+ throw new Error ( `${ value } is not a valid IP address` ) ;
168169 else return value ;
169170 } ,
170171 ServeArgs . defaults . host ,
@@ -173,8 +174,8 @@ export const serve = program
173174
174175/* Adding the 'port' option to the serve command */ {
175176 serve . option (
176- "-p, --port <int>" ,
177- "The port to listen on and serve the slides from." ,
177+ "-p, --port <int>" ,
178+ "The port to listen on and serve the slides from." ,
178179 ( value ) => Number ( value ) ,
179180 ServeArgs . defaults . port ,
180181 ) ;
@@ -184,7 +185,7 @@ export const serve = program
184185 serve . option (
185186 "-r, --root <prefix>" ,
186187 "The root prefix the serve on. If specified serve from that subdirectory." ,
187- ( value ) => {
188+ ( value ) => {
188189 if ( value . startsWith ( "/" ) ) return value ;
189190 else throw new Error ( `root paths must start with '/', but got ${ value } ` ) ;
190191 } ,
@@ -194,7 +195,8 @@ export const serve = program
194195
195196/* Try parsing the arguments */ {
196197 if ( import . meta. url === `file://${ process . argv [ 1 ] } ` ) {
197- try { // being run as main file, not imported.
198+ try {
199+ // being run as main file, not imported.
198200 program . parse ( process . argv , { from : "node" } ) ;
199201 } catch ( error : any ) {
200202 if ( error . code === "commander.unknownOption" ) process . exit ( 3 ) ;
0 commit comments