Skip to content

Commit

Permalink
CLI: Unify help of verdi process commands
Browse files Browse the repository at this point in the history
The `verdi process` commands pause, play, kill, wait, show, status,
report, call-root had inconsistent help messages so we unified them.
  • Loading branch information
agoscinski authored and sphuber committed Jun 7, 2024
1 parent 72692fa commit d91e0a5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
12 changes: 6 additions & 6 deletions docs/source/reference/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,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 of processes.
dump Dump process input and output files to disk.
kill Kill running processes.
list Show a list of running or terminated processes.
list Show a list of processes.
pause Pause running processes.
play Play (unpause) paused processes.
repair Automatically repair all stuck processes.
report Show the log report for one or multiple processes.
show Show details for one or multiple processes.
status Print the status of one or multiple processes.
watch Watch the state transitions for a process.
report Show the log report of processes.
show Show details of processes.
status Show the status of processes.
watch Watch the state transitions of processes.
.. _reference:command-line:verdi-profile:
Expand Down
36 changes: 26 additions & 10 deletions src/aiida/cmdline/commands/cmd_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def process_list(
order_by,
order_dir,
):
"""Show a list of running or terminated processes.
"""Show a list of processes.
By default, only those that are still running are shown, but there are options to show also the finished ones.
By default, only processes that are still running are shown, but there are options to show also the finished ones.
"""
from tabulate import tabulate

Expand Down Expand Up @@ -185,7 +185,9 @@ def process_list(
@options.MOST_RECENT_NODE()
@decorators.with_dbenv()
def process_show(processes, most_recent_node):
"""Show details for one or multiple processes."""
"""Show details of processes.
Show details for one or multiple processes."""
from aiida.cmdline.utils.common import get_node_info

if not processes and not most_recent_node:
Expand All @@ -210,7 +212,9 @@ def process_show(processes, most_recent_node):
@arguments.PROCESSES()
@decorators.with_dbenv()
def process_call_root(processes):
"""Show root process of the call stack for the given processes."""
"""Show root process of processes.
Show root process(es) of the call stack for one or multiple processes."""
if not processes:
raise click.UsageError('Please specify one or multiple processes by their identifier (PK, UUID or label).')
for process in processes:
Expand Down Expand Up @@ -247,7 +251,9 @@ def process_call_root(processes):
)
@decorators.with_dbenv()
def process_report(processes, most_recent_node, levelname, indent_size, max_depth):
"""Show the log report for one or multiple processes."""
"""Show the log report of processes.
Show the log report for one or multiple processes."""
from aiida.cmdline.utils.common import get_calcjob_report, get_process_function_report, get_workchain_report
from aiida.orm import CalcFunctionNode, CalcJobNode, WorkChainNode, WorkFunctionNode

Expand Down Expand Up @@ -284,7 +290,9 @@ def process_report(processes, most_recent_node, levelname, indent_size, max_dept
)
@arguments.PROCESSES()
def process_status(call_link_label, most_recent_node, max_depth, processes):
"""Print the status of one or multiple processes."""
"""Show the status of processes.
Show the status of one or multiple processes."""
from aiida.cmdline.utils.ascii_vis import format_call_graph

if not processes and not most_recent_node:
Expand Down Expand Up @@ -313,7 +321,9 @@ def process_status(call_link_label, most_recent_node, max_depth, processes):
@options.WAIT()
@decorators.with_dbenv()
def process_kill(processes, all_entries, timeout, wait):
"""Kill running processes."""
"""Kill running processes.
Kill one or multiple running processes."""
from aiida.engine.processes import control

if not processes and not all_entries:
Expand Down Expand Up @@ -345,7 +355,9 @@ def process_kill(processes, all_entries, timeout, wait):
@options.WAIT()
@decorators.with_dbenv()
def process_pause(processes, all_entries, timeout, wait):
"""Pause running processes."""
"""Pause running processes.
Pause one or multiple running processes."""
from aiida.engine.processes import control

if not processes and not all_entries:
Expand Down Expand Up @@ -374,7 +386,9 @@ def process_pause(processes, all_entries, timeout, wait):
@options.WAIT()
@decorators.with_dbenv()
def process_play(processes, all_entries, timeout, wait):
"""Play (unpause) paused processes."""
"""Play (unpause) paused processes.
Play (unpause) one or multiple paused processes."""
from aiida.engine.processes import control

if not processes and not all_entries:
Expand Down Expand Up @@ -402,7 +416,9 @@ def process_play(processes, all_entries, timeout, wait):
@decorators.with_broker
@decorators.only_if_daemon_running(echo.echo_warning, 'daemon is not running, so process may not be reachable')
def process_watch(broker, processes, most_recent_node):
"""Watch the state transitions for a process."""
"""Watch the state transitions of processes.
Watch the state transitions for one or multiple running processes."""

if not processes and not most_recent_node:
raise click.UsageError(
Expand Down

0 comments on commit d91e0a5

Please sign in to comment.