@prozilla-os/core 1.3.13 → 2.0.1
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/chunks/cat-DH-kPf08.js +44 -0
- package/dist/chunks/cat-DH-kPf08.js.map +1 -0
- package/dist/chunks/cd-DGILEGTs.js +21 -0
- package/dist/chunks/cd-DGILEGTs.js.map +1 -0
- package/dist/chunks/clear-DC-frUcf.js +13 -0
- package/dist/chunks/clear-DC-frUcf.js.map +1 -0
- package/dist/chunks/cmatrix-DvaWzvRn.js +63 -0
- package/dist/chunks/cmatrix-DvaWzvRn.js.map +1 -0
- package/dist/chunks/compgen-OhvISbst.js +11 -0
- package/dist/chunks/compgen-OhvISbst.js.map +1 -0
- package/dist/chunks/cowsay-hTKzWScw.js +56 -0
- package/dist/chunks/cowsay-hTKzWScw.js.map +1 -0
- package/dist/chunks/date-D8cnHZuY.js +33 -0
- package/dist/chunks/date-D8cnHZuY.js.map +1 -0
- package/dist/chunks/dir-BmNeEPzy.js +11 -0
- package/dist/chunks/dir-BmNeEPzy.js.map +1 -0
- package/dist/chunks/echo-Gmh-b8f5.js +17 -0
- package/dist/chunks/echo-Gmh-b8f5.js.map +1 -0
- package/dist/chunks/eval-DINS_Vhl.js +24 -0
- package/dist/chunks/eval-DINS_Vhl.js.map +1 -0
- package/dist/chunks/exit-w3PqRkwA.js +10 -0
- package/dist/chunks/exit-w3PqRkwA.js.map +1 -0
- package/dist/chunks/fortune-DkIZpYa_.js +59 -0
- package/dist/chunks/fortune-DkIZpYa_.js.map +1 -0
- package/dist/chunks/grep-CR3FMStR.js +41 -0
- package/dist/chunks/grep-CR3FMStR.js.map +1 -0
- package/dist/chunks/help-Drx0UDCY.js +19 -0
- package/dist/chunks/help-Drx0UDCY.js.map +1 -0
- package/dist/chunks/history-BEJhnsrb.js +17 -0
- package/dist/chunks/history-BEJhnsrb.js.map +1 -0
- package/dist/chunks/hostname-D8sxyWIy.js +10 -0
- package/dist/chunks/hostname-D8sxyWIy.js.map +1 -0
- package/dist/chunks/htop-l0sNRNKZ.js +2 -0
- package/dist/chunks/htop-l0sNRNKZ.js.map +1 -0
- package/dist/chunks/lolcat-Dyjbg15t.js +67 -0
- package/dist/chunks/lolcat-Dyjbg15t.js.map +1 -0
- package/dist/chunks/ls-DnmR50y0.js +17 -0
- package/dist/chunks/ls-DnmR50y0.js.map +1 -0
- package/dist/chunks/man-7W6T7lda.js +60 -0
- package/dist/chunks/man-7W6T7lda.js.map +1 -0
- package/dist/chunks/mkdir-BdEywO2H.js +11 -0
- package/dist/chunks/mkdir-BdEywO2H.js.map +1 -0
- package/dist/chunks/neofetch--vHMIS9v.js +40 -0
- package/dist/chunks/neofetch--vHMIS9v.js.map +1 -0
- package/dist/chunks/printenv-6OpJKd7g.js +24 -0
- package/dist/chunks/printenv-6OpJKd7g.js.map +1 -0
- package/dist/chunks/pwd-9JYDUbov.js +11 -0
- package/dist/chunks/pwd-9JYDUbov.js.map +1 -0
- package/dist/chunks/reboot-nbAmZck6.js +10 -0
- package/dist/chunks/reboot-nbAmZck6.js.map +1 -0
- package/dist/chunks/reload-CjTJVt5Z.js +10 -0
- package/dist/chunks/reload-CjTJVt5Z.js.map +1 -0
- package/dist/chunks/rev--2pyt1P8.js +12 -0
- package/dist/chunks/rev--2pyt1P8.js.map +1 -0
- package/dist/chunks/rm-Uxuv-dEz.js +13 -0
- package/dist/chunks/rm-Uxuv-dEz.js.map +1 -0
- package/dist/chunks/rmdir-BYWer3pb.js +13 -0
- package/dist/chunks/rmdir-BYWer3pb.js.map +1 -0
- package/dist/chunks/sh-B67OTc-j.js +15 -0
- package/dist/chunks/sh-B67OTc-j.js.map +1 -0
- package/dist/chunks/sl-CLAmugya.js +168 -0
- package/dist/chunks/sl-CLAmugya.js.map +1 -0
- package/dist/chunks/touch-BReUyL_z.js +15 -0
- package/dist/chunks/touch-BReUyL_z.js.map +1 -0
- package/dist/chunks/uniq-Dx_4r3B5.js +44 -0
- package/dist/chunks/uniq-Dx_4r3B5.js.map +1 -0
- package/dist/chunks/uptime-DjJ5V7hu.js +10 -0
- package/dist/chunks/uptime-DjJ5V7hu.js.map +1 -0
- package/dist/chunks/watch-BjJ8bCnP.js +52 -0
- package/dist/chunks/watch-BjJ8bCnP.js.map +1 -0
- package/dist/chunks/whatis-CFZWdHZ4.js +17 -0
- package/dist/chunks/whatis-CFZWdHZ4.js.map +1 -0
- package/dist/chunks/whoami-D-es0JvS.js +10 -0
- package/dist/chunks/whoami-D-es0JvS.js.map +1 -0
- package/dist/main.d.ts +1029 -473
- package/dist/main.js +18432 -16877
- package/dist/main.js.map +1 -1
- package/package.json +15 -11
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Command as P, Shell as a, EXIT_CODE as g } from "../main.js";
|
|
2
|
+
const E = new P().setManual({
|
|
3
|
+
purpose: "Report or omit repeated lines",
|
|
4
|
+
usage: "uniq [OPTION]... [INPUT [OUTPUT]]",
|
|
5
|
+
description: "Filter adjacent matching lines from INPUT, writing to OUTPUT.",
|
|
6
|
+
options: {
|
|
7
|
+
"-c": "Prefix lines by the number of occurrences",
|
|
8
|
+
"-d": "Only print duplicate lines, one for each group",
|
|
9
|
+
"-u": "Only print unique lines",
|
|
10
|
+
"-i": "Ignore differences in case when comparing"
|
|
11
|
+
}
|
|
12
|
+
}).addOption({ short: "c", long: "count" }).addOption({ short: "d", long: "repeated" }).addOption({ short: "u", long: "unique" }).addOption({ short: "i", long: "ignore-case" }).setExecute(async function(h, { stdout: O, stderr: l, stdin: m, workingDirectory: w, options: o }) {
|
|
13
|
+
const d = (n) => {
|
|
14
|
+
if (!n.length) return;
|
|
15
|
+
const t = n.split(`
|
|
16
|
+
`), p = o.includes("i"), I = o.includes("c"), T = o.includes("d"), U = o.includes("u");
|
|
17
|
+
let r = t[0], s = 0;
|
|
18
|
+
const f = (i, c) => {
|
|
19
|
+
const u = c > 1;
|
|
20
|
+
if (T && !u || U && u) return;
|
|
21
|
+
const y = I ? `${c.toString().padStart(7, " ")} ` : "";
|
|
22
|
+
O.write(y + i);
|
|
23
|
+
};
|
|
24
|
+
for (const i of t) {
|
|
25
|
+
const c = p ? i.toLowerCase() : i, u = p ? r.toLowerCase() : r;
|
|
26
|
+
c === u ? s++ : (f(r, s), r = i, s = 1);
|
|
27
|
+
}
|
|
28
|
+
f(r, s);
|
|
29
|
+
}, e = h[0];
|
|
30
|
+
if (e && e !== "-") {
|
|
31
|
+
const n = w.navigate(e);
|
|
32
|
+
if (!n)
|
|
33
|
+
return a.writeError(l, this.name, `${e}: ${a.INVALID_PATH_ERROR}`);
|
|
34
|
+
if (n.isFolder())
|
|
35
|
+
return a.writeError(l, this.name, `${e}: Is a directory`);
|
|
36
|
+
const t = await n.read();
|
|
37
|
+
return t != null && d(t), g.success;
|
|
38
|
+
}
|
|
39
|
+
return a.readInput("", m, (n) => (d(n), g.success));
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
E as uniq
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=uniq-Dx_4r3B5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniq-Dx_4r3B5.js","sources":["../../src/features/shell/commands/uniq.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../../constants\";\nimport { Command } from \"../command\";\nimport { Shell } from \"../shell\";\n\nexport const uniq = new Command()\n\t.setManual({\n\t\tpurpose: \"Report or omit repeated lines\",\n\t\tusage: \"uniq [OPTION]... [INPUT [OUTPUT]]\",\n\t\tdescription: \"Filter adjacent matching lines from INPUT, writing to OUTPUT.\",\n\t\toptions: {\n\t\t\t\"-c\": \"Prefix lines by the number of occurrences\",\n\t\t\t\"-d\": \"Only print duplicate lines, one for each group\",\n\t\t\t\"-u\": \"Only print unique lines\",\n\t\t\t\"-i\": \"Ignore differences in case when comparing\",\n\t\t},\n\t})\n\t.addOption({ short: \"c\", long: \"count\" })\n\t.addOption({ short: \"d\", long: \"repeated\" })\n\t.addOption({ short: \"u\", long: \"unique\" })\n\t.addOption({ short: \"i\", long: \"ignore-case\" })\n\t.setExecute(async function(this: Command, args, { stdout, stderr, stdin, workingDirectory, options }) {\n\t\tconst processUniq = (text: string) => {\n\t\t\tif (!text.length) return;\n\n\t\t\tconst lines = text.split(\"\\n\");\n\t\t\tconst ignoreCase = options.includes(\"i\");\n\t\t\tconst showCount = options.includes(\"c\");\n\t\t\tconst onlyDuplicates = options.includes(\"d\");\n\t\t\tconst onlyUnique = options.includes(\"u\");\n\n\t\t\tlet currentLine = lines[0];\n\t\t\tlet count = 0;\n\n\t\t\tconst outputLine = (line: string, lineCount: number) => {\n\t\t\t\tconst isDuplicate = lineCount > 1;\n\t\t\t\tif (onlyDuplicates && !isDuplicate) return;\n\t\t\t\tif (onlyUnique && isDuplicate) return;\n\n\t\t\t\tconst prefix = showCount ? `${lineCount.toString().padStart(7, \" \")} ` : \"\";\n\t\t\t\tstdout.write(prefix + line);\n\t\t\t};\n\n\t\t\tfor (const line of lines) {\n\t\t\t\tconst a = ignoreCase ? line.toLowerCase() : line;\n\t\t\t\tconst b = ignoreCase ? currentLine.toLowerCase() : currentLine;\n\n\t\t\t\tif (a === b) {\n\t\t\t\t\tcount++;\n\t\t\t\t} else {\n\t\t\t\t\toutputLine(currentLine, count);\n\t\t\t\t\tcurrentLine = line;\n\t\t\t\t\tcount = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toutputLine(currentLine, count);\n\t\t};\n\n\t\tconst path = args[0];\n\n\t\tif (path && path !== \"-\") {\n\t\t\tconst target = workingDirectory.navigate(path);\n\n\t\t\tif (!target)\n\t\t\t\treturn Shell.writeError(stderr, this.name, `${path}: ${Shell.INVALID_PATH_ERROR}`);\n\t\t\tif (target.isFolder())\n\t\t\t\treturn Shell.writeError(stderr, this.name, `${path}: Is a directory`);\n\n\t\t\tconst content = await target.read();\n\t\t\tif (content != null) processUniq(content);\n\t\t\treturn EXIT_CODE.success;\n\t\t}\n\n\t\treturn Shell.readInput(\"\", stdin, (data) => {\n\t\t\tprocessUniq(data);\n\t\t\treturn EXIT_CODE.success;\n\t\t});\n\t});"],"names":["uniq","Command","args","stdout","stderr","stdin","workingDirectory","options","processUniq","text","lines","ignoreCase","showCount","onlyDuplicates","onlyUnique","currentLine","count","outputLine","line","lineCount","isDuplicate","prefix","a","b","path","target","Shell","content","EXIT_CODE","data"],"mappings":";AAIO,MAAMA,IAAO,IAAIC,EAAA,EACtB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU,EAAE,OAAO,KAAK,MAAM,SAAS,EACvC,UAAU,EAAE,OAAO,KAAK,MAAM,WAAA,CAAY,EAC1C,UAAU,EAAE,OAAO,KAAK,MAAM,SAAA,CAAU,EACxC,UAAU,EAAE,OAAO,KAAK,MAAM,cAAA,CAAe,EAC7C,WAAW,eAA8BC,GAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,OAAAC,GAAO,kBAAAC,GAAkB,SAAAC,KAAW;AACrG,QAAMC,IAAc,CAACC,MAAiB;AACrC,QAAI,CAACA,EAAK,OAAQ;AAElB,UAAMC,IAAQD,EAAK,MAAM;AAAA,CAAI,GACvBE,IAAaJ,EAAQ,SAAS,GAAG,GACjCK,IAAYL,EAAQ,SAAS,GAAG,GAChCM,IAAiBN,EAAQ,SAAS,GAAG,GACrCO,IAAaP,EAAQ,SAAS,GAAG;AAEvC,QAAIQ,IAAcL,EAAM,CAAC,GACrBM,IAAQ;AAEZ,UAAMC,IAAa,CAACC,GAAcC,MAAsB;AACvD,YAAMC,IAAcD,IAAY;AAEhC,UADIN,KAAkB,CAACO,KACnBN,KAAcM,EAAa;AAE/B,YAAMC,IAAST,IAAY,GAAGO,EAAU,SAAA,EAAW,SAAS,GAAG,GAAG,CAAC,MAAM;AACzE,MAAAhB,EAAO,MAAMkB,IAASH,CAAI;AAAA,IAC3B;AAEA,eAAWA,KAAQR,GAAO;AACzB,YAAMY,IAAIX,IAAaO,EAAK,YAAA,IAAgBA,GACtCK,IAAIZ,IAAaI,EAAY,YAAA,IAAgBA;AAEnD,MAAIO,MAAMC,IACTP,OAEAC,EAAWF,GAAaC,CAAK,GAC7BD,IAAcG,GACdF,IAAQ;AAAA,IAEV;AAEA,IAAAC,EAAWF,GAAaC,CAAK;AAAA,EAC9B,GAEMQ,IAAOtB,EAAK,CAAC;AAEnB,MAAIsB,KAAQA,MAAS,KAAK;AACzB,UAAMC,IAASnB,EAAiB,SAASkB,CAAI;AAE7C,QAAI,CAACC;AACJ,aAAOC,EAAM,WAAWtB,GAAQ,KAAK,MAAM,GAAGoB,CAAI,KAAKE,EAAM,kBAAkB,EAAE;AAClF,QAAID,EAAO,SAAA;AACV,aAAOC,EAAM,WAAWtB,GAAQ,KAAK,MAAM,GAAGoB,CAAI,kBAAkB;AAErE,UAAMG,IAAU,MAAMF,EAAO,KAAA;AAC7B,WAAIE,KAAW,QAAMnB,EAAYmB,CAAO,GACjCC,EAAU;AAAA,EAClB;AAEA,SAAOF,EAAM,UAAU,IAAIrB,GAAO,CAACwB,OAClCrB,EAAYqB,CAAI,GACTD,EAAU,QACjB;AACF,CAAC;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command as m } from "../main.js";
|
|
2
|
+
const o = new m().setManual({
|
|
3
|
+
purpose: "Display the current uptime of the system"
|
|
4
|
+
}).setExecute(function(p, { systemManager: e, stdout: t }) {
|
|
5
|
+
t.write(`Uptime: ${e.getUptime(2)}`);
|
|
6
|
+
});
|
|
7
|
+
export {
|
|
8
|
+
o as uptime
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=uptime-DjJ5V7hu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uptime-DjJ5V7hu.js","sources":["../../src/features/shell/commands/uptime.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const uptime = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the current uptime of the system\",\n\t})\n\t.setExecute(function(_args, { systemManager, stdout }) {\n\t\tstdout.write(`Uptime: ${systemManager.getUptime(2)}`);\n\t});"],"names":["uptime","Command","_args","systemManager","stdout"],"mappings":";AAEO,MAAMA,IAAS,IAAIC,EAAA,EACxB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAO,EAAE,eAAAC,GAAe,QAAAC,KAAU;AACtD,EAAAA,EAAO,MAAM,WAAWD,EAAc,UAAU,CAAC,CAAC,EAAE;AACrD,CAAC;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Command as S, Stream as i, EXIT_CODE as x, Shell as p } from "../main.js";
|
|
2
|
+
import { parseOptionalFloat as I, ANSI as t, Ansi as O } from "@prozilla-os/shared";
|
|
3
|
+
const M = new S().setRequireArgs(!0).setManual({
|
|
4
|
+
purpose: "Execute a program periodically, showing output fullscreen",
|
|
5
|
+
usage: "watch [-n <seconds>] [-t] <command>",
|
|
6
|
+
options: {
|
|
7
|
+
"-n seconds": "Set the interval (defaults to 2)",
|
|
8
|
+
"-t": "Turn off the header showing the interval and command name"
|
|
9
|
+
}
|
|
10
|
+
}).addOption({
|
|
11
|
+
long: "interval",
|
|
12
|
+
short: "n",
|
|
13
|
+
isInput: !0
|
|
14
|
+
}).addOption({
|
|
15
|
+
long: "no-title",
|
|
16
|
+
short: "t",
|
|
17
|
+
isInput: !1
|
|
18
|
+
}).setExecute(function(m, { inputs: f, options: h, shell: w, stdout: r, stdin: c, stderr: E }) {
|
|
19
|
+
const l = I(f.n, 2), v = Math.max(0.1, l) * 1e3, g = h.includes("t"), n = m.join(" ");
|
|
20
|
+
let o = !1, a = !1;
|
|
21
|
+
r.write(t.screen.enterAltBuffer);
|
|
22
|
+
const u = async () => {
|
|
23
|
+
if (o || a) return;
|
|
24
|
+
o = !0;
|
|
25
|
+
const s = new i().start();
|
|
26
|
+
let d = "";
|
|
27
|
+
s.on(i.DATA_EVENT, (e) => {
|
|
28
|
+
d += e;
|
|
29
|
+
});
|
|
30
|
+
try {
|
|
31
|
+
if (await w.interpreter.execute(n, { stdout: s }), !a) {
|
|
32
|
+
const e = g ? "" : O.white(`Every ${l.toFixed(1)}s: ${n}
|
|
33
|
+
|
|
34
|
+
`);
|
|
35
|
+
r.write(t.screen.clear + t.screen.home + e + d);
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {
|
|
38
|
+
console.error(e), p.writeError(E, this.name, [p.COMMAND_FAILED_ERROR, n]);
|
|
39
|
+
} finally {
|
|
40
|
+
o = !1, s.stop();
|
|
41
|
+
}
|
|
42
|
+
}, A = setInterval(() => {
|
|
43
|
+
u();
|
|
44
|
+
}, v);
|
|
45
|
+
return c.on(i.STOP_EVENT, () => {
|
|
46
|
+
a = !0, clearInterval(A), r.write(t.screen.exitAltBuffer);
|
|
47
|
+
}), u(), c.wait(x.success);
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
M as watch
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=watch-BjJ8bCnP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-BjJ8bCnP.js","sources":["../../src/features/shell/commands/watch.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../../constants\";\nimport { Command } from \"../command\";\nimport { Stream } from \"../stream\";\nimport { ANSI, Ansi, parseOptionalFloat } from \"@prozilla-os/shared\";\nimport { Shell } from \"../shell\";\n\nexport const watch = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Execute a program periodically, showing output fullscreen\",\n\t\tusage: \"watch [-n <seconds>] [-t] <command>\",\n\t\toptions: {\n\t\t\t\"-n seconds\": \"Set the interval (defaults to 2)\",\n\t\t\t\"-t\": \"Turn off the header showing the interval and command name\",\n\t\t},\n\t})\n\t.addOption({\n\t\tlong: \"interval\",\n\t\tshort: \"n\",\n\t\tisInput: true,\n\t})\n\t.addOption({\n\t\tlong: \"no-title\",\n\t\tshort: \"t\",\n\t\tisInput: false,\n\t})\n\t.setExecute(function(this: Command, args, { inputs, options, shell, stdout, stdin, stderr }) {\n\t\tconst intervalSeconds = parseOptionalFloat(inputs.n, 2);\n\t\tconst intervalMs = Math.max(0.1, intervalSeconds) * 1000;\n\t\tconst hideHeader = options.includes(\"t\");\n\t\t\n\t\tconst commandString = args.join(\" \");\n\t\tlet isExecuting = false;\n\t\tlet isStopping = false;\n\n\t\tstdout.write(ANSI.screen.enterAltBuffer);\n\n\t\tconst tick = async () => {\n\t\t\tif (isExecuting || isStopping) return;\n\t\t\tisExecuting = true;\n\n\t\t\tconst captureStream = new Stream().start();\n\t\t\tlet capturedOutput = \"\";\n\n\t\t\tcaptureStream.on(Stream.DATA_EVENT, (data) => {\n\t\t\t\tcapturedOutput += data;\n\t\t\t});\n\n\t\t\ttry {\n\t\t\t\tawait shell.interpreter.execute(commandString, { stdout: captureStream });\n\t\t\t\t\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\t\t\tif (!isStopping) {\n\t\t\t\t\tconst header = hideHeader \n\t\t\t\t\t\t? \"\" \n\t\t\t\t\t\t: Ansi.white(`Every ${intervalSeconds.toFixed(1)}s: ${commandString}\\n\\n`);\n\t\t\t\t\t\n\t\t\t\t\tstdout.write(ANSI.screen.clear + ANSI.screen.home + header + capturedOutput);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t\tShell.writeError(stderr, this.name, [Shell.COMMAND_FAILED_ERROR, commandString]);\n\t\t\t} finally {\n\t\t\t\tisExecuting = false;\n\t\t\t\tcaptureStream.stop();\n\t\t\t}\n\t\t};\n\n\t\tconst intervalId = setInterval(() => void tick(), intervalMs);\n\n\t\tstdin.on(Stream.STOP_EVENT, () => {\n\t\t\tisStopping = true;\n\t\t\tclearInterval(intervalId);\n\t\t\tstdout.write(ANSI.screen.exitAltBuffer);\n\t\t});\n\n\t\tvoid tick();\n\n\t\treturn stdin.wait(EXIT_CODE.success);\n\t});"],"names":["watch","Command","args","inputs","options","shell","stdout","stdin","stderr","intervalSeconds","parseOptionalFloat","intervalMs","hideHeader","commandString","isExecuting","isStopping","ANSI","tick","captureStream","Stream","capturedOutput","data","header","Ansi","error","Shell","intervalId","EXIT_CODE"],"mappings":";;AAMO,MAAMA,IAAQ,IAAIC,EAAA,EACvB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,IACR,cAAc;AAAA,IACd,MAAM;AAAA,EAAA;AAER,CAAC,EACA,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACV,CAAC,EACA,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,QAAAC,GAAQ,OAAAC,GAAO,QAAAC,KAAU;AAC5F,QAAMC,IAAkBC,EAAmBP,EAAO,GAAG,CAAC,GAChDQ,IAAa,KAAK,IAAI,KAAKF,CAAe,IAAI,KAC9CG,IAAaR,EAAQ,SAAS,GAAG,GAEjCS,IAAgBX,EAAK,KAAK,GAAG;AACnC,MAAIY,IAAc,IACdC,IAAa;AAEjB,EAAAT,EAAO,MAAMU,EAAK,OAAO,cAAc;AAEvC,QAAMC,IAAO,YAAY;AACxB,QAAIH,KAAeC,EAAY;AAC/B,IAAAD,IAAc;AAEd,UAAMI,IAAgB,IAAIC,EAAA,EAAS,MAAA;AACnC,QAAIC,IAAiB;AAErB,IAAAF,EAAc,GAAGC,EAAO,YAAY,CAACE,MAAS;AAC7C,MAAAD,KAAkBC;AAAA,IACnB,CAAC;AAED,QAAI;AAIH,UAHA,MAAMhB,EAAM,YAAY,QAAQQ,GAAe,EAAE,QAAQK,GAAe,GAGpE,CAACH,GAAY;AAChB,cAAMO,IAASV,IACZ,KACAW,EAAK,MAAM,SAASd,EAAgB,QAAQ,CAAC,CAAC,MAAMI,CAAa;AAAA;AAAA,CAAM;AAE1E,QAAAP,EAAO,MAAMU,EAAK,OAAO,QAAQA,EAAK,OAAO,OAAOM,IAASF,CAAc;AAAA,MAC5E;AAAA,IACD,SAASI,GAAO;AACf,cAAQ,MAAMA,CAAK,GACnBC,EAAM,WAAWjB,GAAQ,KAAK,MAAM,CAACiB,EAAM,sBAAsBZ,CAAa,CAAC;AAAA,IAChF,UAAA;AACC,MAAAC,IAAc,IACdI,EAAc,KAAA;AAAA,IACf;AAAA,EACD,GAEMQ,IAAa,YAAY,MAAA;AAAM,IAAKT,EAAA;AAAA,KAAQN,CAAU;AAE5D,SAAAJ,EAAM,GAAGY,EAAO,YAAY,MAAM;AACjC,IAAAJ,IAAa,IACb,cAAcW,CAAU,GACxBpB,EAAO,MAAMU,EAAK,OAAO,aAAa;AAAA,EACvC,CAAC,GAEIC,EAAA,GAEEV,EAAM,KAAKoB,EAAU,OAAO;AACpC,CAAC;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ansi as m } from "@prozilla-os/shared";
|
|
2
|
+
import { Command as i, CommandsManager as s, Shell as e } from "../main.js";
|
|
3
|
+
const p = new i().setRequireArgs(!0).setManual({
|
|
4
|
+
purpose: "Show information about a command"
|
|
5
|
+
}).setExecute(function(t, { stdout: a, stderr: r }) {
|
|
6
|
+
const o = t[0].toLowerCase(), n = s.find(o);
|
|
7
|
+
if (!n)
|
|
8
|
+
return e.writeError(r, this.name, `${o}: Command not found`);
|
|
9
|
+
if (!n.manual?.purpose)
|
|
10
|
+
return e.writeError(r, this.name, `${o}: No information found`);
|
|
11
|
+
a.write(`${o} - ${m.green(n.manual.purpose)}
|
|
12
|
+
`);
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
p as whatis
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=whatis-CFZWdHZ4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatis-CFZWdHZ4.js","sources":["../../src/features/shell/commands/whatis.ts"],"sourcesContent":["import { Ansi } from \"@prozilla-os/shared\";\nimport { Shell } from \"../shell\";\nimport { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const whatis = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Show information about a command\",\n\t})\n\t.setExecute(function(this: Command, args: string[], { stdout, stderr }) {\n\t\tconst commandName = args[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command)\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: Command not found`);\n\n\t\tif (!command.manual?.purpose)\n\t\t\treturn Shell.writeError(stderr, this.name, `${commandName}: No information found`);\n\n\t\tstdout.write(`${commandName} - ${Ansi.green(command.manual.purpose)}\\n`);\n\t});"],"names":["whatis","Command","args","stdout","stderr","commandName","command","CommandsManager","Shell","Ansi"],"mappings":";;AAKO,MAAMA,IAAS,IAAIC,EAAA,EACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAgB,EAAE,QAAAC,GAAQ,QAAAC,KAAU;AACvE,QAAMC,IAAcH,EAAK,CAAC,EAAE,YAAA,GACtBI,IAAUC,EAAgB,KAAKF,CAAW;AAEhD,MAAI,CAACC;AACJ,WAAOE,EAAM,WAAWJ,GAAQ,KAAK,MAAM,GAAGC,CAAW,qBAAqB;AAE/E,MAAI,CAACC,EAAQ,QAAQ;AACpB,WAAOE,EAAM,WAAWJ,GAAQ,KAAK,MAAM,GAAGC,CAAW,wBAAwB;AAElF,EAAAF,EAAO,MAAM,GAAGE,CAAW,MAAMI,EAAK,MAAMH,EAAQ,OAAO,OAAO,CAAC;AAAA,CAAI;AACxE,CAAC;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command as o } from "../main.js";
|
|
2
|
+
const r = new o().setManual({
|
|
3
|
+
purpose: "Display the username"
|
|
4
|
+
}).setExecute(function(a, { username: e, stdout: t }) {
|
|
5
|
+
t.write(e);
|
|
6
|
+
});
|
|
7
|
+
export {
|
|
8
|
+
r as whoami
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=whoami-D-es0JvS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami-D-es0JvS.js","sources":["../../src/features/shell/commands/whoami.ts"],"sourcesContent":["import { Command } from \"../command\";\n\nexport const whoami = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the username\",\n\t})\n\t.setExecute(function (_args, { username, stdout }) {\n\t\tstdout.write(username);\n\t});"],"names":["whoami","Command","_args","username","stdout"],"mappings":";AAEO,MAAMA,IAAS,IAAIC,EAAA,EACxB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAUC,GAAO,EAAE,UAAAC,GAAU,QAAAC,KAAW;AACnD,EAAAA,EAAO,MAAMD,CAAQ;AACtB,CAAC;"}
|