summaryrefslogtreecommitdiff
path: root/frontend-old/node_modules/yargs/build/lib/parse-command.js
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2025-11-16 19:08:29 +0800
committeraltaf-creator <dev@altafcreator.com>2025-11-16 19:08:29 +0800
commit434aa8343fdcbb4d5002f934979913c099489bee (patch)
tree55bab4ec5a6151be57797d34f61faf5ea744471b /frontend-old/node_modules/yargs/build/lib/parse-command.js
parent893c388d4e99442a36005e5971a87730623f946e (diff)
sdk, del
Diffstat (limited to 'frontend-old/node_modules/yargs/build/lib/parse-command.js')
-rw-r--r--frontend-old/node_modules/yargs/build/lib/parse-command.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/frontend-old/node_modules/yargs/build/lib/parse-command.js b/frontend-old/node_modules/yargs/build/lib/parse-command.js
deleted file mode 100644
index 4989f53..0000000
--- a/frontend-old/node_modules/yargs/build/lib/parse-command.js
+++ /dev/null
@@ -1,32 +0,0 @@
-export function parseCommand(cmd) {
- const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' ');
- const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
- const bregex = /\.*[\][<>]/g;
- const firstCommand = splitCommand.shift();
- if (!firstCommand)
- throw new Error(`No command found in: ${cmd}`);
- const parsedCommand = {
- cmd: firstCommand.replace(bregex, ''),
- demanded: [],
- optional: [],
- };
- splitCommand.forEach((cmd, i) => {
- let variadic = false;
- cmd = cmd.replace(/\s/g, '');
- if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1)
- variadic = true;
- if (/^\[/.test(cmd)) {
- parsedCommand.optional.push({
- cmd: cmd.replace(bregex, '').split('|'),
- variadic,
- });
- }
- else {
- parsedCommand.demanded.push({
- cmd: cmd.replace(bregex, '').split('|'),
- variadic,
- });
- }
- });
- return parsedCommand;
-}