static OutputMode arg_output = OUTPUT_SHORT;
static bool arg_pager_end = false;
static bool arg_follow = false;
-static bool arg_full = false;
+static bool arg_full = true;
static bool arg_all = false;
static bool arg_no_pager = false;
static int arg_lines = -1;
" -n --lines[=INTEGER] Number of journal entries to show\n"
" --no-tail Show all lines, even in follow mode\n"
" -r --reverse Show the newest entries first\n"
- " -o --output=STRING Change journal output mode (short, short-monotonic, short-iso\n"
- " verbose, export, json, json-pretty, json-sse, cat)\n"
+ " -o --output=STRING Change journal output mode (short, short-iso,\n"
+ " short-precise, short-monotonic, verbose,\n"
+ " export, json, json-pretty, json-sse, cat)\n"
" -x --catalog Add message explanations where available\n"
- " -l --full Do not ellipsize fields\n"
+ " --no-full Ellipsize fields\n"
" -a --all Show all fields, including long and unprintable\n"
" -q --quiet Don't show privilege warning\n"
" --no-pager Do not pipe output into a pager\n"
enum {
ARG_VERSION = 0x100,
ARG_NO_PAGER,
+ ARG_NO_FULL,
ARG_NO_TAIL,
ARG_NEW_ID128,
ARG_USER,
{ "output", required_argument, NULL, 'o' },
{ "all", no_argument, NULL, 'a' },
{ "full", no_argument, NULL, 'l' },
+ { "no-full", no_argument, NULL, ARG_NO_FULL },
{ "lines", optional_argument, NULL, 'n' },
{ "no-tail", no_argument, NULL, ARG_NO_TAIL },
{ "new-id128", no_argument, NULL, ARG_NEW_ID128 },
arg_full = true;
break;
+ case ARG_NO_FULL:
+ arg_full = false;
+ break;
+
case 'a':
arg_all = true;
break;
sd_journal_flush_matches(j);
}
- qsort(all_ids, count, sizeof(boot_id_t), boot_id_cmp);
+ qsort_safe(all_ids, count, sizeof(boot_id_t), boot_id_cmp);
if (sd_id128_equal(*boot_id, SD_ID128_NULL)) {
if (relative > (int) count || relative <= -(int)count)
int main(int argc, char *argv[]) {
int r;
- _cleanup_journal_close_ sd_journal*j = NULL;
+ _cleanup_journal_close_ sd_journal *j = NULL;
bool need_seek = false;
sd_id128_t previous_boot_id;
bool previous_boot_id_valid = false, first_line = true;
int n_shown = 0;
+ bool ellipsized = false;
setlocale(LC_ALL, "");
log_parse_environment();
flags =
arg_all * OUTPUT_SHOW_ALL |
- (arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
+ arg_full * OUTPUT_FULL_WIDTH |
on_tty() * OUTPUT_COLOR |
arg_catalog * OUTPUT_CATALOG;
- r = output_journal(stdout, j, arg_output, 0, flags);
+ r = output_journal(stdout, j, arg_output, 0, flags, &ellipsized);
need_seek = true;
if (r == -EADDRNOTAVAIL)
break;