chiark / gitweb /
journalctl: add option to forgo ellipsization
[elogind.git] / src / journal / journalctl.c
index 8f452dd92db77e6e0adca6c1f99b75891398b542..4d46beb3fe3cf0f71e6add9c283de41c95ce88a5 100644 (file)
@@ -57,6 +57,7 @@
 
 static OutputMode arg_output = OUTPUT_SHORT;
 static bool arg_follow = false;
 
 static OutputMode arg_output = OUTPUT_SHORT;
 static bool arg_follow = false;
+static bool arg_full = false;
 static bool arg_all = false;
 static bool arg_no_pager = false;
 static unsigned arg_lines = 0;
 static bool arg_all = false;
 static bool arg_no_pager = false;
 static unsigned arg_lines = 0;
@@ -105,6 +106,7 @@ static int help(void) {
                "  -o --output=STRING     Change journal output mode (short, short-monotonic,\n"
                "                         verbose, export, json, json-pretty, json-sse, cat)\n"
                "  -x --catalog           Add message explanations where available\n"
                "  -o --output=STRING     Change journal output mode (short, short-monotonic,\n"
                "                         verbose, export, json, json-pretty, json-sse, cat)\n"
                "  -x --catalog           Add message explanations where available\n"
+               "     --full              Do not 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"
                "  -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"
@@ -140,6 +142,7 @@ static int parse_argv(int argc, char *argv[]) {
                 ARG_NO_TAIL,
                 ARG_NEW_ID128,
                 ARG_HEADER,
                 ARG_NO_TAIL,
                 ARG_NEW_ID128,
                 ARG_HEADER,
+                ARG_FULL,
                 ARG_SETUP_KEYS,
                 ARG_INTERVAL,
                 ARG_VERIFY,
                 ARG_SETUP_KEYS,
                 ARG_INTERVAL,
                 ARG_VERIFY,
@@ -158,6 +161,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "follow",       no_argument,       NULL, 'f'              },
                 { "output",       required_argument, NULL, 'o'              },
                 { "all",          no_argument,       NULL, 'a'              },
                 { "follow",       no_argument,       NULL, 'f'              },
                 { "output",       required_argument, NULL, 'o'              },
                 { "all",          no_argument,       NULL, 'a'              },
+                { "full",         no_argument,       NULL, ARG_FULL         },
                 { "lines",        optional_argument, NULL, 'n'              },
                 { "no-tail",      no_argument,       NULL, ARG_NO_TAIL      },
                 { "new-id128",    no_argument,       NULL, ARG_NEW_ID128    },
                 { "lines",        optional_argument, NULL, 'n'              },
                 { "no-tail",      no_argument,       NULL, ARG_NO_TAIL      },
                 { "new-id128",    no_argument,       NULL, ARG_NEW_ID128    },
@@ -226,6 +230,10 @@ static int parse_argv(int argc, char *argv[]) {
 
                         break;
 
 
                         break;
 
+                case ARG_FULL:
+                        arg_full = true;
+                        break;
+
                 case 'a':
                         arg_all = true;
                         break;
                 case 'a':
                         arg_all = true;
                         break;
@@ -1065,7 +1073,7 @@ int main(int argc, char *argv[]) {
 
                         flags =
                                 arg_all * OUTPUT_SHOW_ALL |
 
                         flags =
                                 arg_all * OUTPUT_SHOW_ALL |
-                                (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
+                                (arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
                                 on_tty() * OUTPUT_COLOR |
                                 arg_catalog * OUTPUT_CATALOG;
 
                                 on_tty() * OUTPUT_COLOR |
                                 arg_catalog * OUTPUT_CATALOG;