burgee 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brand.js +2 -2
- package/dist/commander/command.js +2 -2
- package/dist/completions.js +6 -6
- package/dist/help.js +1 -1
- package/dist/yargs/cliui.js +1 -1
- package/dist/yargs/factory.js +2 -2
- package/package.json +4 -4
package/dist/brand.js
CHANGED
|
@@ -75,9 +75,9 @@ export function chargeRotation() {
|
|
|
75
75
|
export function placeCharge(markup, scale = CHARGE.scale) {
|
|
76
76
|
return `<g transform="${chargeTransform(scale)}">${markup}</g>`;
|
|
77
77
|
}
|
|
78
|
+
const bar = (at, fill) => `<rect x="${at.x}" y="${at.y}" width="${BAR.width}" height="${BAR.height}"` +
|
|
79
|
+
` rx="${BAR.radius}" fill="${fill}"/>`;
|
|
78
80
|
export function chargeGroup(colors, scale = CHARGE.scale) {
|
|
79
|
-
const bar = (at, fill) => `<rect x="${at.x}" y="${at.y}" width="${BAR.width}" height="${BAR.height}"` +
|
|
80
|
-
` rx="${BAR.radius}" fill="${fill}"/>`;
|
|
81
81
|
return (`<g transform="${chargeTransform(scale)}">` +
|
|
82
82
|
`<g transform="${chargeRotation()}">` +
|
|
83
83
|
`${bar(LEAD_BAR, colors.lead)}${bar(FOLLOW_BAR, colors.follow)}</g></g>`);
|
|
@@ -727,7 +727,7 @@ Expecting one of '${HOOK_EVENTS.join("', '")}'`);
|
|
|
727
727
|
if (arg.required && this.args[i] == null)
|
|
728
728
|
this.missingArgument(arg.name());
|
|
729
729
|
});
|
|
730
|
-
const last = this.registeredArguments
|
|
730
|
+
const last = this.registeredArguments.at(-1);
|
|
731
731
|
if (this.registeredArguments.length > 0 && last?.variadic)
|
|
732
732
|
return;
|
|
733
733
|
if (this.args.length > this.registeredArguments.length)
|
|
@@ -1193,7 +1193,7 @@ Expecting one of '${HOOK_EVENTS.join("', '")}'`);
|
|
|
1193
1193
|
if (alias === undefined)
|
|
1194
1194
|
return this._aliases[0];
|
|
1195
1195
|
let command = this;
|
|
1196
|
-
const last = this.commands
|
|
1196
|
+
const last = this.commands.at(-1);
|
|
1197
1197
|
if (this.commands.length !== 0 && last?._executableHandler) {
|
|
1198
1198
|
command = last;
|
|
1199
1199
|
}
|
package/dist/completions.js
CHANGED
|
@@ -54,7 +54,7 @@ const promise = (program, root) => walk(root).some((n) => Object.values(n.option
|
|
|
54
54
|
const fname = (program, path) => `_${[program, ...path].join('_').replaceAll(/[^A-Za-z0-9_]/g, '_')}`;
|
|
55
55
|
function bashCase(program, node) {
|
|
56
56
|
const opts = Object.entries(node.options).flatMap(([n, s]) => flags(n, s));
|
|
57
|
-
const subs = node.children.map((c) => c.path
|
|
57
|
+
const subs = node.children.map((c) => c.path.at(-1) ?? '');
|
|
58
58
|
const valued = Object.entries(node.options)
|
|
59
59
|
.filter(([, s]) => takesValue(s))
|
|
60
60
|
.map(([n, s]) => isDynamic(s)
|
|
@@ -114,8 +114,8 @@ function zshFunction(program, node) {
|
|
|
114
114
|
if (node.children.length === 0) {
|
|
115
115
|
return `${fname(program, node.path)}() {\n _arguments -s ${options.join(' ')} '*: :_files'\n}`;
|
|
116
116
|
}
|
|
117
|
-
const subs = node.children.map((c) => sq(`${c.path
|
|
118
|
-
const dispatch = node.children.map((c) => ` ${c.path
|
|
117
|
+
const subs = node.children.map((c) => sq(`${c.path.at(-1) ?? ''}[${c.description.replaceAll(/[[\]:]/g, ' ')}]`)).join(' ');
|
|
118
|
+
const dispatch = node.children.map((c) => ` ${c.path.at(-1) ?? ''}) ${fname(program, c.path)} ;;`).join('\n');
|
|
119
119
|
return `${fname(program, node.path)}() {
|
|
120
120
|
local context state state_descr line
|
|
121
121
|
typeset -A opt_args
|
|
@@ -153,7 +153,7 @@ function fish(program, root) {
|
|
|
153
153
|
for (const node of walk(root)) {
|
|
154
154
|
const cond = sq(fishCondition(node));
|
|
155
155
|
for (const c of node.children)
|
|
156
|
-
lines.push(`complete -c ${program} -n ${cond} -f -a ${c.path
|
|
156
|
+
lines.push(`complete -c ${program} -n ${cond} -f -a ${c.path.at(-1) ?? ''} -d ${sq(c.description)}`);
|
|
157
157
|
for (const [name, spec] of Object.entries(node.options)) {
|
|
158
158
|
lines.push(fishOption({ program, cond, node }, kebab(name), spec));
|
|
159
159
|
if (spec.negatable === true) {
|
|
@@ -168,7 +168,7 @@ ${lines.join('\n')}
|
|
|
168
168
|
`;
|
|
169
169
|
}
|
|
170
170
|
function pwshEntry(node) {
|
|
171
|
-
const subs = node.children.map((c) => `@('${c.path
|
|
171
|
+
const subs = node.children.map((c) => `@('${c.path.at(-1) ?? ''}', 'Command', '${c.description.replaceAll("'", "''")}')`);
|
|
172
172
|
const opts = Object.entries(node.options).flatMap(([n, s]) => flags(n, s).map((f) => `@('${f}', 'ParameterName', '${(s.description ?? '').replaceAll("'", "''")}')`));
|
|
173
173
|
const values = Object.entries(node.options)
|
|
174
174
|
.filter(([, s]) => s.choices !== undefined)
|
|
@@ -230,7 +230,7 @@ export function renderFigSpec(manifest) {
|
|
|
230
230
|
const { program, root } = completionTree(manifest);
|
|
231
231
|
const entries = new Map();
|
|
232
232
|
for (const node of walk(root)) {
|
|
233
|
-
const entry = { name: node.path
|
|
233
|
+
const entry = { name: node.path.at(-1) ?? program, options: figOptions(node) };
|
|
234
234
|
if (node.description !== '')
|
|
235
235
|
entry.description = node.description;
|
|
236
236
|
entries.set(node.path.join(' '), entry);
|
package/dist/help.js
CHANGED
|
@@ -96,7 +96,7 @@ function commandSections(manifest, node) {
|
|
|
96
96
|
for (const c of children) {
|
|
97
97
|
const heading = c.group ?? 'Commands:';
|
|
98
98
|
const rows = groups.get(heading) ?? [];
|
|
99
|
-
rows.push({ term: c.path
|
|
99
|
+
rows.push({ term: c.path.at(-1) ?? '', text: `${c.summary ?? c.description ?? ''}${deprecation(c.deprecated)}`.trim(), kind: 'command' });
|
|
100
100
|
groups.set(heading, rows);
|
|
101
101
|
}
|
|
102
102
|
return [...groups].map(([title, rows]) => ({ title, rows }));
|
package/dist/yargs/cliui.js
CHANGED
|
@@ -56,7 +56,7 @@ export class UI {
|
|
|
56
56
|
width: i === 0 && columns.length > 1 ? leftColumnWidth : undefined,
|
|
57
57
|
})));
|
|
58
58
|
});
|
|
59
|
-
return this.rows
|
|
59
|
+
return this.rows.at(-1);
|
|
60
60
|
}
|
|
61
61
|
colFromString(text) {
|
|
62
62
|
return { text, padding: this.measurePadding(text) };
|
package/dist/yargs/factory.js
CHANGED
|
@@ -743,7 +743,7 @@ export class YargsInstance {
|
|
|
743
743
|
return false;
|
|
744
744
|
return supportedOpts.includes(k);
|
|
745
745
|
});
|
|
746
|
-
const fullCommand = this.#context.fullCommands
|
|
746
|
+
const fullCommand = this.#context.fullCommands.at(-1);
|
|
747
747
|
const parseOptions = fullCommand ? this.#command.cmdToParseOptions(fullCommand) : { array: [], alias: {}, default: {}, demand: {} };
|
|
748
748
|
objectKeys(parseOptions).forEach((pk) => {
|
|
749
749
|
const parseOption = parseOptions[pk];
|
|
@@ -1515,7 +1515,7 @@ export class YargsInstance {
|
|
|
1515
1515
|
return this.#postProcess(argv, populateDoubleDash, !!calledFromCommand, false);
|
|
1516
1516
|
if (this.#helpOpt) {
|
|
1517
1517
|
const helpCmds = [this.#helpOpt].concat(aliases[this.#helpOpt] || []).filter((k) => k.length > 1);
|
|
1518
|
-
if (helpCmds.includes(`${argv._
|
|
1518
|
+
if (helpCmds.includes(`${argv._.at(-1)}`)) {
|
|
1519
1519
|
argv._.pop();
|
|
1520
1520
|
helpOptSet = true;
|
|
1521
1521
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "burgee",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "An agent-native CLI framework, drop-in compatible with commander and yargs. One declaration; help, --json, --schema, --mcp and completions all projected from it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -148,10 +148,10 @@
|
|
|
148
148
|
},
|
|
149
149
|
"dependencies": {
|
|
150
150
|
"bellpull": "^0.4.2",
|
|
151
|
-
"closeout": "^0.5.
|
|
151
|
+
"closeout": "^0.5.4",
|
|
152
152
|
"linegauge": "^0.5.4",
|
|
153
|
-
"roundel": "^0.5.
|
|
154
|
-
"seniority": "^0.6.
|
|
153
|
+
"roundel": "^0.5.4",
|
|
154
|
+
"seniority": "^0.6.3"
|
|
155
155
|
},
|
|
156
156
|
"devDependencies": {
|
|
157
157
|
"vitest": "^5.0.1"
|