Skip to content

Commit 6fa0cab

Browse files
committed
Fix short help strings and add a global help message
1 parent 0cc9430 commit 6fa0cab

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

tmuxp/cli.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ def reattach(session):
306306
@click.option('--log_level', default='INFO',
307307
help='Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)')
308308
def cli(log_level):
309+
"""Manage tmux sessions.
310+
311+
Pass the "--help" argument to any command to see detailed help.
312+
See detailed documentation and examples at http://tmuxp.readthedocs.io/en/latest/"""
309313
try:
310314
has_required_tmux_version()
311315
except exc.TmuxpException as e:
@@ -351,7 +355,9 @@ def startup(config_dir):
351355
@click.option('-S', 'socket_path', help='pass-through for tmux -L')
352356
@click.option('-L', 'socket_name', help='pass-through for tmux -L')
353357
def command_freeze(session_name, socket_name, socket_path):
354-
"""Write configuration for a snapshot of the current session into a tmuxp config."""
358+
"""Snapshot a session into a config.
359+
360+
If SESSION_NAME is provided, snapshot that session. Otherwise, use the current session."""
355361

356362
t = Server(
357363
socket_name=socket_name,
@@ -434,7 +440,7 @@ def command_freeze(session_name, socket_name, socket_path):
434440
sys.exit()
435441

436442

437-
@cli.command(name='load')
443+
@cli.command(name='load', short_help='Load tmuxp workspaces.')
438444
@click.pass_context
439445
@click.argument('config', click.Path(exists=True), nargs=-1,
440446
callback=resolve_config_argument)
@@ -502,6 +508,7 @@ def command_load(ctx, config, socket_name, socket_path, answer_yes,
502508

503509
@cli.group(name='import')
504510
def import_config_cmd():
511+
"""Import a teamocil/tmuxinator config."""
505512
pass
506513

507514

@@ -560,32 +567,32 @@ def import_config(configfile, importfunc):
560567
sys.exit()
561568

562569

563-
@import_config_cmd.command(name='teamocil')
570+
@import_config_cmd.command(name='teamocil', short_help='Convert and import a teamocil config.')
564571
@click.argument(
565572
'configfile', click.Path(exists=True), nargs=1,
566573
callback=_create_resolve_config_argument(get_teamocil_dir)
567574
)
568575
def command_import_teamocil(configfile):
569-
"""Import teamocil config to tmuxp format."""
576+
"""Convert a teamocil config from CONFIGFILE to tmuxp format and import it into tmuxp."""
570577

571578
import_config(configfile, config.import_teamocil)
572579

573580

574-
@import_config_cmd.command(name='tmuxinator')
581+
@import_config_cmd.command(name='tmuxinator', short_help='Convert and import a tmuxinator config.')
575582
@click.argument(
576583
'configfile', click.Path(exists=True), nargs=1,
577584
callback=_create_resolve_config_argument(get_tmuxinator_dir)
578585
)
579586
def command_import_tmuxinator(configfile):
580-
"""Import tmuxinator config to tmuxp format."""
587+
"""Convert a tmuxinator config from CONFIGFILE to tmuxp format and import it into tmuxp."""
581588
import_config(configfile, config.import_tmuxinator)
582589

583590

584591
@cli.command(name='convert')
585592
@click.argument('config', click.Path(exists=True), nargs=1,
586593
callback=resolve_config_argument)
587594
def command_convert(config):
588-
"""Convert tmuxp config to and from JSON and YAML."""
595+
"""Convert a tmuxp config between JSON and YAML."""
589596

590597
_, ext = os.path.splitext(config)
591598
if 'json' in ext:

0 commit comments

Comments
 (0)