File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -320,16 +320,16 @@ class Command extends EventEmitter {
320320 *
321321 * @param {string } name
322322 * @param {string } [description]
323- * @param {(Function|*) } [fn ] - custom argument processing function
323+ * @param {(Function|*) } [parseArg ] - custom argument processing function or default value
324324 * @param {* } [defaultValue]
325325 * @return {Command } `this` command for chaining
326326 */
327- argument ( name , description , fn , defaultValue ) {
327+ argument ( name , description , parseArg , defaultValue ) {
328328 const argument = this . createArgument ( name , description ) ;
329- if ( typeof fn === 'function' ) {
330- argument . default ( defaultValue ) . argParser ( fn ) ;
329+ if ( typeof parseArg === 'function' ) {
330+ argument . default ( defaultValue ) . argParser ( parseArg ) ;
331331 } else {
332- argument . default ( fn ) ;
332+ argument . default ( parseArg ) ;
333333 }
334334 this . addArgument ( argument ) ;
335335 return this ;
Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ export class Command {
467467 argument < T > (
468468 flags : string ,
469469 description : string ,
470- fn : ( value : string , previous : T ) => T ,
470+ parseArg : ( value : string , previous : T ) => T ,
471471 defaultValue ?: T ,
472472 ) : this;
473473 argument ( name : string , description ?: string , defaultValue ?: unknown ) : this;
You can’t perform that action at this time.
0 commit comments