Commit 43d51ef2 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

gnt-job list: Add option to include archived jobs



This provides a convenience option to include archived jobs in the
output list. It's equivalent to using “-o +archived”, but tab completion
is nicer.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 0422250e
......@@ -87,6 +87,9 @@ def ListJobs(opts, args):
"""
selected_fields = ParseFields(opts.output, _LIST_DEF_FIELDS)
if opts.archived and "archived" not in selected_fields:
selected_fields.append("archived")
fmtoverride = {
"status": (_FormatStatus, False),
"summary": (lambda value: ",".join(str(item) for item in value), False),
......@@ -387,12 +390,17 @@ _FINISHED_OPT = \
const=constants.JOBS_FINALIZED,
help="Show finished jobs only")
_ARCHIVED_OPT = \
cli_option("--archived", default=False,
action="store_true", dest="archived",
help="Include archived jobs in list (slow and expensive)")
commands = {
"list": (
ListJobs, [ArgJobId()],
[NOHDR_OPT, SEP_OPT, FIELDS_OPT, VERBOSE_OPT, FORCE_FILTER_OPT,
_PENDING_OPT, _RUNNING_OPT, _ERROR_OPT, _FINISHED_OPT],
_PENDING_OPT, _RUNNING_OPT, _ERROR_OPT, _FINISHED_OPT, _ARCHIVED_OPT],
"[job_id ...]",
"Lists the jobs and their status. The available fields can be shown"
" using the \"list-fields\" command (see the man page for details)."
......
......@@ -81,6 +81,9 @@ fields will be added to the default list. This allows one to quickly
see the default list plus a few other fields, instead of retyping
the entire list of fields.
To include archived jobs in the list the ``--archived`` option can be
used.
The following options can be used to show only specific jobs:
``--pending``
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment