typescript-virtual-container 1.2.8 → 1.3.0
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/.vscode/settings.json +0 -1
- package/README.md +462 -44
- package/biome.json +7 -0
- package/dist/SSHMimic/exec.d.ts.map +1 -1
- package/dist/SSHMimic/executor.d.ts.map +1 -1
- package/dist/SSHMimic/executor.js +35 -21
- package/dist/SSHMimic/index.d.ts.map +1 -1
- package/dist/SSHMimic/index.js +20 -6
- package/dist/VirtualFileSystem/binaryPack.d.ts.map +1 -1
- package/dist/VirtualFileSystem/binaryPack.js +29 -6
- package/dist/VirtualFileSystem/index.d.ts.map +1 -1
- package/dist/VirtualFileSystem/index.js +36 -13
- package/dist/VirtualPackageManager/index.d.ts +202 -0
- package/dist/VirtualPackageManager/index.d.ts.map +1 -0
- package/dist/VirtualPackageManager/index.js +825 -0
- package/dist/VirtualShell/index.d.ts +93 -12
- package/dist/VirtualShell/index.d.ts.map +1 -1
- package/dist/VirtualShell/index.js +95 -13
- package/dist/VirtualShell/shell.d.ts.map +1 -1
- package/dist/VirtualShell/shell.js +3 -1
- package/dist/VirtualShell/shellParser.d.ts.map +1 -1
- package/dist/VirtualUserManager/index.d.ts +52 -20
- package/dist/VirtualUserManager/index.d.ts.map +1 -1
- package/dist/VirtualUserManager/index.js +54 -20
- package/dist/commands/adduser.d.ts +6 -0
- package/dist/commands/adduser.d.ts.map +1 -1
- package/dist/commands/adduser.js +6 -0
- package/dist/commands/alias.d.ts +9 -0
- package/dist/commands/alias.d.ts.map +1 -0
- package/dist/commands/alias.js +63 -0
- package/dist/commands/apt.d.ts +9 -0
- package/dist/commands/apt.d.ts.map +1 -0
- package/dist/commands/apt.js +205 -0
- package/dist/commands/awk.d.ts +11 -0
- package/dist/commands/awk.d.ts.map +1 -1
- package/dist/commands/awk.js +15 -2
- package/dist/commands/base64.d.ts +5 -0
- package/dist/commands/base64.d.ts.map +1 -1
- package/dist/commands/base64.js +9 -1
- package/dist/commands/cat.d.ts +5 -0
- package/dist/commands/cat.d.ts.map +1 -1
- package/dist/commands/cat.js +35 -8
- package/dist/commands/cd.d.ts +5 -0
- package/dist/commands/cd.d.ts.map +1 -1
- package/dist/commands/cd.js +5 -0
- package/dist/commands/chmod.d.ts +5 -0
- package/dist/commands/chmod.d.ts.map +1 -1
- package/dist/commands/chmod.js +57 -3
- package/dist/commands/command-helpers.d.ts +78 -4
- package/dist/commands/command-helpers.d.ts.map +1 -1
- package/dist/commands/command-helpers.js +78 -4
- package/dist/commands/cp.d.ts +5 -0
- package/dist/commands/cp.d.ts.map +1 -1
- package/dist/commands/cp.js +5 -0
- package/dist/commands/curl.d.ts +5 -0
- package/dist/commands/curl.d.ts.map +1 -1
- package/dist/commands/curl.js +106 -26
- package/dist/commands/cut.d.ts +5 -0
- package/dist/commands/cut.d.ts.map +1 -1
- package/dist/commands/cut.js +8 -1
- package/dist/commands/date.d.ts +5 -0
- package/dist/commands/date.d.ts.map +1 -1
- package/dist/commands/date.js +7 -1
- package/dist/commands/declare.d.ts +3 -0
- package/dist/commands/declare.d.ts.map +1 -0
- package/dist/commands/declare.js +39 -0
- package/dist/commands/diff.d.ts +5 -0
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +5 -0
- package/dist/commands/dpkg.d.ts +9 -0
- package/dist/commands/dpkg.d.ts.map +1 -0
- package/dist/commands/dpkg.js +161 -0
- package/dist/commands/du.d.ts.map +1 -1
- package/dist/commands/du.js +8 -2
- package/dist/commands/echo.d.ts +5 -0
- package/dist/commands/echo.d.ts.map +1 -1
- package/dist/commands/echo.js +33 -12
- package/dist/commands/env.d.ts +5 -0
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +11 -1
- package/dist/commands/exit.d.ts +5 -0
- package/dist/commands/exit.d.ts.map +1 -1
- package/dist/commands/exit.js +12 -2
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +3 -1
- package/dist/commands/find.d.ts +5 -0
- package/dist/commands/find.d.ts.map +1 -1
- package/dist/commands/find.js +5 -0
- package/dist/commands/free.d.ts +8 -0
- package/dist/commands/free.d.ts.map +1 -0
- package/dist/commands/free.js +43 -0
- package/dist/commands/grep.d.ts +5 -0
- package/dist/commands/grep.d.ts.map +1 -1
- package/dist/commands/grep.js +12 -2
- package/dist/commands/gzip.d.ts +5 -0
- package/dist/commands/gzip.d.ts.map +1 -1
- package/dist/commands/gzip.js +18 -2
- package/dist/commands/head.d.ts +5 -0
- package/dist/commands/head.d.ts.map +1 -1
- package/dist/commands/head.js +5 -0
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +98 -45
- package/dist/commands/helpers.d.ts +3 -0
- package/dist/commands/helpers.d.ts.map +1 -1
- package/dist/commands/helpers.js +3 -0
- package/dist/commands/history.d.ts +8 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +26 -0
- package/dist/commands/hostname.d.ts +5 -0
- package/dist/commands/hostname.d.ts.map +1 -1
- package/dist/commands/hostname.js +5 -0
- package/dist/commands/id.d.ts.map +1 -1
- package/dist/commands/id.js +4 -1
- package/dist/commands/index.d.ts +2 -10
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -231
- package/dist/commands/ls.d.ts.map +1 -1
- package/dist/commands/ls.js +6 -3
- package/dist/commands/lsb-release.d.ts +3 -0
- package/dist/commands/lsb-release.d.ts.map +1 -0
- package/dist/commands/lsb-release.js +56 -0
- package/dist/commands/man.d.ts +3 -0
- package/dist/commands/man.d.ts.map +1 -0
- package/dist/commands/man.js +155 -0
- package/dist/commands/nano.js +1 -1
- package/dist/commands/neofetch.d.ts.map +1 -1
- package/dist/commands/neofetch.js +6 -1
- package/dist/commands/node.d.ts +9 -0
- package/dist/commands/node.d.ts.map +1 -0
- package/dist/commands/node.js +316 -0
- package/dist/commands/npm.d.ts +19 -0
- package/dist/commands/npm.d.ts.map +1 -0
- package/dist/commands/npm.js +109 -0
- package/dist/commands/ping.d.ts.map +1 -1
- package/dist/commands/ping.js +7 -2
- package/dist/commands/printf.d.ts +3 -0
- package/dist/commands/printf.d.ts.map +1 -0
- package/dist/commands/printf.js +113 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +30 -6
- package/dist/commands/python.d.ts +30 -0
- package/dist/commands/python.d.ts.map +1 -0
- package/dist/commands/python.js +2058 -0
- package/dist/commands/read.d.ts +3 -0
- package/dist/commands/read.d.ts.map +1 -0
- package/dist/commands/read.js +34 -0
- package/dist/commands/registry.d.ts +8 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +229 -0
- package/dist/commands/runtime.d.ts +6 -0
- package/dist/commands/runtime.d.ts.map +1 -0
- package/dist/commands/runtime.js +280 -0
- package/dist/commands/sed.d.ts.map +1 -1
- package/dist/commands/sed.js +11 -3
- package/dist/commands/set.d.ts.map +1 -1
- package/dist/commands/set.js +9 -3
- package/dist/commands/sh.d.ts.map +1 -1
- package/dist/commands/sh.js +69 -30
- package/dist/commands/shift.d.ts +5 -0
- package/dist/commands/shift.d.ts.map +1 -0
- package/dist/commands/shift.js +52 -0
- package/dist/commands/sleep.d.ts.map +1 -1
- package/dist/commands/sort.d.ts.map +1 -1
- package/dist/commands/sort.js +4 -2
- package/dist/commands/source.d.ts +3 -0
- package/dist/commands/source.d.ts.map +1 -0
- package/dist/commands/source.js +34 -0
- package/dist/commands/sudo.js +1 -1
- package/dist/commands/tar.d.ts.map +1 -1
- package/dist/commands/tar.js +11 -3
- package/dist/commands/tee.d.ts.map +1 -1
- package/dist/commands/tee.js +8 -6
- package/dist/commands/test.d.ts +3 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +114 -0
- package/dist/commands/tr.d.ts.map +1 -1
- package/dist/commands/tr.js +3 -1
- package/dist/commands/true.d.ts +4 -0
- package/dist/commands/true.d.ts.map +1 -0
- package/dist/commands/true.js +14 -0
- package/dist/commands/type.d.ts +3 -0
- package/dist/commands/type.d.ts.map +1 -0
- package/dist/commands/type.js +34 -0
- package/dist/commands/uname.d.ts.map +1 -1
- package/dist/commands/uname.js +4 -1
- package/dist/commands/uniq.d.ts.map +1 -1
- package/dist/commands/uptime.d.ts +3 -0
- package/dist/commands/uptime.d.ts.map +1 -0
- package/dist/commands/uptime.js +43 -0
- package/dist/commands/wget.d.ts.map +1 -1
- package/dist/commands/wget.js +92 -96
- package/dist/commands/which.d.ts +3 -0
- package/dist/commands/which.d.ts.map +1 -0
- package/dist/commands/which.js +32 -0
- package/dist/commands/xargs.d.ts.map +1 -1
- package/dist/commands/xargs.js +1 -1
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -8
- package/dist/modules/linuxRootfs.d.ts +41 -0
- package/dist/modules/linuxRootfs.d.ts.map +1 -0
- package/dist/modules/linuxRootfs.js +440 -0
- package/dist/modules/neofetch.d.ts.map +1 -1
- package/dist/modules/neofetch.js +1 -0
- package/dist/standalone-wo-sftp.d.ts +2 -0
- package/dist/standalone-wo-sftp.d.ts.map +1 -0
- package/dist/standalone-wo-sftp.js +30 -0
- package/dist/utils/expand.d.ts +50 -0
- package/dist/utils/expand.d.ts.map +1 -0
- package/dist/utils/expand.js +183 -0
- package/dist/utils/vfsDiff.d.ts +90 -0
- package/dist/utils/vfsDiff.d.ts.map +1 -0
- package/dist/utils/vfsDiff.js +177 -0
- package/package.json +3 -1
- package/src/SSHMimic/exec.ts +10 -1
- package/src/SSHMimic/executor.ts +105 -21
- package/src/SSHMimic/index.ts +49 -15
- package/src/VirtualFileSystem/binaryPack.ts +35 -8
- package/src/VirtualFileSystem/index.ts +78 -28
- package/src/VirtualPackageManager/index.ts +979 -0
- package/src/VirtualShell/index.ts +133 -14
- package/src/VirtualShell/shell.ts +23 -3
- package/src/VirtualShell/shellParser.ts +134 -36
- package/src/VirtualUserManager/index.ts +62 -22
- package/src/commands/adduser.ts +6 -0
- package/src/commands/alias.ts +64 -0
- package/src/commands/apt.ts +228 -0
- package/src/commands/awk.ts +20 -6
- package/src/commands/base64.ts +13 -2
- package/src/commands/cat.ts +40 -8
- package/src/commands/cd.ts +5 -0
- package/src/commands/chmod.ts +53 -3
- package/src/commands/command-helpers.ts +78 -4
- package/src/commands/cp.ts +5 -0
- package/src/commands/curl.ts +118 -33
- package/src/commands/cut.ts +8 -1
- package/src/commands/date.ts +7 -1
- package/src/commands/declare.ts +44 -0
- package/src/commands/diff.ts +17 -3
- package/src/commands/dpkg.ts +180 -0
- package/src/commands/du.ts +17 -5
- package/src/commands/echo.ts +41 -12
- package/src/commands/env.ts +11 -1
- package/src/commands/exit.ts +12 -2
- package/src/commands/export.ts +3 -1
- package/src/commands/find.ts +5 -0
- package/src/commands/free.ts +47 -0
- package/src/commands/grep.ts +12 -2
- package/src/commands/gzip.ts +28 -4
- package/src/commands/head.ts +5 -0
- package/src/commands/help.ts +121 -47
- package/src/commands/helpers.ts +8 -0
- package/src/commands/history.ts +34 -0
- package/src/commands/hostname.ts +5 -0
- package/src/commands/id.ts +4 -1
- package/src/commands/index.ts +9 -255
- package/src/commands/ls.ts +6 -3
- package/src/commands/lsb-release.ts +58 -0
- package/src/commands/man.ts +166 -0
- package/src/commands/nano.ts +1 -1
- package/src/commands/neofetch.ts +6 -1
- package/src/commands/node.ts +341 -0
- package/src/commands/npm.ts +132 -0
- package/src/commands/ping.ts +10 -3
- package/src/commands/printf.ts +112 -0
- package/src/commands/ps.ts +40 -6
- package/src/commands/python.ts +2229 -0
- package/src/commands/read.ts +41 -0
- package/src/commands/registry.ts +244 -0
- package/src/commands/runtime.ts +353 -0
- package/src/commands/sed.ts +27 -9
- package/src/commands/set.ts +9 -3
- package/src/commands/sh.ts +170 -44
- package/src/commands/shift.ts +53 -0
- package/src/commands/sleep.ts +2 -1
- package/src/commands/sort.ts +10 -6
- package/src/commands/source.ts +47 -0
- package/src/commands/sudo.ts +1 -1
- package/src/commands/tar.ts +28 -7
- package/src/commands/tee.ts +7 -1
- package/src/commands/test.ts +135 -0
- package/src/commands/tr.ts +3 -1
- package/src/commands/true.ts +17 -0
- package/src/commands/type.ts +43 -0
- package/src/commands/uname.ts +5 -1
- package/src/commands/uniq.ts +8 -2
- package/src/commands/uptime.ts +49 -0
- package/src/commands/wget.ts +105 -119
- package/src/commands/which.ts +37 -0
- package/src/commands/xargs.ts +11 -2
- package/src/index.ts +27 -18
- package/src/modules/linuxRootfs.ts +642 -0
- package/src/modules/neofetch.ts +1 -0
- package/src/standalone-wo-sftp.ts +38 -0
- package/src/utils/expand.ts +238 -0
- package/src/utils/vfsDiff.ts +275 -0
- package/standalone-wo-sftp.js +507 -0
- package/standalone-wo-sftp.js.map +7 -0
- package/standalone.js +486 -109
- package/standalone.js.map +4 -4
- package/tests/bun-test-shim.ts +9 -1
- package/tests/command-helpers.test.ts +1 -5
- package/tests/new-features.test.ts +1036 -0
- package/tests/parser-executor.test.ts +27 -27
- package/tests/sftp.test.ts +122 -42
- package/tests/users.test.ts +23 -5
- package/CHANGELOG.md +0 -150
|
@@ -2,14 +2,88 @@ type ArgParseOptions = {
|
|
|
2
2
|
flags?: string[];
|
|
3
3
|
flagsWithValue?: string[];
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* Returns `true` when any of the given flags appear in `args`.
|
|
7
|
+
*
|
|
8
|
+
* Matches both standalone tokens (`-s`, `--silent`) and inline forms
|
|
9
|
+
* (`--output=file`). Useful for simple boolean flag checks inside command
|
|
10
|
+
* `run` handlers.
|
|
11
|
+
*
|
|
12
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
13
|
+
* @param flags Single flag string or array of equivalent flag strings.
|
|
14
|
+
* @returns `true` if at least one flag is present, otherwise `false`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* ifFlag(args, "-r") // single flag
|
|
19
|
+
* ifFlag(args, ["-r", "--recursive"]) // aliases
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
5
22
|
export declare function ifFlag(args: string[], flags: string | string[]): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the value associated with a flag, or `true` if the flag is present
|
|
25
|
+
* but has no associated value, or `undefined` if the flag is absent.
|
|
26
|
+
*
|
|
27
|
+
* Handles three forms:
|
|
28
|
+
* - `--output file` → returns `"file"` (next token)
|
|
29
|
+
* - `--output=file` → returns `"file"` (inline `=` form)
|
|
30
|
+
* - `--verbose` → returns `true` (flag with no value)
|
|
31
|
+
*
|
|
32
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
33
|
+
* @param flags Single flag string or array of equivalent flag strings.
|
|
34
|
+
* @returns The flag value string, `true` when valueless, or `undefined`.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const output = getFlag(args, ["-o", "--output"]);
|
|
39
|
+
* if (typeof output === "string") { /* use path *\/ }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
6
42
|
export declare function getFlag(args: string[], flags: string | string[]): string | true | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the positional argument at the given zero-based index, skipping
|
|
45
|
+
* known flags and their values.
|
|
46
|
+
*
|
|
47
|
+
* Flags declared in `options.flags` are treated as boolean and skipped.
|
|
48
|
+
* Flags declared in `options.flagsWithValue` consume the next token too.
|
|
49
|
+
* Tokens after `--` are always treated as positionals.
|
|
50
|
+
*
|
|
51
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
52
|
+
* @param index Zero-based positional index to retrieve.
|
|
53
|
+
* @param options Optional flag declarations to skip during positional collection.
|
|
54
|
+
* @returns The positional value, or `undefined` if the index is out of range.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* // args = ["-r", "src", "dest"]
|
|
59
|
+
* getArg(args, 0, { flags: ["-r"] }) // "src"
|
|
60
|
+
* getArg(args, 1, { flags: ["-r"] }) // "dest"
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
7
63
|
export declare function getArg(args: string[], index: number, options?: ArgParseOptions): string | undefined;
|
|
8
64
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
65
|
+
* Parses an argument array into structured flags, flag values, and positionals.
|
|
66
|
+
*
|
|
67
|
+
* - `options.flags` — boolean flags (e.g. `["-r", "--recursive"]`); collected
|
|
68
|
+
* into a `Set<string>` and not treated as positionals.
|
|
69
|
+
* - `options.flagsWithValue` — flags that consume the next token or an inline
|
|
70
|
+
* `=value`; collected into a `Map<string, string>`.
|
|
71
|
+
* - All remaining tokens are positionals.
|
|
72
|
+
* - Tokens after `--` are always positionals, regardless of `-` prefix.
|
|
73
|
+
*
|
|
74
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
75
|
+
* @param options Flag declaration lists.
|
|
76
|
+
* @returns `{ flags, flagsWithValues, positionals }`.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const { flags, flagsWithValues, positionals } = parseArgs(args, {
|
|
81
|
+
* flags: ["-r", "--recursive"],
|
|
82
|
+
* flagsWithValue: ["-o", "--output"],
|
|
83
|
+
* });
|
|
84
|
+
* const recursive = flags.has("-r");
|
|
85
|
+
* const output = flagsWithValues.get("-o");
|
|
86
|
+
* ```
|
|
13
87
|
*/
|
|
14
88
|
export declare function parseArgs(args: string[], options?: {
|
|
15
89
|
flags?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/command-helpers.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AA+EF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAYxE;AAED,wBAAgB,OAAO,CACtB,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GACtB,MAAM,GAAG,IAAI,GAAG,SAAS,CA0B3B;AAED,wBAAgB,MAAM,CACrB,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,eAAoB,GAC3B,MAAM,GAAG,SAAS,CAGpB;AAED
|
|
1
|
+
{"version":3,"file":"command-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/command-helpers.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AA+EF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAYxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CACtB,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GACtB,MAAM,GAAG,IAAI,GAAG,SAAS,CA0B3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACrB,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,eAAoB,GAC3B,MAAM,GAAG,SAAS,CAGpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GAC3D;IACF,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,WAAW,EAAE,MAAM,EAAE,CAAC;CACtB,CAiDA"}
|
|
@@ -54,6 +54,23 @@ function collectPositionals(args, options = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
return positionals;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Returns `true` when any of the given flags appear in `args`.
|
|
59
|
+
*
|
|
60
|
+
* Matches both standalone tokens (`-s`, `--silent`) and inline forms
|
|
61
|
+
* (`--output=file`). Useful for simple boolean flag checks inside command
|
|
62
|
+
* `run` handlers.
|
|
63
|
+
*
|
|
64
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
65
|
+
* @param flags Single flag string or array of equivalent flag strings.
|
|
66
|
+
* @returns `true` if at least one flag is present, otherwise `false`.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* ifFlag(args, "-r") // single flag
|
|
71
|
+
* ifFlag(args, ["-r", "--recursive"]) // aliases
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
57
74
|
export function ifFlag(args, flags) {
|
|
58
75
|
const allFlags = toFlagList(flags);
|
|
59
76
|
for (const arg of args) {
|
|
@@ -65,6 +82,25 @@ export function ifFlag(args, flags) {
|
|
|
65
82
|
}
|
|
66
83
|
return false;
|
|
67
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Returns the value associated with a flag, or `true` if the flag is present
|
|
87
|
+
* but has no associated value, or `undefined` if the flag is absent.
|
|
88
|
+
*
|
|
89
|
+
* Handles three forms:
|
|
90
|
+
* - `--output file` → returns `"file"` (next token)
|
|
91
|
+
* - `--output=file` → returns `"file"` (inline `=` form)
|
|
92
|
+
* - `--verbose` → returns `true` (flag with no value)
|
|
93
|
+
*
|
|
94
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
95
|
+
* @param flags Single flag string or array of equivalent flag strings.
|
|
96
|
+
* @returns The flag value string, `true` when valueless, or `undefined`.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const output = getFlag(args, ["-o", "--output"]);
|
|
101
|
+
* if (typeof output === "string") { /* use path *\/ }
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
68
104
|
export function getFlag(args, flags) {
|
|
69
105
|
const allFlags = toFlagList(flags);
|
|
70
106
|
for (let index = 0; index < args.length; index += 1) {
|
|
@@ -86,15 +122,53 @@ export function getFlag(args, flags) {
|
|
|
86
122
|
}
|
|
87
123
|
return undefined;
|
|
88
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Returns the positional argument at the given zero-based index, skipping
|
|
127
|
+
* known flags and their values.
|
|
128
|
+
*
|
|
129
|
+
* Flags declared in `options.flags` are treated as boolean and skipped.
|
|
130
|
+
* Flags declared in `options.flagsWithValue` consume the next token too.
|
|
131
|
+
* Tokens after `--` are always treated as positionals.
|
|
132
|
+
*
|
|
133
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
134
|
+
* @param index Zero-based positional index to retrieve.
|
|
135
|
+
* @param options Optional flag declarations to skip during positional collection.
|
|
136
|
+
* @returns The positional value, or `undefined` if the index is out of range.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* // args = ["-r", "src", "dest"]
|
|
141
|
+
* getArg(args, 0, { flags: ["-r"] }) // "src"
|
|
142
|
+
* getArg(args, 1, { flags: ["-r"] }) // "dest"
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
89
145
|
export function getArg(args, index, options = {}) {
|
|
90
146
|
const positionals = collectPositionals(args, options);
|
|
91
147
|
return positionals[index];
|
|
92
148
|
}
|
|
93
149
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
150
|
+
* Parses an argument array into structured flags, flag values, and positionals.
|
|
151
|
+
*
|
|
152
|
+
* - `options.flags` — boolean flags (e.g. `["-r", "--recursive"]`); collected
|
|
153
|
+
* into a `Set<string>` and not treated as positionals.
|
|
154
|
+
* - `options.flagsWithValue` — flags that consume the next token or an inline
|
|
155
|
+
* `=value`; collected into a `Map<string, string>`.
|
|
156
|
+
* - All remaining tokens are positionals.
|
|
157
|
+
* - Tokens after `--` are always positionals, regardless of `-` prefix.
|
|
158
|
+
*
|
|
159
|
+
* @param args Tokenized argument array from `CommandContext.args`.
|
|
160
|
+
* @param options Flag declaration lists.
|
|
161
|
+
* @returns `{ flags, flagsWithValues, positionals }`.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* const { flags, flagsWithValues, positionals } = parseArgs(args, {
|
|
166
|
+
* flags: ["-r", "--recursive"],
|
|
167
|
+
* flagsWithValue: ["-o", "--output"],
|
|
168
|
+
* });
|
|
169
|
+
* const recursive = flags.has("-r");
|
|
170
|
+
* const output = flagsWithValues.get("-o");
|
|
171
|
+
* ```
|
|
98
172
|
*/
|
|
99
173
|
export function parseArgs(args, options = {}) {
|
|
100
174
|
const flags = new Set();
|
package/dist/commands/cp.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cp.d.ts","sourceRoot":"","sources":["../../src/commands/cp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,SAAS,EAAE,WAyEvB,CAAC"}
|
|
1
|
+
{"version":3,"file":"cp.d.ts","sourceRoot":"","sources":["../../src/commands/cp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,WAyEvB,CAAC"}
|
package/dist/commands/cp.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ifFlag } from "./command-helpers";
|
|
2
2
|
import { assertPathAccess, resolvePath } from "./helpers";
|
|
3
|
+
/**
|
|
4
|
+
* Copy files or directories inside the virtual filesystem.
|
|
5
|
+
* @category files
|
|
6
|
+
* @params ["[-r] <source> <dest>"]
|
|
7
|
+
*/
|
|
3
8
|
export const cpCommand = {
|
|
4
9
|
name: "cp",
|
|
5
10
|
description: "Copy files or directories",
|
package/dist/commands/curl.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { ShellModule } from "../types/commands";
|
|
2
|
+
/**
|
|
3
|
+
* HTTP client wrapper using `fetch()` semantics (virtual curl).
|
|
4
|
+
* @category network
|
|
5
|
+
* @params ["[options] <url>"]
|
|
6
|
+
*/
|
|
2
7
|
export declare const curlCommand: ShellModule;
|
|
3
8
|
//# sourceMappingURL=curl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../src/commands/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../src/commands/curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAwIzB,CAAC"}
|
package/dist/commands/curl.js
CHANGED
|
@@ -1,46 +1,126 @@
|
|
|
1
|
-
import { parseArgs } from "./command-helpers";
|
|
2
|
-
import { assertPathAccess,
|
|
1
|
+
import { ifFlag, parseArgs } from "./command-helpers";
|
|
2
|
+
import { assertPathAccess, resolvePath } from "./helpers";
|
|
3
|
+
/**
|
|
4
|
+
* HTTP client wrapper using `fetch()` semantics (virtual curl).
|
|
5
|
+
* @category network
|
|
6
|
+
* @params ["[options] <url>"]
|
|
7
|
+
*/
|
|
3
8
|
export const curlCommand = {
|
|
4
9
|
name: "curl",
|
|
5
|
-
description: "
|
|
10
|
+
description: "Transfer data from or to a server (pure fetch)",
|
|
6
11
|
category: "network",
|
|
7
|
-
params: ["[
|
|
12
|
+
params: ["[options] <url>"],
|
|
8
13
|
run: async ({ authUser, cwd, args, shell }) => {
|
|
9
14
|
const { flagsWithValues, positionals } = parseArgs(args, {
|
|
10
|
-
flagsWithValue: [
|
|
15
|
+
flagsWithValue: [
|
|
16
|
+
"-o",
|
|
17
|
+
"--output",
|
|
18
|
+
"-X",
|
|
19
|
+
"--request",
|
|
20
|
+
"-d",
|
|
21
|
+
"--data",
|
|
22
|
+
"-H",
|
|
23
|
+
"--header",
|
|
24
|
+
"-u",
|
|
25
|
+
"--user",
|
|
26
|
+
],
|
|
11
27
|
});
|
|
12
|
-
|
|
28
|
+
if (ifFlag(args, ["--help", "-h"])) {
|
|
29
|
+
return {
|
|
30
|
+
stdout: [
|
|
31
|
+
"Usage: curl [options] <url>",
|
|
32
|
+
" -o, --output <file> Write to file",
|
|
33
|
+
" -X, --request <method> HTTP method",
|
|
34
|
+
" -d, --data <data> POST data",
|
|
35
|
+
" -H, --header <hdr> Extra header",
|
|
36
|
+
" -s, --silent Silent mode",
|
|
37
|
+
" -I, --head Fetch headers only",
|
|
38
|
+
" -L, --location Follow redirects",
|
|
39
|
+
" -v, --verbose Verbose",
|
|
40
|
+
].join("\n"),
|
|
41
|
+
exitCode: 0,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
13
44
|
const url = positionals[0];
|
|
14
|
-
if (!url)
|
|
15
|
-
return { stderr: "curl:
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
45
|
+
if (!url)
|
|
46
|
+
return { stderr: "curl: no URL specified", exitCode: 1 };
|
|
47
|
+
const outputPath = flagsWithValues.get("-o") ?? flagsWithValues.get("--output") ?? null;
|
|
48
|
+
const method = (flagsWithValues.get("-X") ??
|
|
49
|
+
flagsWithValues.get("--request") ??
|
|
50
|
+
"GET").toUpperCase();
|
|
51
|
+
const postData = flagsWithValues.get("-d") ?? flagsWithValues.get("--data") ?? null;
|
|
52
|
+
const headerRaw = flagsWithValues.get("-H") ?? flagsWithValues.get("--header") ?? null;
|
|
53
|
+
const silent = ifFlag(args, ["-s", "--silent"]);
|
|
54
|
+
const headOnly = ifFlag(args, ["-I", "--head"]);
|
|
55
|
+
const followRedirects = ifFlag(args, ["-L", "--location"]);
|
|
56
|
+
const verbose = ifFlag(args, ["-v", "--verbose"]);
|
|
57
|
+
const extraHeaders = {
|
|
58
|
+
"User-Agent": "curl/7.88.1",
|
|
59
|
+
};
|
|
60
|
+
if (headerRaw) {
|
|
61
|
+
const idx = headerRaw.indexOf(":");
|
|
62
|
+
if (idx !== -1)
|
|
63
|
+
extraHeaders[headerRaw.slice(0, idx).trim()] = headerRaw
|
|
64
|
+
.slice(idx + 1)
|
|
65
|
+
.trim();
|
|
66
|
+
}
|
|
67
|
+
const finalMethod = postData && method === "GET" ? "POST" : method;
|
|
68
|
+
const fetchOpts = {
|
|
69
|
+
method: finalMethod,
|
|
70
|
+
headers: extraHeaders,
|
|
71
|
+
redirect: followRedirects ? "follow" : "manual",
|
|
72
|
+
};
|
|
73
|
+
if (postData) {
|
|
74
|
+
extraHeaders["Content-Type"] ??= "application/x-www-form-urlencoded";
|
|
75
|
+
fetchOpts.body = postData;
|
|
76
|
+
}
|
|
77
|
+
const stderrLines = [];
|
|
78
|
+
if (verbose) {
|
|
79
|
+
stderrLines.push(`* Trying ${url}...`, `* Connected`);
|
|
80
|
+
stderrLines.push(`> ${finalMethod} / HTTP/1.1`, `> Host: ${new URL(url).host}`);
|
|
81
|
+
}
|
|
82
|
+
let response;
|
|
83
|
+
try {
|
|
84
|
+
response = await fetch(url, fetchOpts);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
22
88
|
return {
|
|
23
|
-
stderr:
|
|
24
|
-
exitCode:
|
|
89
|
+
stderr: `curl: (6) Could not resolve host: ${msg}`,
|
|
90
|
+
exitCode: 6,
|
|
25
91
|
};
|
|
26
92
|
}
|
|
93
|
+
if (verbose) {
|
|
94
|
+
stderrLines.push(`< HTTP/1.1 ${response.status} ${response.statusText}`);
|
|
95
|
+
}
|
|
96
|
+
if (headOnly) {
|
|
97
|
+
const lines = [`HTTP/1.1 ${response.status} ${response.statusText}`];
|
|
98
|
+
for (const [k, v] of response.headers.entries())
|
|
99
|
+
lines.push(`${k}: ${v}`);
|
|
100
|
+
return { stdout: `${lines.join("\r\n")}\r\n`, exitCode: 0 };
|
|
101
|
+
}
|
|
102
|
+
let body;
|
|
103
|
+
try {
|
|
104
|
+
body = await response.text();
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return { stderr: "curl: failed to read response body", exitCode: 1 };
|
|
108
|
+
}
|
|
27
109
|
if (outputPath) {
|
|
28
110
|
const target = resolvePath(cwd, outputPath);
|
|
29
111
|
assertPathAccess(authUser, target, "curl");
|
|
30
|
-
shell.writeFileAsUser(authUser, target,
|
|
112
|
+
shell.writeFileAsUser(authUser, target, body);
|
|
113
|
+
if (!silent)
|
|
114
|
+
stderrLines.push(` % Total % Received\n100 ${body.length} 100 ${body.length}`);
|
|
31
115
|
return {
|
|
32
|
-
stderr:
|
|
33
|
-
|
|
34
|
-
: undefined,
|
|
35
|
-
exitCode: 0,
|
|
116
|
+
stderr: stderrLines.join("\n") || undefined,
|
|
117
|
+
exitCode: response.ok ? 0 : 22,
|
|
36
118
|
};
|
|
37
119
|
}
|
|
38
120
|
return {
|
|
39
|
-
stdout:
|
|
40
|
-
stderr:
|
|
41
|
-
|
|
42
|
-
: undefined,
|
|
43
|
-
exitCode: 0,
|
|
121
|
+
stdout: body,
|
|
122
|
+
stderr: stderrLines.length > 0 ? stderrLines.join("\n") : undefined,
|
|
123
|
+
exitCode: response.ok ? 0 : 22,
|
|
44
124
|
};
|
|
45
125
|
},
|
|
46
126
|
};
|
package/dist/commands/cut.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { ShellModule } from "../types/commands";
|
|
2
|
+
/**
|
|
3
|
+
* Extract selected fields from each line of input.
|
|
4
|
+
* @category text
|
|
5
|
+
* @params ["-d <delim> -f <fields> [file]"]
|
|
6
|
+
*/
|
|
2
7
|
export declare const cutCommand: ShellModule;
|
|
3
8
|
//# sourceMappingURL=cut.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cut.d.ts","sourceRoot":"","sources":["../../src/commands/cut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"cut.d.ts","sourceRoot":"","sources":["../../src/commands/cut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,WA2BxB,CAAC"}
|
package/dist/commands/cut.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { getFlag } from "./command-helpers";
|
|
2
|
+
/**
|
|
3
|
+
* Extract selected fields from each line of input.
|
|
4
|
+
* @category text
|
|
5
|
+
* @params ["-d <delim> -f <fields> [file]"]
|
|
6
|
+
*/
|
|
2
7
|
export const cutCommand = {
|
|
3
8
|
name: "cut",
|
|
4
9
|
description: "Remove sections from lines",
|
|
@@ -9,7 +14,9 @@ export const cutCommand = {
|
|
|
9
14
|
const fields = getFlag(args, ["-f"]) ?? "1";
|
|
10
15
|
const cols = fields.split(",").map((f) => {
|
|
11
16
|
const [a, b] = f.split("-").map(Number);
|
|
12
|
-
return b !== undefined
|
|
17
|
+
return b !== undefined
|
|
18
|
+
? { from: (a ?? 1) - 1, to: b - 1 }
|
|
19
|
+
: { from: (a ?? 1) - 1, to: (a ?? 1) - 1 };
|
|
13
20
|
});
|
|
14
21
|
const lines = (stdin ?? "").split("\n");
|
|
15
22
|
const out = lines.map((line) => {
|
package/dist/commands/date.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/commands/date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/commands/date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAsBzB,CAAC"}
|
package/dist/commands/date.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Print the current date/time or a formatted representation.
|
|
3
|
+
* @category system
|
|
4
|
+
* @params ["[+format]"]
|
|
5
|
+
*/
|
|
1
6
|
export const dateCommand = {
|
|
2
7
|
name: "date",
|
|
3
8
|
description: "Print current date and time",
|
|
@@ -7,7 +12,8 @@ export const dateCommand = {
|
|
|
7
12
|
const now = new Date();
|
|
8
13
|
const fmt = args[0];
|
|
9
14
|
if (fmt?.startsWith("+")) {
|
|
10
|
-
const f = fmt
|
|
15
|
+
const f = fmt
|
|
16
|
+
.slice(1)
|
|
11
17
|
.replace("%Y", String(now.getFullYear()))
|
|
12
18
|
.replace("%m", String(now.getMonth() + 1).padStart(2, "0"))
|
|
13
19
|
.replace("%d", String(now.getDate()).padStart(2, "0"))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declare.d.ts","sourceRoot":"","sources":["../../src/commands/declare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,cAAc,EAAE,WAwC5B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ifFlag } from "./command-helpers";
|
|
2
|
+
export const declareCommand = {
|
|
3
|
+
name: "declare",
|
|
4
|
+
aliases: ["local", "typeset"],
|
|
5
|
+
description: "Declare variables and give them attributes",
|
|
6
|
+
category: "shell",
|
|
7
|
+
params: ["[-i] [-r] [-x] [-a] [name[=value]...]"],
|
|
8
|
+
run: ({ args, env }) => {
|
|
9
|
+
if (!env)
|
|
10
|
+
return { exitCode: 0 };
|
|
11
|
+
const integer = ifFlag(args, ["-i"]);
|
|
12
|
+
const _readonly = ifFlag(args, ["-r"]);
|
|
13
|
+
const _export_ = ifFlag(args, ["-x"]);
|
|
14
|
+
const printAll = args.filter((a) => !a.startsWith("-")).length === 0;
|
|
15
|
+
if (printAll) {
|
|
16
|
+
const lines = Object.entries(env.vars).map(([k, v]) => `declare -- ${k}="${v}"`);
|
|
17
|
+
return { stdout: lines.join("\n"), exitCode: 0 };
|
|
18
|
+
}
|
|
19
|
+
const assignments = args.filter((a) => !a.startsWith("-"));
|
|
20
|
+
for (const token of assignments) {
|
|
21
|
+
const eq = token.indexOf("=");
|
|
22
|
+
if (eq === -1) {
|
|
23
|
+
// Just declare (no value)
|
|
24
|
+
if (!(token in env.vars))
|
|
25
|
+
env.vars[token] = "";
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const name = token.slice(0, eq);
|
|
29
|
+
let val = token.slice(eq + 1);
|
|
30
|
+
if (integer) {
|
|
31
|
+
const n = parseInt(val, 10);
|
|
32
|
+
val = Number.isNaN(n) ? "0" : String(n);
|
|
33
|
+
}
|
|
34
|
+
env.vars[name] = val;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return { exitCode: 0 };
|
|
38
|
+
},
|
|
39
|
+
};
|
package/dist/commands/diff.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAkCzB,CAAC"}
|
package/dist/commands/diff.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ShellModule } from "../types/commands";
|
|
2
|
+
/**
|
|
3
|
+
* dpkg compatibility command (query/remove/list) backed by the virtual package manager.
|
|
4
|
+
* @category package
|
|
5
|
+
* @params ["[-l] [-s pkg] [-L pkg] [-i pkg] [--remove pkg]"]
|
|
6
|
+
*/
|
|
7
|
+
export declare const dpkgCommand: ShellModule;
|
|
8
|
+
export declare const dpkgQueryCommand: ShellModule;
|
|
9
|
+
//# sourceMappingURL=dpkg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpkg.d.ts","sourceRoot":"","sources":["../../src/commands/dpkg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WA0HzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,WA8C9B,CAAC"}
|