{ "no-legend", no_argument, NULL, ARG_NO_LEGEND },
{ "output", required_argument, NULL, 'o' },
{ "field", required_argument, NULL, 'F' },
- { NULL, 0, NULL, 0 }
+ {}
};
assert(argc >= 0);
while ((c = getopt_long(argc, argv, "ho:F:", options, NULL)) >= 0)
switch(c) {
+
case 'h':
- help();
arg_action = ACTION_NONE;
- return 0;
+ return help();
case ARG_VERSION:
+ arg_action = ACTION_NONE;
puts(PACKAGE_STRING);
puts(SYSTEMD_FEATURES);
- arg_action = ACTION_NONE;
return 0;
case ARG_NO_PAGER:
return -EINVAL;
default:
- log_error("Unknown option code %c", c);
- return -EINVAL;
+ assert_not_reached("Unhandled option");
}
if (optind < argc) {
assert(j);
/* The coredumps are likely to compressed, and for just
- * listing them we don#t need to decompress them, so let's
+ * listing them we don't need to decompress them, so let's
* pick a fairly low data threshold here */
sd_journal_set_data_threshold(j, 4096);
sz = write(fd, data, len);
if (sz < 0) {
- log_error("Failed to write temporary file: %s", strerror(errno));
+ log_error("Failed to write temporary file: %m");
r = -errno;
goto finish;
}
}
}
+ if (_unlikely_(log_get_max_level() >= LOG_PRI(LOG_DEBUG))) {
+ _cleanup_free_ char *filter;
+
+ filter = journal_make_match_string(j);
+ log_debug("Journal filter: %s", filter);
+ }
+
switch(arg_action) {
case ACTION_LIST: