(q)
| 7934 | `)return"";return(W>0?j:"")+P.trimEnd()}).join(` |
| 7935 | `)}}hbY.Help=UFK});var c_7=m((IbY)=>{var{InvalidArgumentError:CbY}=eq8();class QFK{constructor(q,K){this.flags=q,this.description=K||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let _=xbY(q);if(this.short=_.shortFlag,this.long=_.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(q,K){return this.defaultValue=q,this.defaultValueDescription=K,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let K=q;if(typeof q==="string")K={[q]:!0};return this.implied=Object.assign(this.implied||{},K),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_concatValue(q,K){if(K===this.defaultValue||!Array.isArray(K))return[q];return K.concat(q)}choices(q){return this.argChoices=q.slice(),this.parseArg=(K,_)=>{if(!this.argChoices.includes(K))throw new CbY(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(K,_);return K},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return bbY(this.name().replace(/^no-/,""))}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class dFK{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((K)=>{if(K.negate)this.negativeOptions.set(K.attributeName(),K);else this.positiveOptions.set(K.attributeName(),K)}),this.negativeOptions.forEach((K,_)=>{if(this.positiveOptions.has(_))this.dualOptions.add(_)})}valueFromOption(q,K){let _=K.attributeName();if(!this.dualOptions.has(_))return!0;let z=this.negativeOptions.get(_).presetArg,Y=z!==void 0?z:!1;return K.negate===(Y===q)}}function bbY(q){return q.split("-").reduce((K,_)=>{return K+_[0].toUpperCase()+_.slice(1)})}function xbY(q){let K,_,z=q.split(/[ |,]+/);if(z.length>1&&!/^[[<]/.test(z[1]))K=z.shift();if(_=z.shift(),!K&&/^-[^-]$/.test(_))K=_,_=void 0;return{shortFlag:K,longFlag:_}}IbY.Option=QFK;IbY.DualOptions=dFK});var cFK=m((gbY)=>{function pbY(q,K){if(Math.abs(q.length-K.length)>3)return Math.max(q.length,K.length);let _=[];for(let z=0;z<=q.length;z++)_[z]=[z];for(let z=0;z<=K.length;z++)_[0][z]=z;for(let z=1;z<=K.length;z++)for(let Y=1;Y<=q.length;Y++){let $=1;if(q[Y-1]===K[z-1])$=0;else $=1;if(_[Y][z]=Math.min(_[Y-1][z]+1,_[Y][z-1]+1,_[Y-1][z-1]+$),Y>1&&z>1&&q[Y-1]===K[z-2]&&q[Y-2]===K[z-1])_[Y][z]=Math.min(_[Y][z],_[Y-2][z-2]+1)}return _[q.length][K.length]}function BbY(q,K){if(!K||K.length===0)return"";K=Array.from(new Set(K));let _=q.startsWith("--");if(_)q=q.slice(2),K=K.map((A)=>A.slice(2));let z=[],Y=3,$=0.4;if(K.forEach((A)=>{if(A.length<=1)return;let O=pbY(q,A),w=Math.max(q.length,A.length);if((w-O)/w>$){if(O<Y)Y=O,z=[A];else if(O===Y)z.push(A)}}),z.sort((A,O)=>A.localeCompare(O)),_)z=z.map((A)=>`--${A}`);if(z.length>1)return` |
| 7936 | (Did you mean one of ${z.join(", ")}?)`;if(z.length===1)return` |
| 7937 | (Did you mean ${z[0]}?)`;return""}gbY.suggestSimilar=BbY});var rFK=m((nbY)=>{var UbY=U6("node:events").EventEmitter,l_7=U6("node:child_process"),hs=U6("node:path"),n_7=U6("node:fs"),pJ=U6("node:process"),{Argument:QbY,humanReadableArgName:dbY}=iQ8(),{CommanderError:i_7}=eq8(),{Help:cbY}=d_7(),{Option:lFK,DualOptions:lbY}=c_7(),{suggestSimilar:nFK}=cFK();class r_7 extends UbY{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:(K)=>pJ.stdout.write(K),writeErr:(K)=>pJ.stderr.write(K),getOutHelpWidth:()=>pJ.stdout.isTTY?pJ.stdout.columns:void 0,getErrHelpWidth:()=>pJ.stderr.isTTY?pJ.stderr.columns:void 0,outputError:(K,_)=>_(K)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let K=this;K;K=K.parent)q.push(K);return q}command(q,K,_){let z=K,Y=_;if(typeof z==="object"&&z!==null)Y=z,z=null;Y=Y||{};let[,$,A]=q.match(/([^ ]+) *(.*)/),O=this.createCommand($);if(z)O.description(z),O._executableHandler=!0;if(Y.isDefault)this._defaultCommandName=O._name;if(O._hidden=!!(Y.noHelp||Y.hidden),O._executableFile=Y.executableFile||null,A)O.arguments(A);if(this._registerCommand(O),O.parent=this,O.copyInheritedSettings(this),z)return this;return O}createCommand(q){return new r_7(q)}createHelp(){return Object.assign(new cbY,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,q),this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,K){if(!q._name)throw Error(`Command passed to .addCommand() must have a name |
| 7938 | - specify the name in Command constructor or using .name()`);if(K=K||{},K.isDefault)this._defaultCommandName=q._name;if(K.noHelp||K.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,K){return new QbY(q,K)}argument(q,K,_,z){let Y=this.createArgument(q,K);if(typeof _==="function")Y.default(z).argParser(_);else Y.default(_);return this.addArgument(Y),this}arguments(q){return q.trim().split(/ +/).forEach((K)=>{this.argument(K)}),this}addArgument(q){let K=this.registeredArguments.slice(-1)[0];if(K&&K.variadic)throw Error(`only the last argument can be variadic '${K.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,K){if(typeof q==="boolean")return this._addImplicitHelpCommand=q,this;q=q??"help [command]";let[,_,z]=q.match(/([^ ]+) *(.*)/),Y=K??"display help for command",$=this.createCommand(_);if($.helpOption(!1),z)$.arguments(z);if(Y)$.description(Y);return this._addImplicitHelpCommand=!0,this._helpCommand=$,this}addHelpCommand(q,K){if(typeof q!=="object")return this.helpCommand(q,K),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,K){let _=["preSubcommand","preAction","postAction"];if(!_.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'. |
| 7939 | Expecting one of '${_.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(K);else this._lifeCycleHooks[q]=[K];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(K)=>{if(K.code!=="commander.executeSubCommandAsync")throw K};return this}_exit(q,K,_){if(this._exitCallback)this._exitCallback(new i_7(q,K,_));pJ.exit(q)}action(q){let K=(_)=>{let z=this.registeredArguments.length,Y=_.slice(0,z);if(this._storeOptionsAsProperties)Y[z]=this;else Y[z]=this.opts();return Y.push(this),q.apply(this,Y)};return this._actionHandler=K,this}createOption(q,K){return new lFK(q,K)}_callParseArg(q,K,_,z){try{return q.parseArg(K,_)}catch(Y){if(Y.code==="commander.invalidArgument"){let $=`${z} ${Y.message}`;this.error($,{exitCode:Y.exitCode,code:Y.code})}throw Y}}_registerOption(q){let K=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(K){let _=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${_}' |
no outgoing calls
no test coverage detected