Skip to content

Commit eb18c97

Browse files
committed
CLI doc updates
1 parent 56fda40 commit eb18c97

File tree

2 files changed

+26
-38
lines changed

2 files changed

+26
-38
lines changed

doc/cli.rst

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,43 @@ Command Line Interface
99
Freeze sessions
1010
"""""""""""""""
1111

12-
You can save the state of your tmux session by freezing it.
12+
.. argparse::
13+
:module: tmuxp.cli
14+
:func: get_parser
15+
:prog: tmuxp
16+
:path: freeze
1317

14-
.. code-block:: bash
1518

16-
$ tmuxp freeze <session-name>
19+
You can save the state of your tmux session by freezing it.
1720

18-
Tmuxp will offer to save your session state to ``.json`` or ``.yaml``.
21+
Tmuxp will offer to save your session state to ``.json`` or ``.yaml``.
1922

2023
.. _cli_load:
2124

2225
Load session
2326
""""""""""""
2427

25-
Keep your configs in ``$HOME/.tmuxp`` for easy access and detection by
26-
:ref:`bash_completion`.
28+
.. argparse::
29+
:module: tmuxp.cli
30+
:func: get_parser
31+
:prog: tmuxp
32+
:path: load
33+
34+
Keep your configs in ``$HOME/.tmuxp`` for easy access and detection by
35+
:ref:`bash_completion`.
2736

28-
Files also may be loaded by absolute path.
37+
Files also may be loaded by absolute path.
2938

30-
.. code-block:: bash
39+
.. code-block:: bash
3140
32-
$ tmuxp load <filename>
41+
$ tmuxp load <filename>
3342
34-
Files named ``.tmuxp.yaml`` or ``.tmuxp.json`` in the current working
35-
directory may be loaded with:
43+
Files named ``.tmuxp.yaml`` or ``.tmuxp.json`` in the current working
44+
directory may be loaded with:
3645

37-
.. code-block:: bash
46+
.. code-block:: bash
3847
39-
$ tmuxp load .
48+
$ tmuxp load .
4049
4150
.. _cli_import:
4251

tmuxp/cli.py

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,6 @@ def command_kill_session(args):
689689
def get_parser():
690690
"""Return :py:class:`argparse.ArgumentParser` instance for CLI."""
691691

692-
693-
694692
server_parser = argparse.ArgumentParser(add_help=False)
695693

696694
server_parser.add_argument(
@@ -717,9 +715,8 @@ def get_parser():
717715
)
718716

719717
parser = argparse.ArgumentParser(
720-
description='''\
721-
Launch tmux workspace. Help documentation: <http://tmuxp.rtfd.org>.
722-
''',
718+
description='Launch tmux workspace. '
719+
'Help documentation: <http://tmuxp.rtfd.org>.',
723720
parents=[server_parser]
724721
)
725722

@@ -811,18 +808,7 @@ def get_parser():
811808
dest='config',
812809
type=str,
813810
nargs='?',
814-
help='''\
815-
List of config files to launch session from. Usage::
816-
817-
Load ~/.tmuxp/myproject.yaml::
818-
819-
$ tmuxp load myproject.yaml
820-
821-
Load $CWD/.tmuxp.yaml or $CWD/.tmuxp.json::
822-
823-
$ tmuxp .
824-
825-
'''
811+
help='List config available in working directory and config folder.'
826812
).completer = ConfigFileCompleter(allowednames=('.yaml', '.json'), directories=False)
827813
load.set_defaults(callback=command_load)
828814

@@ -835,14 +821,7 @@ def get_parser():
835821
dest='config',
836822
type=str,
837823
default=None,
838-
help='''\
839-
Check current working directory (%s) then $HOME/.tmuxp directory (%s).
840-
841-
$ tmuxp .
842-
843-
will check launch a ~/.pullv.yaml / ~/.pullv.json from the cwd.
844-
will also check for any ./*.yaml and ./*.json.
845-
''' % (cwd_dir + '/', config_dir)
824+
help='Absolute or relative path to config file.'
846825
).completer = ConfigFileCompleter(allowednames=('.yaml', '.json'), directories=False)
847826

848827
convert.set_defaults(callback=command_convert)

0 commit comments

Comments
 (0)