Skip to content

Commit

Permalink
CLI: Introduce short_help description to verid process commands
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
agoscinski committed May 28, 2024
1 parent 57937fc commit 720f340
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions docs/source/reference/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 9 additions & 9 deletions src/aiida/cmdline/commands/cmd_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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).')

Expand All @@ -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.')
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 720f340

Please sign in to comment.