Skip to content

Commit 7af26ba

Browse files
committed
docs: document the mcpp-short-cmd aliases in both READMEs (#313)
`xlings install mcpp-short-cmd -y` has shipped (openxlings/xim-pkgindex pkgs/m/mcpp-short-cmd.lua) but nothing in this repo mentioned it, so the answer to "does mcpp support command aliases" read as "no, write them into your shell rc yourself". Folded in under the recommended xlings install rather than as another numbered option: it is not a way to install mcpp, it is a thing you can add after installing it. Both tables are generated from the descriptor's SHORT_CMDS map and checked against it entry by entry — 30/30, no drift. The naming rule is stated so the table is a reference, not something to memorise: initial of every word but the last, last word in full (`mcpp self doctor` -> `msdoctor`).
1 parent f4a7568 commit 7af26ba

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,38 @@ irm https://d2learn.org/xlings-install.ps1.txt | iex
6767
6868
</details>
6969

70+
<details>
71+
<summary>Optional — short commands (<code>mp</code>, <code>mbuild</code>, <code>mrun</code>, …)</summary>
72+
73+
```bash
74+
xlings install mcpp-short-cmd -y
75+
```
76+
77+
Registers 30 shims, so `mcpp build` becomes `mbuild`. Naming rule: initial of
78+
every word but the last, plus the last word in full — `mcpp self doctor`
79+
`msdoctor`. `mp` is bare `mcpp`. They alias the `mcpp` shim rather than a fixed
80+
binary, so `xlings use mcpp <ver>` switches them too.
81+
82+
| Short | Expands to | Short | Expands to |
83+
| --- | --- | --- | --- |
84+
| `mp` | `mcpp` | `mexpkg` | `mcpp emit xpkg` |
85+
| `mnew` | `mcpp new` | `mxparse` | `mcpp xpkg parse` |
86+
| `mbuild` | `mcpp build` | `mtinstall` | `mcpp toolchain install` |
87+
| `mrun` | `mcpp run` | `mtlist` | `mcpp toolchain list` |
88+
| `mtest` | `mcpp test` | `mtdefault` | `mcpp toolchain default` |
89+
| `mclean` | `mcpp clean` | `mcdir` | `mcpp cache dir` |
90+
| `madd` | `mcpp add` | `mclist` | `mcpp cache list` |
91+
| `mremove` | `mcpp remove` | `mcinfo` | `mcpp cache info` |
92+
| `mupdate` | `mcpp update` | `mcgc` | `mcpp cache gc` |
93+
| `msearch` | `mcpp search` | `milist` | `mcpp index list` |
94+
| `mpublish` | `mcpp publish` | `miadd` | `mcpp index add` |
95+
| `mpack` | `mcpp pack` | `miremove` | `mcpp index remove` |
96+
| `msdoctor` | `mcpp self doctor` | `miupdate` | `mcpp index update` |
97+
| `msenv` | `mcpp self env` | `msconfig` | `mcpp self config` |
98+
| `msversion` | `mcpp self version` | `msexplain` | `mcpp self explain` |
99+
100+
</details>
101+
70102
**Other options**
71103

72104
<details>

README.zh-CN.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,37 @@ irm https://d2learn.org/xlings-install.ps1.txt | iex
6767
6868
</details>
6969

70+
<details>
71+
<summary>可选 —— 短命令(<code>mp</code>、<code>mbuild</code>、<code>mrun</code> …)</summary>
72+
73+
```bash
74+
xlings install mcpp-short-cmd -y
75+
```
76+
77+
装 30 个短命令,`mcpp build` 就是 `mbuild`。命名规则:除最后一个词外每词取首字母,
78+
最后一个词写全 —— `mcpp self doctor``msdoctor``mp` 就是裸 `mcpp`
79+
它们指向 `mcpp` 这个 shim 而非固定路径,所以 `xlings use mcpp <ver>` 也会一起切换。
80+
81+
| 短命令 | 展开 | 短命令 | 展开 |
82+
| --- | --- | --- | --- |
83+
| `mp` | `mcpp` | `mexpkg` | `mcpp emit xpkg` |
84+
| `mnew` | `mcpp new` | `mxparse` | `mcpp xpkg parse` |
85+
| `mbuild` | `mcpp build` | `mtinstall` | `mcpp toolchain install` |
86+
| `mrun` | `mcpp run` | `mtlist` | `mcpp toolchain list` |
87+
| `mtest` | `mcpp test` | `mtdefault` | `mcpp toolchain default` |
88+
| `mclean` | `mcpp clean` | `mcdir` | `mcpp cache dir` |
89+
| `madd` | `mcpp add` | `mclist` | `mcpp cache list` |
90+
| `mremove` | `mcpp remove` | `mcinfo` | `mcpp cache info` |
91+
| `mupdate` | `mcpp update` | `mcgc` | `mcpp cache gc` |
92+
| `msearch` | `mcpp search` | `milist` | `mcpp index list` |
93+
| `mpublish` | `mcpp publish` | `miadd` | `mcpp index add` |
94+
| `mpack` | `mcpp pack` | `miremove` | `mcpp index remove` |
95+
| `msdoctor` | `mcpp self doctor` | `miupdate` | `mcpp index update` |
96+
| `msenv` | `mcpp self env` | `msconfig` | `mcpp self config` |
97+
| `msversion` | `mcpp self version` | `msexplain` | `mcpp self explain` |
98+
99+
</details>
100+
70101
**其他方式**
71102

72103
<details>

0 commit comments

Comments
 (0)