forked from pkgxdev/pkgx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.help.ts
77 lines (63 loc) · 2.9 KB
/
app.help.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { useFlags } from "hooks"
import { print, undent } from "utils"
export default async function help() {
const { verbose } = useFlags()
if (!verbose) {
// 10| 20| 30| 40| 50| 60| 70| | 80|
await print(undent`
usage:
tea [-SEn] [+package~x.y…] [cmd|file|URL] [--] [arg…]
examples:
05 $ tea node^19 --eval 'console.log("tea.xyz")'
$ tea +nodejs.org man node
$ tea +bun.sh sh
# ^^ try out bun in an containerized shell
10 flags:
--sync,-S sync and update environment packages
--env,-E inject local environment
--dry-run,-n don’t do anything, just print
15 more:
$ tea --verbose --help
$ open https://github.com/teaxyz/cli
`)
} else {
// 10| 20| 30| 40| 50| 60| 70| | 80|
await print(undent`
usage:
tea [-SEnkhvs] [+package~x.y…] [cmd|file|URL] [--] [arg…]
• assembles the requested environment, installing packages as necessary
• magically determines additional packages based on the args
• executes args in that environment
flags:
--sync,-S synchronize and update the environment packages
--env,-E inject the local environment
--dry-run,-n don’t do anything, just print
--keep-going,-k keep going as much as possible after errors
--verbose,-v print version and then increase verbosity †
--silent,-s no chat, no errors: only output the requested data
--cd,-C,--chdir <dir> change directory first
--chaste abstain from networking, installing packages, etc.
--dry-run,-n don’t execute, just print
• repetitions override previous values
• long form boolean flags can be assigned, eg. --env=no
† the short form accumulates, so \`-vv\` is more verbose
alt. modes:
--help,-h
--version,-v prints tea’s version
--prefix prints the tea prefix ‡
--provides exits successfully if package/s are provided
‡ all packages are “stowed” in the tea prefix, eg. ~/.tea/rust-lang.org/v1.65.0
environment variables:
TEA_PREFIX stow packages here
TEA_MAGIC if shell magic is active, \`TEA_MAGIC=0\` disables it
CLICOLOR see https://bixense.com/clicolors
VERBOSE {-1: silent, 0: default, 1: verbose, 2: debug}
DEBUG alias for \`VERBOSE=2\`
• explicit flags override any environment variables
ideology:
│ a successful tool is one that was used to do something undreamed of
│ by its author
—𝘚𝘵𝘦𝘱𝘩𝘦𝘯 𝘊. 𝘑𝘰𝘩𝘯𝘴𝘰𝘯
`)
}
}