Skip to content

Commit 98973a2

Browse files
authored
Improve auto-gen README.md (#1093)
* Fix typo * Add code fences * Use `nushell` instead of `nu` code block language, so it renders correctly on GitHub * Use correct headline levels (only one instead of three top headlines) * Add paragraph spacing where applicable * Add trailing newline
1 parent d48b4a0 commit 98973a2

File tree

1 file changed

+28
-22
lines changed
  • needs-update/custom-completions/auto-generate

1 file changed

+28
-22
lines changed

needs-update/custom-completions/auto-generate/README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,61 @@
11
# auto-generate completions
22

3-
- basic helpers to parse --help information from cli commands and export nu completions source
4-
- basic helpers tp parse .fish complete files and export nu completions source
3+
- basic helpers to parse `--help` information from cli commands and export nu completions source
4+
- basic helpers to parse `.fish` complete files and export nu completions source
55

6-
# parse-fish
6+
## parse-fish
7+
8+
### current
79

8-
## current
910
- only parses out simple complete's with no complete's boolean arguments like -f
1011
- does not map fish autocomplete helpers to nu-complete helps (a nu library of autocomplete utils would be neat)
1112

12-
## usage
13+
### usage
1314

14-
be in a directory with one or more .fish completion scripts
15+
be in a directory with one or more `.fish` completion scripts
1516

16-
A good one is
17+
A good one is
1718

18-
`git clone https://github.com/fish-shell/fish-shell`
19-
`cd fish-shell/share/completions`
19+
```nushell
20+
git clone https://github.com/fish-shell/fish-shell
21+
cd fish-shell/share/completions
22+
```
2023

21-
To build all .fish files in the current directory `build-completions-from-pwd`
24+
To build all `.fish` files in the current directory `build-completions-from-pwd`
2225

23-
```nu
26+
```nushell
2427
build-completions-from-pwd
2528
ls *.nu
2629
```
2730

28-
To build a single .fish file and choose the output file
29-
```nu
31+
To build a single `.fish` file and choose the output file
32+
33+
```nushell
3034
build-completion cargo.fish cargo.nu
3135
```
32-
# parse-help
3336

34-
## current limitations
37+
## parse-help
38+
39+
### current limitations
3540

36-
- Only flags are parsed, arguments are not parsed and ...args is injected at the end to catch all
41+
- Only flags are parsed, arguments are not parsed and `...args` is injected at the end to catch all
3742
- Some examples of `--flags` in descriptions can throw off the regex and get included in the parsed flags
3843
- `<format>` (types) to flags are parsed, but not added to the nu shell completion type hints
3944

40-
## usage
45+
### usage
4146

4247
generate and save source to a file
4348

44-
```nu
49+
```nushell
4550
source parse-help.nu
4651
cargo --help | parse-help | make-completion cargo | save cargo.nu
4752
```
4853

49-
## example
54+
### example
5055

5156
This can be saved to a file and sourced. Example of output
5257

53-
```nu
58+
```nushell
5459
extern "cargo" [
5560
--version(-V) #Print version info and exit
5661
--list #List installed commands
@@ -84,7 +89,8 @@ extern "nu" [
8489
```
8590

8691
Which outputs like so on tab completion for `cargo --`
87-
```
92+
93+
```nushell
8894
❯ | cargo --
8995
--color Coloring: auto, always, never
9096
--config Override a configuration value (unstable)
@@ -98,4 +104,4 @@ Which outputs like so on tab completion for `cargo --`
98104
--quiet Do not print cargo log messages
99105
--verbose Use verbose output (-vv very verbose/build.rs output)
100106
--version Print version info and exit
101-
```
107+
```

0 commit comments

Comments
 (0)