Lines 1-33javascript
2"use strict";var Yr=Object.create;var $e=Object.defineProperty;var Qr=Object.getOwnPropertyDescriptor;var Zr=Object.getOwnPropertyNames;var Xr=Object.getPrototypeOf,ei=Object.prototype.hasOwnProperty;var ti=(n,e)=>()=>(n&&(e=n(n=0)),e);var K=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Dn=(n,e)=>{for(var t in e)$e(n,t,{get:e[t],enumerable:!0})},pn=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Zr(e))!ei.call(n,s)&&s!==t&&$e(n,s,{get:()=>e[s],enumerable:!(i=Qr(e,s))||i.enumerable});return n};var k=(n,e,t)=>(t=n!=null?Yr(Xr(n)):{},pn(e||!n||!n.__esModule?$e(t, ...
3`)}displayWidth(e){return dn(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOpti ...
4`+" ".repeat(t+a)),r+u+" ".repeat(a)+D.replace(/\n/g,`
5${r}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,o=[];return i.forEach(r=>{let u=r.match(s);if(u===null){o.push(""
6`)}};function dn(n){let e=/\x1b\[\d*(;\d*)*m/g;return n.replace(e,"")}st.Help=it;st.stripColor=dn});var ct=K(lt=>{var{InvalidArgumentError:oi}=Ee(),ut=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>
7- a short flag is a single dash and a single character
8 - either use a single dash and a single character (for a short flag)
9 - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(r)?new Error(`${u}
10- too many short flags`):s.test(r)?new Error(`${u}
11- too many long flags`):new Error(`${u}
12- unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${n}'.`);return{shortFlag:e,longFlag:t}}lt.Option=ut;lt.DualOptions=at});var fn=K(mn=>{function ai(n,e){if(Math.abs(n.length-e.length)>3)return Math.max(n.length,e.length);let t=[];for(let i=0;i<=n.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let s=1;s<=n.length;s++){let o=1;n[s-1]===e[i-1]?o=0:o=1,t[s][i]=Math.min(t[s-1][i]+1,t[s][i-1]+1,t[s-1][i-1]+o),s>1&&i>1&&n[s-1]===e[i-2]&&n[s-2]===e[i-1]&&(t[s][i]=Math.min(t[s][i],t[s-2][i ...
13(Did you mean one of ${i.join(", ")}?)`:i.length===1?`
14(Did you mean ${i[0]}?)`:""}mn.suggestSimilar=li});var yn=K(mt=>{var ci=require("node:events").EventEmitter,Dt=require("node:child_process"),Y=require("node:path"),Be=require("node:fs"),E=require("node:process"),{Argument:Di,humanReadableArgName
15- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Di(e,t)}argument(e,t,i,s){let o=this.createArgument(e,t);return typeof i=="function"?o.default(s).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last ar ...
HighChild Process
Package source references child process execution.
dist/bundle.jsView on unpkg · L13 16Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,i){this._exitCallback&&this._exitCallback(new pt(e,t,i)),E.exit(e)}action(e){let t=i=>{let s=this.registeredArguments.length,o=i.slice(0,s);return this._storeOptionsAsProperties?o[s]=this:o[s]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new gn(e,t)}_callParseArg(e,t,i ...
17- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=s=>[s.name()].concat(s.aliases()),i=t(e).find(s=>this._findCommand(s));if(i){let s=t(this._findCommand(i)).join("|"
18- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,i){if(Be.existsSync(e))return;let s=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
19 - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20 - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21 - ${s}`;throw new Error(o)}_executeSubCommand(e,t){t=t.slice();let i=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,D){let h=Y.resolve(l,D);if(Be.existsSync(h))return h;if(s.includes(Y.extname(D)))return;let m=s.find(C=>Be.existsSync(`${h}${C}`));if(m)return`${h}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let l;try{l=Be.realpathSync(this._scriptPath)}catch{l=this._scriptPath}u=Y.resolve(Y.dirname(l),u)}if(u){let l=o(u,r);if(!l&&!e._executableFile&&this. ...
22`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24`),this.outputHelp({error:!0}));let i=t||{},s=i.exitCode||1,o=i.code||"commander.error";this._exit(s,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in E.env){let t=e.attributeName();(this.getOptionValue(t)
25`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let s=[i.name()].concat(i.aliases()).join("|");throw new Error(` ...
26Expecting one of '${i.join("', '")}'`);let s=`${e}Help`;return this.on(s,o=>{let r;typeof t=="function"?r=t({error:o.error,command:o.command}):r=t,r&&o.write(`${r}
27`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(s=>t.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Fn(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",s="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?t=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=o[1],/^\d+$/.test(o[3])?s=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=o[1],i=o[3],s=o[4]),t&&s!=="0"?`${t}=${i}:${parseInt(s)+1}`:e})}function ht(){if(E.env.NO_COLOR||E.env.FORCE_COL ...
28`)];for(let[c,l]of a.entries()){if(i+=l,Re.has(l)){let{groups:h}=new RegExp(`(?:\\${Ln}(?<code>\\d+)m|\\${At}(?<uri>.*)${$t})`).exec(a.slice(c).join(""))||{groups:{}};if(h.code!==void
29`?(o&&(i+=Pn("")),s&&D&&(i+=Tn(D))):l===`
30`&&(s&&D&&(i+=Tn(s)),o&&(i+=Pn(o)))}return i};function In(n,e,t){return String(n).normalize().replace(/\r\n/g,`
32`).map(i=>Ni(i,e,t)).join(`
33`)}var Mi=["up","down","left","right","space","enter","cancel"],Te={actions:new Set(Mi),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape"
Long lines were clipped for display.