Skip to content

Commit 16cc7b8

Browse files
authored
0.0.4: actions return a status, run dispatches at any depth, usage errors go to standard error (#11)
An action is int(const ParsedArgs&), whose result is the status run returns, or void(const ParsedArgs&), whose status is 0; existing void actions are unchanged. run(parsed) descends to the deepest matched subcommand at any depth and runs its action, else the nearest ancestor's (which dispatches on subcommand_name()); a command group named without a subcommand writes its subcommands to standard error and returns 2. run(argc, argv) and the new run(Argv) write a parse error to standard error, as '<name>: <message>' and a pointer to --help, and return 2, the status of a usage error; standard output carries only help, the version and the actions' own output. parse and parse_from share one token entry.
1 parent db53410 commit 16cc7b8

9 files changed

Lines changed: 1760 additions & 46 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"fingerprint": {
3+
"/home/speak/.xlings/.xlings.json": "4014023:-4643116326602899284",
4+
"/home/speak/.xlings/data/versions.json": "3859010:-4643116326531898249",
5+
"/home/speak/.xlings/subos/speak-agent-private/.xlings.json": "273600:-4643140060670125089",
6+
"/home/speak/workspace/tmp/eco/cmdline/.xlings.json": "51:-4643109118759633077",
7+
"/home/speak/workspace/tmp/eco/cmdline/.xlings/.xlings.json": "absent"
8+
},
9+
"format": 1,
10+
"program": "gh",
11+
"vinfo": {
12+
"gh": {
13+
"filename": "gh",
14+
"type": "program",
15+
"versions": {
16+
"2.92.0": {
17+
"bindingGroup": {
18+
"group": "gh",
19+
"provider": "xim:github-gh",
20+
"rootTarget": "gh",
21+
"rootVersion": "2.92.0",
22+
"version": "2.92.0"
23+
},
24+
"bindingMembers": {
25+
"gh": "2.92.0"
26+
},
27+
"destinationName": "gh",
28+
"kind": "program",
29+
"path": "/home/speak/.xlings/data/xpkgs/xim-x-github-gh/2.92.0/bin",
30+
"sourceName": "gh"
31+
}
32+
}
33+
}
34+
},
35+
"workspace": {
36+
"gh": {
37+
"active": "2.92.0",
38+
"installed": [
39+
"2.92.0"
40+
]
41+
}
42+
}
43+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"fingerprint": {
3+
"/home/speak/.xlings/.xlings.json": "4014023:-4643116326602899284",
4+
"/home/speak/.xlings/data/versions.json": "3859010:-4643116326531898249",
5+
"/home/speak/.xlings/subos/speak-agent-private/.xlings.json": "273600:-4643140060670125089",
6+
"/home/speak/workspace/tmp/eco/cmdline/.xlings.json": "51:-4643109118759633077",
7+
"/home/speak/workspace/tmp/eco/cmdline/.xlings/.xlings.json": "absent"
8+
},
9+
"format": 1,
10+
"program": "git",
11+
"vinfo": {
12+
"git": {
13+
"filename": "git",
14+
"type": "program",
15+
"versions": {
16+
"2.53.0": {
17+
"bindingGroup": {
18+
"group": "git",
19+
"provider": "xim:git",
20+
"rootTarget": "git",
21+
"rootVersion": "2.53.0",
22+
"version": "2.53.0"
23+
},
24+
"bindingMembers": {
25+
"git": "2.53.0"
26+
},
27+
"destinationName": "git",
28+
"envs": {
29+
"GIT_SSL_CAINFO": "/etc/ssl/certs/ca-certificates.crt"
30+
},
31+
"kind": "program",
32+
"path": "/home/speak/.xlings/data/xpkgs/xim-x-git/2.53.0/bin",
33+
"sourceName": "git"
34+
},
35+
"2.53.0-1": {
36+
"bindingGroup": {
37+
"group": "git",
38+
"provider": "xim:git",
39+
"rootTarget": "git",
40+
"rootVersion": "2.53.0-1",
41+
"version": "2.53.0-1"
42+
},
43+
"bindingMembers": {
44+
"git": "2.53.0-1"
45+
},
46+
"destinationName": "git",
47+
"envs": {
48+
"GIT_SSL_CAINFO": "/etc/ssl/certs/ca-certificates.crt"
49+
},
50+
"kind": "program",
51+
"path": "/home/speak/.xlings/data/xpkgs/xim-x-git/2.53.0-1/bin",
52+
"sourceName": "git"
53+
}
54+
}
55+
}
56+
},
57+
"workspace": {
58+
"git": {
59+
"active": "2.53.0",
60+
"installed": [
61+
"2.53.0"
62+
]
63+
}
64+
}
65+
}

0 commit comments

Comments
 (0)