Skip to content

Commit 8b54eb9

Browse files
committed
docs(CLI): Update to argparse
1 parent 5434bac commit 8b54eb9

File tree

10 files changed

+91
-93
lines changed

10 files changed

+91
-93
lines changed

docs/cli/completion.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/cli/convert.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
Convert between YAML and JSON
66

7+
```{eval-rst}
8+
.. argparse::
9+
:module: tmuxp.cli
10+
:func: create_parser
11+
:prog: tmuxp
12+
:path: convert
13+
```
14+
15+
## Usage
16+
717
````{tab} YAML -> JSON
818
919
```console
@@ -22,12 +32,3 @@ $ tmuxp convert /path/to/file.json
2232

2333
tmuxp automatically will prompt to convert `.yaml` to `.json` and
2434
`.json` to `.yaml`.
25-
26-
## Reference
27-
28-
```{eval-rst}
29-
.. click:: tmuxp.cli.convert:command_convert
30-
:prog: tmuxp convert
31-
:commands: convert
32-
:nested: full
33-
```

docs/cli/debug-info.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
Use to collect all relevant information for submitting an issue to
88
the project.
99

10+
```{eval-rst}
11+
.. argparse::
12+
:module: tmuxp.cli
13+
:func: create_parser
14+
:prog: tmuxp
15+
:path: debug-info
16+
```
17+
18+
## Usage
19+
1020
```console
1121

1222
$ tmuxp debug-info
@@ -17,12 +27,3 @@ environment:
1727
...
1828

1929
```
20-
21-
## Reference
22-
23-
```{eval-rst}
24-
.. click:: tmuxp.cli.debug_info:command_debug_info
25-
:prog: tmuxp debug-info
26-
:commands: debug-info
27-
:nested: full
28-
```

docs/cli/edit.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
(edit-config)=
22

3+
(cli-edit)=
4+
35
# tmuxp edit
46

57
```{eval-rst}
6-
.. click:: tmuxp.cli.edit:command_edit
7-
:prog: tmuxp edit
8-
:commands: edit
9-
:nested: full
8+
.. argparse::
9+
:module: tmuxp.cli
10+
:func: create_parser
11+
:prog: tmuxp
12+
:path: edit
1013
```

docs/cli/freeze.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
(cli-freeze)=
22

3+
(cli-freeze-reference)=
4+
35
# tmuxp freeze
46

7+
```{eval-rst}
8+
.. argparse::
9+
:module: tmuxp.cli
10+
:func: create_parser
11+
:prog: tmuxp
12+
:path: freeze
13+
```
14+
15+
## Usage
16+
517
Freeze sessions
618

719
```console
@@ -23,12 +35,3 @@ Tmuxp will offer to save your session state to `.json` or `.yaml`.
2335
If no session is specified, it will default to the attached session.
2436

2537
If the `--force` argument is passed, it will overwrite any existing config file with the same name.
26-
27-
(cli-freeze-reference)=
28-
29-
```{eval-rst}
30-
.. click:: tmuxp.cli.freeze:command_freeze
31-
:prog: tmuxp freeze
32-
:commands: freeze
33-
:nested: full
34-
```

docs/cli/import.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
## From teamocil
88

99
```{eval-rst}
10-
.. click:: tmuxp.cli.import_config:command_import_teamocil
11-
:prog: tmuxp import teamocil
12-
:nested: full
10+
.. argparse::
11+
:module: tmuxp.cli
12+
:func: create_parser
13+
:prog: tmuxp
14+
:path: import teamocil
1315
```
1416

1517
````{tab} YAML
@@ -33,9 +35,11 @@ $ tmuxp import teamocil /path/to/file.json
3335
## From tmuxinator
3436

3537
```{eval-rst}
36-
.. click:: tmuxp.cli.import_config:command_import_tmuxinator
37-
:prog: tmuxp import tmuxinator
38-
:nested: short
38+
.. argparse::
39+
:module: tmuxp.cli
40+
:func: create_parser
41+
:prog: tmuxp
42+
:path: import tmuxinator
3943
```
4044

4145
````{tab} YAML

docs/cli/index.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ debug-info
3232
3333
```
3434

35-
```{toctree}
36-
:caption: More
37-
:maxdepth: 1
35+
(cli-main)=
36+
37+
(tmuxp-main)=
38+
39+
## Command: `tmuxp`
40+
41+
```{eval-rst}
42+
.. argparse::
43+
:module: tmuxp.cli
44+
:func: create_parser
45+
:prog: tmuxp
46+
:nosubcommands:
3847
39-
completion
48+
subparser_name : @replace
49+
See :ref:`cli-ls`
4050
```

docs/cli/load.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@
22

33
(tmuxp-load)=
44

5+
(tmuxp-load-reference)=
6+
57
# tmuxp load
68

9+
```{eval-rst}
10+
.. argparse::
11+
:module: tmuxp.cli
12+
:func: create_parser
13+
:prog: tmuxp
14+
:path: load
15+
```
16+
17+
## Usage
18+
719
You can load your tmuxp file and attach the vim session via a few
820
shorthands:
921

@@ -136,14 +148,3 @@ $ tmuxp load [filename] --log-file [log_filename]
136148
```console
137149
$ tmuxp --log-level [LEVEL] load [filename] --log-file [log_filename]
138150
```
139-
140-
## Reference
141-
142-
(tmuxp-load-reference)=
143-
144-
```{eval-rst}
145-
.. click:: tmuxp.cli.load:command_load
146-
:prog: tmuxp load
147-
:commands: load
148-
:nested: full
149-
```

docs/cli/ls.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
(cli-ls)=
2+
13
(ls-config)=
24

35
# tmuxp ls
46

7+
List sesssions.
8+
59
```{eval-rst}
6-
.. click:: tmuxp.cli.ls:command_ls
7-
:prog: tmuxp ls
8-
:commands: ls
9-
:nested: full
10+
.. argparse::
11+
:module: tmuxp.cli
12+
:func: create_parser
13+
:prog: tmuxp
14+
:path: ls
1015
```

docs/cli/shell.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
(cli-shell)=
22

3+
(tmuxp-shell)=
4+
35
# tmuxp shell
46

57
```{eval-rst}
6-
.. click:: tmuxp.cli.shell:command_shell
7-
:prog: tmuxp shell
8-
:commands: shell
9-
:nested: none
8+
.. argparse::
9+
:module: tmuxp.cli
10+
:func: create_parser
11+
:prog: tmuxp
12+
:path: shell
1013
```
1114

1215
## Directly enter commands
@@ -15,8 +18,6 @@
1518
$ tmuxp shell -c 'python code'
1619
```
1720

18-
## Example
19-
2021
```{image} ../_static/tmuxp-shell.gif
2122
:width: 100%
2223
```

0 commit comments

Comments
 (0)