local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local OPTS='-h --help --version --no-pager --no-legend -o --output -F --field -1
-r --reverse -S --since -U --until -D --directory -q --quiet --debugger
- -A --debugger-arguments --json -n'
+ -A --debugger-arguments --json -n --all'
local -A VERBS=(
[LIST]='list info'
'--debugger=[Use the given debugger]:debugger: _command_names -e' \
{-D,--directory=}'[Use the journal files in the specified dir]:directory: _directories' \
{-q,--quiet}'[Do not show info messages and privilege warning]' \
+ '--all[Look at all journal files instead of local ones]' \
'*::coredumpctl commands:_coredumpctl_commands'
static const char* arg_output = NULL;
static bool arg_reverse = false;
static bool arg_quiet = false;
+static bool arg_all = false;
STATIC_DESTRUCTOR_REGISTER(arg_debugger_args, strv_freep);
STATIC_DESTRUCTOR_REGISTER(arg_file, strv_freep);
if (r < 0)
return log_error_errno(r, "Failed to open journal files: %m");
} else {
- r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
+ r = sd_journal_open(&j, arg_all ? 0 : SD_JOURNAL_LOCAL_ONLY);
if (r < 0)
return log_error_errno(r, "Failed to open journal: %m");
}
" --file=PATH Use journal file\n"
" -D --directory=DIR Use journal files from directory\n\n"
" -q --quiet Do not show info messages and privilege warning\n"
+ " --all Look at all journal files instead of local ones\n"
"\nSee the %2$s for details.\n",
program_invocation_short_name,
link,
ARG_JSON,
ARG_DEBUGGER,
ARG_FILE,
+ ARG_ALL,
};
int c, r;
{ "until", required_argument, NULL, 'U' },
{ "quiet", no_argument, NULL, 'q' },
{ "json", required_argument, NULL, ARG_JSON },
+ { "all", no_argument, NULL, ARG_ALL },
{}
};
break;
+ case ARG_ALL:
+ arg_all = true;
+ break;
+
case '?':
return -EINVAL;