chiark / gitweb /
clients: try to follow roughly the same order in --help texts for common options
[elogind.git] / src / analyze / analyze.c
index 3b793f6664aa8b54d5447f95f521bd45e6977367..4637424d628b4f33ff4ce9d43bf7cb39cfdccd99 100644 (file)
@@ -190,10 +190,8 @@ static int bus_parse_unit_info(sd_bus_message *message, struct unit_info *u) {
                                                          &u->job_id,
                                                          &u->job_type,
                                                          &u->job_path);
-        if (r < 0) {
-                log_error("Failed to parse message as unit_info.");
-                return -EIO;
-        }
+        if (r < 0)
+                return bus_log_parse_error(r);
 
         return r;
 }
@@ -230,6 +228,9 @@ static int bus_get_unit_property_strv(sd_bus *bus, const char *unit_path, const
                 }
         }
 
+        if (r < 0)
+                return bus_log_parse_error(r);
+
         return r;
 }
 
@@ -839,15 +840,13 @@ static int list_dependencies(sd_bus *bus, const char *name) {
                         &reply,
                         "s");
         if (r < 0) {
-                log_error("Failed to parse reply: %s", bus_error_message(&error, -r));
+                log_error("Failed to get ID: %s", bus_error_message(&error, -r));
                 return r;
         }
 
         r = sd_bus_message_read(reply, "s", &id);
-        if (r < 0) {
-                log_error("Failed to parse reply.");
-                return r;
-        }
+        if (r < 0)
+                return bus_log_parse_error(r);
 
         times = hashmap_get(unit_times_hashmap, id);
 
@@ -1085,6 +1084,7 @@ static int dot(sd_bus *bus, char* patterns[]) {
 
         return 0;
 }
+
 static int dump(sd_bus *bus, char **args) {
         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
@@ -1113,10 +1113,8 @@ static int dump(sd_bus *bus, char **args) {
         }
 
         r = sd_bus_message_read(reply, "s", &text);
-        if (r < 0) {
-                log_error("Failed to parse reply");
-                return r;
-        }
+        if (r < 0)
+                return bus_log_parse_error(r);
 
         fputs(text, stdout);
         return 0;
@@ -1159,6 +1157,7 @@ static int help(void) {
                "Process systemd profiling information.\n\n"
                "  -h --help               Show this help\n"
                "     --version            Show package version\n"
+               "     --no-pager           Do not pipe output into a pager\n"
                "     --system             Connect to system manager\n"
                "     --user               Connect to user manager\n"
                "  -H --host=[USER@]HOST   Operate on remote host\n"
@@ -1171,8 +1170,7 @@ static int help(void) {
                "     --fuzz=TIMESPAN      When printing the tree of the critical chain, print also\n"
                "                          services, which finished TIMESPAN earlier, than the\n"
                "                          latest in the branch. The unit of TIMESPAN is seconds\n"
-               "                          unless specified with a different unit, i.e. 50ms\n"
-               "     --no-pager           Do not pipe output into a pager\n\n"
+               "                          unless specified with a different unit, i.e. 50ms\n\n"
                "Commands:\n"
                "  time                    Print time spent in the kernel before reaching userspace\n"
                "  blame                   Print list of running units ordered by time to init\n"