X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournalctl.c;h=275458c4821aabd30516f785a2f7dc37148c4b97;hb=1daf8121524246932b18be8dd7d63e792dee5de2;hp=27c148e689d7b32f1876a8228dd2fc9ecb1ca07f;hpb=f02d836794d519e717e51d81501557da55915ce2;p=elogind.git diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 27c148e68..275458c48 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -64,7 +64,7 @@ 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; @@ -138,7 +138,7 @@ static int help(void) { " 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" @@ -175,6 +175,7 @@ static int parse_argv(int argc, char *argv[]) { enum { ARG_VERSION = 0x100, ARG_NO_PAGER, + ARG_NO_FULL, ARG_NO_TAIL, ARG_NEW_ID128, ARG_USER, @@ -208,6 +209,7 @@ static int parse_argv(int argc, char *argv[]) { { "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 }, @@ -298,6 +300,10 @@ static int parse_argv(int argc, char *argv[]) { arg_full = true; break; + case ARG_NO_FULL: + arg_full = false; + break; + case 'a': arg_all = true; break; @@ -755,7 +761,7 @@ static int get_relative_boot_id(sd_journal *j, sd_id128_t *boot_id, int relative 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) @@ -1301,7 +1307,7 @@ static int access_check(sd_journal *j) { 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; @@ -1622,7 +1628,7 @@ int main(int argc, char *argv[]) { 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;