@bemoje/cli 3.1.0 → 3.1.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/lib/index.cjs +1516 -59
- package/lib/index.d.cts +2658 -6
- package/lib/index.d.ts +2658 -6
- package/lib/index.js +1504 -8
- package/package.json +53 -85
- package/lib/lib/Command.cjs +0 -450
- package/lib/lib/Command.d.cts +0 -1
- package/lib/lib/Command.d.ts +0 -1
- package/lib/lib/Command.js +0 -443
- package/lib/lib/Help.cjs +0 -552
- package/lib/lib/Help.d.cts +0 -1
- package/lib/lib/Help.d.ts +0 -1
- package/lib/lib/Help.js +0 -545
- package/lib/lib/helpers/findCommand.cjs +0 -14
- package/lib/lib/helpers/findCommand.d.cts +0 -8
- package/lib/lib/helpers/findCommand.d.ts +0 -8
- package/lib/lib/helpers/findCommand.js +0 -11
- package/lib/lib/helpers/findOption.cjs +0 -16
- package/lib/lib/helpers/findOption.d.cts +0 -8
- package/lib/lib/helpers/findOption.d.ts +0 -8
- package/lib/lib/helpers/findOption.js +0 -14
- package/lib/lib/helpers/getCommandAncestors.cjs +0 -12
- package/lib/lib/helpers/getCommandAncestors.d.cts +0 -8
- package/lib/lib/helpers/getCommandAncestors.d.ts +0 -8
- package/lib/lib/helpers/getCommandAncestors.js +0 -9
- package/lib/lib/helpers/getCommandAndAncestors.cjs +0 -15
- package/lib/lib/helpers/getCommandAndAncestors.d.cts +0 -8
- package/lib/lib/helpers/getCommandAndAncestors.d.ts +0 -8
- package/lib/lib/helpers/getCommandAndAncestors.js +0 -13
- package/lib/lib/helpers/parseOptionFlags.cjs +0 -28
- package/lib/lib/helpers/parseOptionFlags.d.cts +0 -13
- package/lib/lib/helpers/parseOptionFlags.d.ts +0 -13
- package/lib/lib/helpers/parseOptionFlags.js +0 -26
- package/lib/lib/types.cjs +0 -2
- package/lib/lib/types.d.cts +0 -1
- package/lib/lib/types.d.ts +0 -1
- package/lib/lib/types.js +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
function getCommandAndAncestors(cmd) {
|
|
6
|
-
const result = [];
|
|
7
|
-
let command = cmd;
|
|
8
|
-
for (; command; command = command.parent) {
|
|
9
|
-
result.push(command);
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
__name(getCommandAndAncestors, "getCommandAndAncestors");
|
|
14
|
-
|
|
15
|
-
exports.getCommandAndAncestors = getCommandAndAncestors;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as ICommand } from '../../Command--Ojy3KHE.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns command and all ancestor commands in hierarchy
|
|
5
|
-
*/
|
|
6
|
-
declare function getCommandAndAncestors<C extends ICommand>(cmd: C): [typeof cmd, ...ICommand[]];
|
|
7
|
-
|
|
8
|
-
export { getCommandAndAncestors };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as ICommand } from '../../Command--Ojy3KHE.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns command and all ancestor commands in hierarchy
|
|
5
|
-
*/
|
|
6
|
-
declare function getCommandAndAncestors<C extends ICommand>(cmd: C): [typeof cmd, ...ICommand[]];
|
|
7
|
-
|
|
8
|
-
export { getCommandAndAncestors };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { __name } from '../../chunk-SHUYVCID.js';
|
|
2
|
-
|
|
3
|
-
function getCommandAndAncestors(cmd) {
|
|
4
|
-
const result = [];
|
|
5
|
-
let command = cmd;
|
|
6
|
-
for (; command; command = command.parent) {
|
|
7
|
-
result.push(command);
|
|
8
|
-
}
|
|
9
|
-
return result;
|
|
10
|
-
}
|
|
11
|
-
__name(getCommandAndAncestors, "getCommandAndAncestors");
|
|
12
|
-
|
|
13
|
-
export { getCommandAndAncestors };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
function parseOptionFlags(flags) {
|
|
6
|
-
const match = flags.match(/^-(.+?), --([A-Za-z][\w-]*)(?:\s*(<(.+?)>|\[(.+?)]))?$/);
|
|
7
|
-
if (!match) {
|
|
8
|
-
throw new Error(`Invalid option format: ${flags}`);
|
|
9
|
-
}
|
|
10
|
-
const short = match[1];
|
|
11
|
-
if (short.length !== 1) {
|
|
12
|
-
throw new Error(`Expected short name to be a single character. Got: -${short}`);
|
|
13
|
-
}
|
|
14
|
-
const long = match[2];
|
|
15
|
-
const argName = (match[4] || match[5])?.replace(/\.{3}$/, "") || void 0;
|
|
16
|
-
const name = long.split("-").reduce((str, word) => {
|
|
17
|
-
return str + word[0].toUpperCase() + word.slice(1);
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
short,
|
|
21
|
-
long,
|
|
22
|
-
name,
|
|
23
|
-
argName
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
__name(parseOptionFlags, "parseOptionFlags");
|
|
27
|
-
|
|
28
|
-
exports.parseOptionFlags = parseOptionFlags;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { m as OptionUsage, D as CamelCase } from '../../Command--Ojy3KHE.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Parses option flags string into its components
|
|
5
|
-
*/
|
|
6
|
-
declare function parseOptionFlags<Long extends string>(flags: OptionUsage<Long>): {
|
|
7
|
-
short: string;
|
|
8
|
-
long: Long;
|
|
9
|
-
name: CamelCase<Long>;
|
|
10
|
-
argName: string | undefined;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { parseOptionFlags };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { m as OptionUsage, D as CamelCase } from '../../Command--Ojy3KHE.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Parses option flags string into its components
|
|
5
|
-
*/
|
|
6
|
-
declare function parseOptionFlags<Long extends string>(flags: OptionUsage<Long>): {
|
|
7
|
-
short: string;
|
|
8
|
-
long: Long;
|
|
9
|
-
name: CamelCase<Long>;
|
|
10
|
-
argName: string | undefined;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { parseOptionFlags };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { __name } from '../../chunk-SHUYVCID.js';
|
|
2
|
-
|
|
3
|
-
function parseOptionFlags(flags) {
|
|
4
|
-
const match = flags.match(/^-(.+?), --([A-Za-z][\w-]*)(?:\s*(<(.+?)>|\[(.+?)]))?$/);
|
|
5
|
-
if (!match) {
|
|
6
|
-
throw new Error(`Invalid option format: ${flags}`);
|
|
7
|
-
}
|
|
8
|
-
const short = match[1];
|
|
9
|
-
if (short.length !== 1) {
|
|
10
|
-
throw new Error(`Expected short name to be a single character. Got: -${short}`);
|
|
11
|
-
}
|
|
12
|
-
const long = match[2];
|
|
13
|
-
const argName = (match[4] || match[5])?.replace(/\.{3}$/, "") || void 0;
|
|
14
|
-
const name = long.split("-").reduce((str, word) => {
|
|
15
|
-
return str + word[0].toUpperCase() + word.slice(1);
|
|
16
|
-
});
|
|
17
|
-
return {
|
|
18
|
-
short,
|
|
19
|
-
long,
|
|
20
|
-
name,
|
|
21
|
-
argName
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
__name(parseOptionFlags, "parseOptionFlags");
|
|
25
|
-
|
|
26
|
-
export { parseOptionFlags };
|
package/lib/lib/types.cjs
DELETED
package/lib/lib/types.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { A as ActionHandler, a as AllowedArgumentUsage, b as Argument, c as ArgumentOptions, d as ArgumentUsage, e as Arguments, B as BooleanOptionOptions, f as HookActionHandler, g as HookDefinition, h as HookPredicate, I as ICommand, i as IHelp, j as InferAddOptionResult, k as InferAddedArgumentType, L as Logger, O as Option, l as OptionOptions, m as OptionUsage, n as OptionalArgumentOptions, o as OptionalArgumentOptionsWithDefaultValue, p as OptionalArgumentUsage, q as OptionalOptionOptions, r as OptionalVariadicArgumentOptions, s as OptionalVariadicArgumentUsage, t as OptionalVariadicOptionOptions, u as Options, P as ParseArgvResult, R as RequiredArgumentOptions, v as RequiredArgumentUsage, w as RequiredOptionOptions, x as RequiredVariadicArgumentOptions, y as RequiredVariadicArgumentUsage, z as RequiredVariadicOptionOptions, S as SubCommands } from '../Command--Ojy3KHE.cjs';
|
package/lib/lib/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { A as ActionHandler, a as AllowedArgumentUsage, b as Argument, c as ArgumentOptions, d as ArgumentUsage, e as Arguments, B as BooleanOptionOptions, f as HookActionHandler, g as HookDefinition, h as HookPredicate, I as ICommand, i as IHelp, j as InferAddOptionResult, k as InferAddedArgumentType, L as Logger, O as Option, l as OptionOptions, m as OptionUsage, n as OptionalArgumentOptions, o as OptionalArgumentOptionsWithDefaultValue, p as OptionalArgumentUsage, q as OptionalOptionOptions, r as OptionalVariadicArgumentOptions, s as OptionalVariadicArgumentUsage, t as OptionalVariadicOptionOptions, u as Options, P as ParseArgvResult, R as RequiredArgumentOptions, v as RequiredArgumentUsage, w as RequiredOptionOptions, x as RequiredVariadicArgumentOptions, y as RequiredVariadicArgumentUsage, z as RequiredVariadicOptionOptions, S as SubCommands } from '../Command--Ojy3KHE.js';
|
package/lib/lib/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|