From 720f34084e5c508858aa7157d36312810f8ec2e9 Mon Sep 17 00:00:00 2001 From: Alexander Goscinski Date: Tue, 28 May 2024 18:05:44 +0200 Subject: [PATCH] CLI: Introduce short_help description to verid process commands Because the help description of the commands is abbreviated when running `verdi process`, we add a shorter help message for the commands pause, play, kill, wait, show, status, report, call-root. --- docs/source/reference/command_line.rst | 16 ++++++++-------- src/aiida/cmdline/commands/cmd_process.py | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/source/reference/command_line.rst b/docs/source/reference/command_line.rst index eb50bae0c0..839df08937 100644 --- a/docs/source/reference/command_line.rst +++ b/docs/source/reference/command_line.rst @@ -367,17 +367,17 @@ Below is a list with all available subcommands. --help Show this message and exit. Commands: - call-root Show root process of the call stack for the given processes. + call-root Show root process(es) of the call stack for the given process(es). dump Dump process input and output files to disk. - kill Kill one or multiple running processes given the primary key(s) (PK). + kill Kill the given process(es). list Show a list of running or terminated processes. - pause Pause one or multiple running processes given the primary key(s) (PK). - play Play (unpause) one or multiple paused processes given the primary key(s)... + pause Pause the given process(es). + play Play (unpause) the given process(es). repair Automatically repair all stuck processes. - report Show the log report for one or multiple processes given the primary... - show Show details for one or multiple processes given the primary key(s) (PK). - status Print the status of one or multiple processes given the primary key(s)... - watch Watch the state transitions for one or multiple running processes given... + report Show the log report for the process(es). + show Show details for the given process(es). + status Print the status of the given process(es). + watch Watch the state transitions of the given process(es). .. _reference:command-line:verdi-profile: diff --git a/src/aiida/cmdline/commands/cmd_process.py b/src/aiida/cmdline/commands/cmd_process.py index 8caefbddeb..4dcfb47a82 100644 --- a/src/aiida/cmdline/commands/cmd_process.py +++ b/src/aiida/cmdline/commands/cmd_process.py @@ -180,7 +180,7 @@ def process_list( echo.echo_report(f'Using {percent_load * 100:.0f}% of the available daemon worker slots.') -@verdi_process.command('show') +@verdi_process.command('show', short_help='Show details for the given process(es).') @arguments.PROCESSES() @options.MOST_RECENT_NODE() @decorators.with_dbenv() @@ -204,11 +204,11 @@ def process_show(processes, most_recent_node): echo.echo(get_node_info(process)) -@verdi_process.command('call-root') +@verdi_process.command('call-root', short_help='Show root process(es) of the call stack for the given process(es).') @arguments.PROCESSES() @decorators.with_dbenv() def process_call_root(processes): - """Show root process of the call stack for the given processes.""" + """Show root process(es) of the call stack for one or multiple processes given the primary key(s) (PK).""" if not (processes): raise click.BadArgumentUsage('Please specify process primary key(s) (PK).') @@ -230,7 +230,7 @@ def process_call_root(processes): echo.echo(f'{caller.pk}') -@verdi_process.command('report') +@verdi_process.command('report', short_help='Show the log report for the process(es).') @arguments.PROCESSES() @options.MOST_RECENT_NODE() @click.option('-i', '--indent-size', type=int, default=2, help='Set the number of spaces to indent each level by.') @@ -273,7 +273,7 @@ def process_report(processes, most_recent_node, levelname, indent_size, max_dept echo.echo(f'Nothing to show for node type {process.__class__}') -@verdi_process.command('status') +@verdi_process.command('status', short_help='Print the status of the given process(es).') @options.MOST_RECENT_NODE() @click.option('-c', '--call-link-label', 'call_link_label', is_flag=True, help='Include the call link label if set.') @click.option( @@ -301,7 +301,7 @@ def process_status(call_link_label, most_recent_node, max_depth, processes): echo.echo(graph) -@verdi_process.command('kill') +@verdi_process.command('kill', short_help='Kill the given process(es).') @arguments.PROCESSES() @options.ALL(help='Kill all processes if no specific processes are specified.') @options.TIMEOUT() @@ -331,7 +331,7 @@ def process_kill(processes, all_entries, timeout, wait): echo.echo_report(REPAIR_INSTRUCTIONS) -@verdi_process.command('pause') +@verdi_process.command('pause', short_help='Pause the given process(es).') @arguments.PROCESSES() @options.ALL(help='Pause all active processes if no specific processes are specified.') @options.TIMEOUT() @@ -358,7 +358,7 @@ def process_pause(processes, all_entries, timeout, wait): echo.echo_report(REPAIR_INSTRUCTIONS) -@verdi_process.command('play') +@verdi_process.command('play', short_help='Play (unpause) the given process(es).') @arguments.PROCESSES() @options.ALL(help='Play all paused processes if no specific processes are specified.') @options.TIMEOUT() @@ -384,7 +384,7 @@ def process_play(processes, all_entries, timeout, wait): echo.echo_report(REPAIR_INSTRUCTIONS) -@verdi_process.command('watch') +@verdi_process.command('watch', short_help='Watch the state transitions of the given process(es).') @arguments.PROCESSES() @options.MOST_RECENT_NODE() @decorators.with_dbenv()