@ecmaos/coreutils 0.6.3 → 0.6.5
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +16 -0
- package/dist/commands/crypto.d.ts +4 -0
- package/dist/commands/crypto.d.ts.map +1 -0
- package/dist/commands/crypto.js +1322 -0
- package/dist/commands/crypto.js.map +1 -0
- package/dist/commands/theme.d.ts +4 -0
- package/dist/commands/theme.d.ts.map +1 -0
- package/dist/commands/theme.js +108 -0
- package/dist/commands/theme.js.map +1 -0
- package/dist/index.d.ts +37 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +124 -117
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/commands/crypto.ts +1498 -0
- package/src/commands/theme.ts +118 -0
- package/src/index.ts +126 -119
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { Kernel, Process, Shell, Terminal } from '@ecmaos/types'
|
|
2
|
+
import { TerminalCommand } from '../shared/terminal-command.js'
|
|
3
|
+
import { writelnStdout, writelnStderr } from '../shared/helpers.js'
|
|
4
|
+
import { ThemePresets } from '@ecmaos/types'
|
|
5
|
+
import { parse, stringify } from 'smol-toml'
|
|
6
|
+
import path from 'path'
|
|
7
|
+
|
|
8
|
+
function printUsage(process: Process | undefined, terminal: Terminal): void {
|
|
9
|
+
const usage = `Usage: theme [OPTION]... [THEME_NAME]
|
|
10
|
+
List or switch themes.
|
|
11
|
+
|
|
12
|
+
-s, --save save the theme to ~/.config/shell.toml
|
|
13
|
+
-h, --help display this help and exit`
|
|
14
|
+
writelnStderr(process, terminal, usage)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function createCommand(kernel: Kernel, shell: Shell, terminal: Terminal): TerminalCommand {
|
|
18
|
+
return new TerminalCommand({
|
|
19
|
+
command: 'theme',
|
|
20
|
+
description: 'List or switch themes',
|
|
21
|
+
kernel,
|
|
22
|
+
shell,
|
|
23
|
+
terminal,
|
|
24
|
+
run: async (pid: number, argv: string[]) => {
|
|
25
|
+
const process = kernel.processes.get(pid) as Process | undefined
|
|
26
|
+
|
|
27
|
+
let save = false
|
|
28
|
+
let themeName: string | undefined
|
|
29
|
+
|
|
30
|
+
for (const arg of argv) {
|
|
31
|
+
if (arg === '--help' || arg === '-h') {
|
|
32
|
+
printUsage(process, terminal)
|
|
33
|
+
return 0
|
|
34
|
+
} else if (arg === '--save' || arg === '-s') {
|
|
35
|
+
save = true
|
|
36
|
+
} else if (!arg.startsWith('-')) {
|
|
37
|
+
themeName = arg
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// List themes if no theme name provided
|
|
42
|
+
if (!themeName) {
|
|
43
|
+
const themes = Object.keys(ThemePresets).sort().join('\n')
|
|
44
|
+
await writelnStdout(process, terminal, themes)
|
|
45
|
+
return 0
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Check if theme exists
|
|
49
|
+
// The shell's setTheme also handles custom theme objects, but for this CLI we only support presets
|
|
50
|
+
if (!ThemePresets[themeName]) {
|
|
51
|
+
// Try strict case matching first, then case-insensitive
|
|
52
|
+
const match = Object.keys(ThemePresets).find(t => t.toLowerCase() === themeName!.toLowerCase())
|
|
53
|
+
if (match) {
|
|
54
|
+
themeName = match
|
|
55
|
+
} else {
|
|
56
|
+
await writelnStderr(process, terminal, `Theme '${themeName}' not found`)
|
|
57
|
+
return 1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Apply theme
|
|
62
|
+
try {
|
|
63
|
+
shell.config.setTheme(themeName)
|
|
64
|
+
await writelnStdout(process, terminal, `Switched to theme: ${themeName}`)
|
|
65
|
+
} catch (error) {
|
|
66
|
+
await writelnStderr(process, terminal, `Failed to switch theme: ${error}`)
|
|
67
|
+
return 1
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Save if requested
|
|
71
|
+
if (save) {
|
|
72
|
+
try {
|
|
73
|
+
const home = shell.env.get('HOME')
|
|
74
|
+
if (!home) {
|
|
75
|
+
await writelnStderr(process, terminal, 'HOME environment variable not set, cannot save config')
|
|
76
|
+
return 1
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const configDir = path.join(home, '.config')
|
|
80
|
+
if (!await shell.context.fs.promises.exists(configDir)) {
|
|
81
|
+
await shell.context.fs.promises.mkdir(configDir, { recursive: true })
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const configPath = path.join(configDir, 'shell.toml')
|
|
85
|
+
let config: any = {}
|
|
86
|
+
|
|
87
|
+
if (await shell.context.fs.promises.exists(configPath)) {
|
|
88
|
+
const content = await shell.context.fs.promises.readFile(configPath, 'utf-8')
|
|
89
|
+
try {
|
|
90
|
+
config = parse(content)
|
|
91
|
+
} catch (e) {
|
|
92
|
+
await writelnStderr(process, terminal, `Warning: Failed to parse existing config, creating new one`)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Update theme section
|
|
97
|
+
config.theme = config.theme || {}
|
|
98
|
+
config.theme.name = themeName
|
|
99
|
+
|
|
100
|
+
// Write back
|
|
101
|
+
// Note: smol-toml stringify might be limited, but for this simple case it should work.
|
|
102
|
+
// If the existing toml is complex, we might lose comments/formatting.
|
|
103
|
+
// shell.ts uses smol-toml for parsing.
|
|
104
|
+
const newContent = stringify(config)
|
|
105
|
+
await shell.context.fs.promises.writeFile(configPath, newContent)
|
|
106
|
+
|
|
107
|
+
await writelnStdout(process, terminal, `Theme saved to ${configPath}`)
|
|
108
|
+
|
|
109
|
+
} catch (error) {
|
|
110
|
+
await writelnStderr(process, terminal, `Failed to save config: ${error}`)
|
|
111
|
+
return 1
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return 0
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,125 +1,147 @@
|
|
|
1
1
|
import type { Kernel, Shell, Terminal } from '@ecmaos/types'
|
|
2
|
-
import { TerminalCommand } from './shared/terminal-command.js'
|
|
2
|
+
import type { TerminalCommand } from './shared/terminal-command.js'
|
|
3
3
|
|
|
4
4
|
// Export shared infrastructure
|
|
5
5
|
export { TerminalCommand } from './shared/terminal-command.js'
|
|
6
|
-
export type { CommandArgs } from './shared/command-args.js'
|
|
7
6
|
export { writeStdout, writelnStdout, writeStderr, writelnStderr } from './shared/helpers.js'
|
|
7
|
+
export type { CommandArgs } from './shared/command-args.js'
|
|
8
8
|
|
|
9
9
|
// Import command factories
|
|
10
|
+
import { createCommand as createAwk } from './commands/awk.js'
|
|
11
|
+
import { createCommand as createBasename } from './commands/basename.js'
|
|
12
|
+
import { createCommand as createCal } from './commands/cal.js'
|
|
10
13
|
import { createCommand as createCat } from './commands/cat.js'
|
|
11
14
|
import { createCommand as createCd } from './commands/cd.js'
|
|
12
15
|
import { createCommand as createChmod } from './commands/chmod.js'
|
|
13
16
|
import { createCommand as createChown } from './commands/chown.js'
|
|
17
|
+
import { createCommand as createCksum } from './commands/cksum.js'
|
|
18
|
+
import { createCommand as createCmp } from './commands/cmp.js'
|
|
19
|
+
import { createCommand as createColumn } from './commands/column.js'
|
|
20
|
+
import { createCommand as createComm } from './commands/comm.js'
|
|
14
21
|
import { createCommand as createCp } from './commands/cp.js'
|
|
15
22
|
import { createCommand as createCron } from './commands/cron.js'
|
|
23
|
+
import { createCommand as createCrypto } from './commands/crypto.js'
|
|
24
|
+
import { createCommand as createCurl } from './commands/curl.js'
|
|
25
|
+
import { createCommand as createCut } from './commands/cut.js'
|
|
26
|
+
import { createCommand as createDd } from './commands/dd.js'
|
|
27
|
+
import { createCommand as createDate } from './commands/date.js'
|
|
28
|
+
import { createCommand as createDiff } from './commands/diff.js'
|
|
29
|
+
import { createCommand as createDirname } from './commands/dirname.js'
|
|
16
30
|
import { createCommand as createEcho } from './commands/echo.js'
|
|
17
31
|
import { createCommand as createEnv } from './commands/env.js'
|
|
18
32
|
import { createCommand as createExpand } from './commands/expand.js'
|
|
33
|
+
import { createCommand as createFactor } from './commands/factor.js'
|
|
34
|
+
import { createCommand as createFalse } from './commands/false.js'
|
|
19
35
|
import { createCommand as createFetch } from './commands/fetch.js'
|
|
36
|
+
import { createCommand as createFind } from './commands/find.js'
|
|
37
|
+
import { createCommand as createFmt } from './commands/fmt.js'
|
|
38
|
+
import { createCommand as createFold } from './commands/fold.js'
|
|
39
|
+
import { createCommand as createFormat } from './commands/format.js'
|
|
20
40
|
import { createCommand as createGrep } from './commands/grep.js'
|
|
21
41
|
import { createCommand as createGroups } from './commands/groups.js'
|
|
42
|
+
import { createCommand as createGit } from './commands/git.js'
|
|
22
43
|
import { createCommand as createHash } from './commands/hash.js'
|
|
23
44
|
import { createCommand as createHead } from './commands/head.js'
|
|
24
45
|
import { createCommand as createHistory } from './commands/history.js'
|
|
25
46
|
import { createCommand as createHostname } from './commands/hostname.js'
|
|
47
|
+
import { createCommand as createId } from './commands/id.js'
|
|
48
|
+
import { createCommand as createJoin } from './commands/join.js'
|
|
49
|
+
import { createCommand as createLess } from './commands/less.js'
|
|
26
50
|
import { createCommand as createLn } from './commands/ln.js'
|
|
27
51
|
import { createCommand as createLs } from './commands/ls.js'
|
|
52
|
+
import { createCommand as createMan } from './commands/man.js'
|
|
28
53
|
import { createCommand as createMkdir } from './commands/mkdir.js'
|
|
29
54
|
import { createCommand as createMktemp } from './commands/mktemp.js'
|
|
30
55
|
import { createCommand as createMount } from './commands/mount.js'
|
|
31
56
|
import { createCommand as createMv } from './commands/mv.js'
|
|
32
57
|
import { createCommand as createNc } from './commands/nc.js'
|
|
58
|
+
import { createCommand as createNl } from './commands/nl.js'
|
|
59
|
+
import { createCommand as createOd } from './commands/od.js'
|
|
33
60
|
import { createCommand as createOpen } from './commands/open.js'
|
|
61
|
+
import { createCommand as createPasskey } from './commands/passkey.js'
|
|
62
|
+
import { createCommand as createPaste } from './commands/paste.js'
|
|
34
63
|
import { createCommand as createPlay } from './commands/play.js'
|
|
35
64
|
import { createCommand as createPr } from './commands/pr.js'
|
|
36
65
|
import { createCommand as createPrintf } from './commands/printf.js'
|
|
37
66
|
import { createCommand as createPwd } from './commands/pwd.js'
|
|
38
|
-
import { createCommand as createSockets } from './commands/sockets.js'
|
|
39
67
|
import { createCommand as createReadlink } from './commands/readlink.js'
|
|
40
68
|
import { createCommand as createRealpath } from './commands/realpath.js'
|
|
41
69
|
import { createCommand as createRev } from './commands/rev.js'
|
|
42
70
|
import { createCommand as createRm } from './commands/rm.js'
|
|
43
71
|
import { createCommand as createRmdir } from './commands/rmdir.js'
|
|
44
|
-
import { createCommand as
|
|
45
|
-
import { createCommand as createTouch } from './commands/touch.js'
|
|
46
|
-
import { createCommand as createXxd } from './commands/xxd.js'
|
|
47
|
-
import { createCommand as createLess } from './commands/less.js'
|
|
48
|
-
import { createCommand as createMan } from './commands/man.js'
|
|
49
|
-
import { createCommand as createPasskey } from './commands/passkey.js'
|
|
72
|
+
import { createCommand as createSeq } from './commands/seq.js'
|
|
50
73
|
import { createCommand as createSed } from './commands/sed.js'
|
|
51
74
|
import { createCommand as createShuf } from './commands/shuf.js'
|
|
52
|
-
import { createCommand as createTee } from './commands/tee.js'
|
|
53
|
-
import { createCommand as createTac } from './commands/tac.js'
|
|
54
|
-
import { createCommand as createTail } from './commands/tail.js'
|
|
55
|
-
import { createCommand as createTar } from './commands/tar.js'
|
|
56
|
-
import { createCommand as createAwk } from './commands/awk.js'
|
|
57
|
-
import { createCommand as createBasename } from './commands/basename.js'
|
|
58
|
-
import { createCommand as createCal } from './commands/cal.js'
|
|
59
|
-
import { createCommand as createCksum } from './commands/cksum.js'
|
|
60
|
-
import { createCommand as createCmp } from './commands/cmp.js'
|
|
61
|
-
import { createCommand as createColumn } from './commands/column.js'
|
|
62
|
-
import { createCommand as createComm } from './commands/comm.js'
|
|
63
|
-
import { createCommand as createCurl } from './commands/curl.js'
|
|
64
|
-
import { createCommand as createCut } from './commands/cut.js'
|
|
65
|
-
import { createCommand as createDd } from './commands/dd.js'
|
|
66
|
-
import { createCommand as createDate } from './commands/date.js'
|
|
67
|
-
import { createCommand as createDiff } from './commands/diff.js'
|
|
68
|
-
import { createCommand as createDirname } from './commands/dirname.js'
|
|
69
|
-
import { createCommand as createFactor } from './commands/factor.js'
|
|
70
|
-
import { createCommand as createFalse } from './commands/false.js'
|
|
71
|
-
import { createCommand as createFind } from './commands/find.js'
|
|
72
|
-
import { createCommand as createFold } from './commands/fold.js'
|
|
73
|
-
import { createCommand as createFormat } from './commands/format.js'
|
|
74
|
-
import { createCommand as createFmt } from './commands/fmt.js'
|
|
75
|
-
import { createCommand as createId } from './commands/id.js'
|
|
76
|
-
import { createCommand as createJoin } from './commands/join.js'
|
|
77
|
-
import { createCommand as createNl } from './commands/nl.js'
|
|
78
|
-
import { createCommand as createOd } from './commands/od.js'
|
|
79
|
-
import { createCommand as createPaste } from './commands/paste.js'
|
|
80
|
-
import { createCommand as createSeq } from './commands/seq.js'
|
|
81
75
|
import { createCommand as createSleep } from './commands/sleep.js'
|
|
76
|
+
import { createCommand as createSockets } from './commands/sockets.js'
|
|
82
77
|
import { createCommand as createSort } from './commands/sort.js'
|
|
83
78
|
import { createCommand as createSplit } from './commands/split.js'
|
|
79
|
+
import { createCommand as createStat } from './commands/stat.js'
|
|
84
80
|
import { createCommand as createStrings } from './commands/strings.js'
|
|
81
|
+
import { createCommand as createTac } from './commands/tac.js'
|
|
82
|
+
import { createCommand as createTail } from './commands/tail.js'
|
|
83
|
+
import { createCommand as createTar } from './commands/tar.js'
|
|
84
|
+
import { createCommand as createTee } from './commands/tee.js'
|
|
85
85
|
import { createCommand as createTest } from './commands/test.js'
|
|
86
|
+
import { createCommand as createTheme } from './commands/theme.js'
|
|
86
87
|
import { createCommand as createTime } from './commands/time.js'
|
|
88
|
+
import { createCommand as createTouch } from './commands/touch.js'
|
|
87
89
|
import { createCommand as createTr } from './commands/tr.js'
|
|
88
90
|
import { createCommand as createTrue } from './commands/true.js'
|
|
89
91
|
import { createCommand as createTty } from './commands/tty.js'
|
|
90
92
|
import { createCommand as createUname } from './commands/uname.js'
|
|
91
93
|
import { createCommand as createUmount } from './commands/umount.js'
|
|
92
94
|
import { createCommand as createUnexpand } from './commands/unexpand.js'
|
|
93
|
-
import { createCommand as createUptime } from './commands/uptime.js'
|
|
94
95
|
import { createCommand as createUniq } from './commands/uniq.js'
|
|
96
|
+
import { createCommand as createUnzip } from './commands/unzip.js'
|
|
97
|
+
import { createCommand as createUptime } from './commands/uptime.js'
|
|
95
98
|
import { createCommand as createUser } from './commands/user.js'
|
|
99
|
+
import { createCommand as createVim } from './commands/vim.js'
|
|
100
|
+
import { createCommand as createVideo } from './commands/video.js'
|
|
101
|
+
import { createCommand as createView } from './commands/view.js'
|
|
96
102
|
import { createCommand as createWc } from './commands/wc.js'
|
|
97
103
|
import { createCommand as createWeb } from './commands/web.js'
|
|
98
104
|
import { createCommand as createWhich } from './commands/which.js'
|
|
99
105
|
import { createCommand as createWhoami } from './commands/whoami.js'
|
|
106
|
+
import { createCommand as createXxd } from './commands/xxd.js'
|
|
100
107
|
import { createCommand as createZip } from './commands/zip.js'
|
|
101
|
-
import { createCommand as createUnzip } from './commands/unzip.js'
|
|
102
|
-
import { createCommand as createVideo } from './commands/video.js'
|
|
103
|
-
import { createCommand as createView } from './commands/view.js'
|
|
104
|
-
import { createCommand as createVim } from './commands/vim.js'
|
|
105
|
-
import { createCommand as createGit } from './commands/git.js'
|
|
106
108
|
|
|
107
109
|
// Export individual command factories
|
|
110
|
+
export { createCommand as createAwk } from './commands/awk.js'
|
|
111
|
+
export { createCommand as createBasename } from './commands/basename.js'
|
|
108
112
|
export { createCommand as createCat } from './commands/cat.js'
|
|
109
113
|
export { createCommand as createCd } from './commands/cd.js'
|
|
110
114
|
export { createCommand as createChmod } from './commands/chmod.js'
|
|
115
|
+
export { createCommand as createCksum } from './commands/cksum.js'
|
|
116
|
+
export { createCommand as createCmp } from './commands/cmp.js'
|
|
117
|
+
export { createCommand as createColumn } from './commands/column.js'
|
|
111
118
|
export { createCommand as createCp } from './commands/cp.js'
|
|
112
119
|
export { createCommand as createCron } from './commands/cron.js'
|
|
120
|
+
export { createCommand as createCrypto } from './commands/crypto.js'
|
|
121
|
+
export { createCommand as createCurl } from './commands/curl.js'
|
|
122
|
+
export { createCommand as createCut } from './commands/cut.js'
|
|
123
|
+
export { createCommand as createDd } from './commands/dd.js'
|
|
124
|
+
export { createCommand as createDate } from './commands/date.js'
|
|
125
|
+
export { createCommand as createDiff } from './commands/diff.js'
|
|
126
|
+
export { createCommand as createDirname } from './commands/dirname.js'
|
|
113
127
|
export { createCommand as createEcho } from './commands/echo.js'
|
|
114
128
|
export { createCommand as createEnv } from './commands/env.js'
|
|
115
129
|
export { createCommand as createExpand } from './commands/expand.js'
|
|
130
|
+
export { createCommand as createFactor } from './commands/factor.js'
|
|
116
131
|
export { createCommand as createFetch } from './commands/fetch.js'
|
|
132
|
+
export { createCommand as createFind } from './commands/find.js'
|
|
133
|
+
export { createCommand as createFmt } from './commands/fmt.js'
|
|
134
|
+
export { createCommand as createFold } from './commands/fold.js'
|
|
135
|
+
export { createCommand as createFormat } from './commands/format.js'
|
|
136
|
+
export { createCommand as createGit } from './commands/git.js'
|
|
117
137
|
export { createCommand as createGrep } from './commands/grep.js'
|
|
118
138
|
export { createCommand as createGroups } from './commands/groups.js'
|
|
119
139
|
export { createCommand as createHash } from './commands/hash.js'
|
|
120
140
|
export { createCommand as createHistory } from './commands/history.js'
|
|
141
|
+
export { createCommand as createLess } from './commands/less.js'
|
|
121
142
|
export { createCommand as createLn } from './commands/ln.js'
|
|
122
143
|
export { createCommand as createLs } from './commands/ls.js'
|
|
144
|
+
export { createCommand as createMan } from './commands/man.js'
|
|
123
145
|
export { createCommand as createMkdir } from './commands/mkdir.js'
|
|
124
146
|
export { createCommand as createMktemp } from './commands/mktemp.js'
|
|
125
147
|
export { createCommand as createMount } from './commands/mount.js'
|
|
@@ -134,54 +156,37 @@ export { createCommand as createRealpath } from './commands/realpath.js'
|
|
|
134
156
|
export { createCommand as createRev } from './commands/rev.js'
|
|
135
157
|
export { createCommand as createRm } from './commands/rm.js'
|
|
136
158
|
export { createCommand as createRmdir } from './commands/rmdir.js'
|
|
137
|
-
export { createCommand as createStat } from './commands/stat.js'
|
|
138
|
-
export { createCommand as createStrings } from './commands/strings.js'
|
|
139
|
-
export { createCommand as createTouch } from './commands/touch.js'
|
|
140
|
-
export { createCommand as createXxd } from './commands/xxd.js'
|
|
141
|
-
export { createCommand as createLess } from './commands/less.js'
|
|
142
|
-
export { createCommand as createMan } from './commands/man.js'
|
|
143
159
|
export { createCommand as createSed } from './commands/sed.js'
|
|
144
160
|
export { createCommand as createShuf } from './commands/shuf.js'
|
|
145
|
-
export { createCommand as
|
|
161
|
+
export { createCommand as createSleep } from './commands/sleep.js'
|
|
162
|
+
export { createCommand as createSockets } from './commands/sockets.js'
|
|
163
|
+
export { createCommand as createSort } from './commands/sort.js'
|
|
164
|
+
export { createCommand as createStat } from './commands/stat.js'
|
|
165
|
+
export { createCommand as createStrings } from './commands/strings.js'
|
|
146
166
|
export { createCommand as createTac } from './commands/tac.js'
|
|
147
167
|
export { createCommand as createTail } from './commands/tail.js'
|
|
148
168
|
export { createCommand as createTar } from './commands/tar.js'
|
|
149
|
-
export { createCommand as
|
|
150
|
-
export { createCommand as createBasename } from './commands/basename.js'
|
|
151
|
-
export { createCommand as createCksum } from './commands/cksum.js'
|
|
152
|
-
export { createCommand as createCmp } from './commands/cmp.js'
|
|
153
|
-
export { createCommand as createColumn } from './commands/column.js'
|
|
154
|
-
export { createCommand as createCurl } from './commands/curl.js'
|
|
155
|
-
export { createCommand as createCut } from './commands/cut.js'
|
|
156
|
-
export { createCommand as createDd } from './commands/dd.js'
|
|
157
|
-
export { createCommand as createDate } from './commands/date.js'
|
|
158
|
-
export { createCommand as createDiff } from './commands/diff.js'
|
|
159
|
-
export { createCommand as createDirname } from './commands/dirname.js'
|
|
160
|
-
export { createCommand as createFactor } from './commands/factor.js'
|
|
161
|
-
export { createCommand as createFind } from './commands/find.js'
|
|
162
|
-
export { createCommand as createFold } from './commands/fold.js'
|
|
163
|
-
export { createCommand as createFormat } from './commands/format.js'
|
|
164
|
-
export { createCommand as createFmt } from './commands/fmt.js'
|
|
165
|
-
export { createCommand as createSleep } from './commands/sleep.js'
|
|
166
|
-
export { createCommand as createSort } from './commands/sort.js'
|
|
169
|
+
export { createCommand as createTee } from './commands/tee.js'
|
|
167
170
|
export { createCommand as createTest } from './commands/test.js'
|
|
171
|
+
export { createCommand as createTheme } from './commands/theme.js'
|
|
172
|
+
export { createCommand as createTime } from './commands/time.js'
|
|
173
|
+
export { createCommand as createTouch } from './commands/touch.js'
|
|
168
174
|
export { createCommand as createTr } from './commands/tr.js'
|
|
169
175
|
export { createCommand as createTty } from './commands/tty.js'
|
|
170
176
|
export { createCommand as createUname } from './commands/uname.js'
|
|
171
177
|
export { createCommand as createUmount } from './commands/umount.js'
|
|
172
|
-
export { createCommand as createUptime } from './commands/uptime.js'
|
|
173
178
|
export { createCommand as createUniq } from './commands/uniq.js'
|
|
179
|
+
export { createCommand as createUnzip } from './commands/unzip.js'
|
|
180
|
+
export { createCommand as createUptime } from './commands/uptime.js'
|
|
174
181
|
export { createCommand as createUser } from './commands/user.js'
|
|
182
|
+
export { createCommand as createVideo } from './commands/video.js'
|
|
183
|
+
export { createCommand as createView } from './commands/view.js'
|
|
184
|
+
export { createCommand as createVim } from './commands/vim.js'
|
|
175
185
|
export { createCommand as createWc } from './commands/wc.js'
|
|
176
186
|
export { createCommand as createWeb } from './commands/web.js'
|
|
177
187
|
export { createCommand as createWhich } from './commands/which.js'
|
|
178
|
-
export { createCommand as
|
|
188
|
+
export { createCommand as createXxd } from './commands/xxd.js'
|
|
179
189
|
export { createCommand as createZip } from './commands/zip.js'
|
|
180
|
-
export { createCommand as createUnzip } from './commands/unzip.js'
|
|
181
|
-
export { createCommand as createVideo } from './commands/video.js'
|
|
182
|
-
export { createCommand as createView } from './commands/view.js'
|
|
183
|
-
export { createCommand as createVim } from './commands/vim.js'
|
|
184
|
-
export { createCommand as createGit } from './commands/git.js'
|
|
185
190
|
|
|
186
191
|
/**
|
|
187
192
|
* Creates all coreutils commands.
|
|
@@ -189,102 +194,104 @@ export { createCommand as createGit } from './commands/git.js'
|
|
|
189
194
|
*/
|
|
190
195
|
export function createAllCommands(kernel: Kernel, shell: Shell, terminal: Terminal): { [key: string]: TerminalCommand } {
|
|
191
196
|
return {
|
|
197
|
+
awk: createAwk(kernel, shell, terminal),
|
|
198
|
+
basename: createBasename(kernel, shell, terminal),
|
|
199
|
+
cal: createCal(kernel, shell, terminal),
|
|
192
200
|
cat: createCat(kernel, shell, terminal),
|
|
193
201
|
cd: createCd(kernel, shell, terminal),
|
|
202
|
+
cksum: createCksum(kernel, shell, terminal),
|
|
194
203
|
chmod: createChmod(kernel, shell, terminal),
|
|
195
204
|
chown: createChown(kernel, shell, terminal),
|
|
205
|
+
cmp: createCmp(kernel, shell, terminal),
|
|
206
|
+
column: createColumn(kernel, shell, terminal),
|
|
207
|
+
comm: createComm(kernel, shell, terminal),
|
|
196
208
|
cp: createCp(kernel, shell, terminal),
|
|
197
209
|
cron: createCron(kernel, shell, terminal),
|
|
210
|
+
crypto: createCrypto(kernel, shell, terminal),
|
|
211
|
+
curl: createCurl(kernel, shell, terminal),
|
|
212
|
+
cut: createCut(kernel, shell, terminal),
|
|
213
|
+
dd: createDd(kernel, shell, terminal),
|
|
214
|
+
date: createDate(kernel, shell, terminal),
|
|
215
|
+
diff: createDiff(kernel, shell, terminal),
|
|
216
|
+
dirname: createDirname(kernel, shell, terminal),
|
|
198
217
|
echo: createEcho(kernel, shell, terminal),
|
|
199
218
|
env: createEnv(kernel, shell, terminal),
|
|
200
219
|
expand: createExpand(kernel, shell, terminal),
|
|
220
|
+
factor: createFactor(kernel, shell, terminal),
|
|
221
|
+
false: createFalse(kernel, shell, terminal),
|
|
201
222
|
fetch: createFetch(kernel, shell, terminal),
|
|
223
|
+
find: createFind(kernel, shell, terminal),
|
|
224
|
+
fmt: createFmt(kernel, shell, terminal),
|
|
225
|
+
fold: createFold(kernel, shell, terminal),
|
|
226
|
+
format: createFormat(kernel, shell, terminal),
|
|
227
|
+
git: createGit(kernel, shell, terminal),
|
|
202
228
|
grep: createGrep(kernel, shell, terminal),
|
|
203
229
|
groups: createGroups(kernel, shell, terminal),
|
|
204
230
|
hash: createHash(kernel, shell, terminal),
|
|
205
231
|
head: createHead(kernel, shell, terminal),
|
|
206
232
|
history: createHistory(kernel, shell, terminal),
|
|
207
233
|
hostname: createHostname(kernel, shell, terminal),
|
|
234
|
+
id: createId(kernel, shell, terminal),
|
|
235
|
+
join: createJoin(kernel, shell, terminal),
|
|
236
|
+
less: createLess(kernel, shell, terminal),
|
|
208
237
|
ln: createLn(kernel, shell, terminal),
|
|
209
238
|
ls: createLs(kernel, shell, terminal),
|
|
239
|
+
man: createMan(kernel, shell, terminal),
|
|
210
240
|
mkdir: createMkdir(kernel, shell, terminal),
|
|
211
241
|
mktemp: createMktemp(kernel, shell, terminal),
|
|
212
242
|
mount: createMount(kernel, shell, terminal),
|
|
213
243
|
mv: createMv(kernel, shell, terminal),
|
|
214
244
|
nc: createNc(kernel, shell, terminal),
|
|
245
|
+
nl: createNl(kernel, shell, terminal),
|
|
246
|
+
od: createOd(kernel, shell, terminal),
|
|
215
247
|
open: createOpen(kernel, shell, terminal),
|
|
248
|
+
passkey: createPasskey(kernel, shell, terminal),
|
|
249
|
+
paste: createPaste(kernel, shell, terminal),
|
|
216
250
|
play: createPlay(kernel, shell, terminal),
|
|
217
251
|
pr: createPr(kernel, shell, terminal),
|
|
218
252
|
printf: createPrintf(kernel, shell, terminal),
|
|
219
253
|
pwd: createPwd(kernel, shell, terminal),
|
|
220
|
-
sockets: createSockets(kernel, shell, terminal),
|
|
221
254
|
readlink: createReadlink(kernel, shell, terminal),
|
|
222
255
|
realpath: createRealpath(kernel, shell, terminal),
|
|
223
|
-
rm: createRm(kernel, shell, terminal),
|
|
224
256
|
rev: createRev(kernel, shell, terminal),
|
|
257
|
+
rm: createRm(kernel, shell, terminal),
|
|
225
258
|
rmdir: createRmdir(kernel, shell, terminal),
|
|
226
|
-
stat: createStat(kernel, shell, terminal),
|
|
227
|
-
strings: createStrings(kernel, shell, terminal),
|
|
228
|
-
touch: createTouch(kernel, shell, terminal),
|
|
229
|
-
xxd: createXxd(kernel, shell, terminal),
|
|
230
|
-
less: createLess(kernel, shell, terminal),
|
|
231
|
-
man: createMan(kernel, shell, terminal),
|
|
232
|
-
passkey: createPasskey(kernel, shell, terminal),
|
|
233
259
|
sed: createSed(kernel, shell, terminal),
|
|
234
|
-
shuf: createShuf(kernel, shell, terminal),
|
|
235
|
-
tac: createTac(kernel, shell, terminal),
|
|
236
|
-
tail: createTail(kernel, shell, terminal),
|
|
237
|
-
tee: createTee(kernel, shell, terminal),
|
|
238
|
-
awk: createAwk(kernel, shell, terminal),
|
|
239
|
-
basename: createBasename(kernel, shell, terminal),
|
|
240
|
-
cal: createCal(kernel, shell, terminal),
|
|
241
|
-
cksum: createCksum(kernel, shell, terminal),
|
|
242
|
-
cmp: createCmp(kernel, shell, terminal),
|
|
243
|
-
column: createColumn(kernel, shell, terminal),
|
|
244
|
-
comm: createComm(kernel, shell, terminal),
|
|
245
|
-
curl: createCurl(kernel, shell, terminal),
|
|
246
|
-
cut: createCut(kernel, shell, terminal),
|
|
247
|
-
dd: createDd(kernel, shell, terminal),
|
|
248
|
-
date: createDate(kernel, shell, terminal),
|
|
249
|
-
diff: createDiff(kernel, shell, terminal),
|
|
250
|
-
dirname: createDirname(kernel, shell, terminal),
|
|
251
|
-
factor: createFactor(kernel, shell, terminal),
|
|
252
|
-
false: createFalse(kernel, shell, terminal),
|
|
253
|
-
find: createFind(kernel, shell, terminal),
|
|
254
|
-
fold: createFold(kernel, shell, terminal),
|
|
255
|
-
format: createFormat(kernel, shell, terminal),
|
|
256
|
-
fmt: createFmt(kernel, shell, terminal),
|
|
257
|
-
id: createId(kernel, shell, terminal),
|
|
258
|
-
join: createJoin(kernel, shell, terminal),
|
|
259
|
-
nl: createNl(kernel, shell, terminal),
|
|
260
|
-
od: createOd(kernel, shell, terminal),
|
|
261
|
-
paste: createPaste(kernel, shell, terminal),
|
|
262
260
|
seq: createSeq(kernel, shell, terminal),
|
|
261
|
+
shuf: createShuf(kernel, shell, terminal),
|
|
263
262
|
sleep: createSleep(kernel, shell, terminal),
|
|
263
|
+
sockets: createSockets(kernel, shell, terminal),
|
|
264
264
|
sort: createSort(kernel, shell, terminal),
|
|
265
265
|
split: createSplit(kernel, shell, terminal),
|
|
266
|
+
stat: createStat(kernel, shell, terminal),
|
|
267
|
+
strings: createStrings(kernel, shell, terminal),
|
|
268
|
+
tac: createTac(kernel, shell, terminal),
|
|
269
|
+
tail: createTail(kernel, shell, terminal),
|
|
266
270
|
tar: createTar(kernel, shell, terminal),
|
|
271
|
+
tee: createTee(kernel, shell, terminal),
|
|
267
272
|
test: createTest(kernel, shell, terminal),
|
|
273
|
+
theme: createTheme(kernel, shell, terminal),
|
|
268
274
|
time: createTime(kernel, shell, terminal),
|
|
275
|
+
touch: createTouch(kernel, shell, terminal),
|
|
269
276
|
tr: createTr(kernel, shell, terminal),
|
|
270
277
|
true: createTrue(kernel, shell, terminal),
|
|
271
278
|
tty: createTty(kernel, shell, terminal),
|
|
272
279
|
uname: createUname(kernel, shell, terminal),
|
|
273
280
|
umount: createUmount(kernel, shell, terminal),
|
|
274
281
|
unexpand: createUnexpand(kernel, shell, terminal),
|
|
275
|
-
uptime: createUptime(kernel, shell, terminal),
|
|
276
282
|
uniq: createUniq(kernel, shell, terminal),
|
|
283
|
+
unzip: createUnzip(kernel, shell, terminal),
|
|
284
|
+
uptime: createUptime(kernel, shell, terminal),
|
|
277
285
|
user: createUser(kernel, shell, terminal),
|
|
286
|
+
video: createVideo(kernel, shell, terminal),
|
|
287
|
+
view: createView(kernel, shell, terminal),
|
|
288
|
+
vim: createVim(kernel, shell, terminal),
|
|
278
289
|
wc: createWc(kernel, shell, terminal),
|
|
279
290
|
web: createWeb(kernel, shell, terminal),
|
|
280
291
|
which: createWhich(kernel, shell, terminal),
|
|
281
292
|
whoami: createWhoami(kernel, shell, terminal),
|
|
293
|
+
xxd: createXxd(kernel, shell, terminal),
|
|
282
294
|
zip: createZip(kernel, shell, terminal),
|
|
283
|
-
unzip: createUnzip(kernel, shell, terminal),
|
|
284
|
-
video: createVideo(kernel, shell, terminal),
|
|
285
|
-
view: createView(kernel, shell, terminal),
|
|
286
|
-
vim: createVim(kernel, shell, terminal),
|
|
287
|
-
git: createGit(kernel, shell, terminal)
|
|
288
295
|
}
|
|
289
296
|
}
|
|
290
297
|
|