Fix: allow loading session file with -i option
authorDavid Goulet <dgoulet@efficios.com>
Wed, 26 Mar 2014 15:31:23 +0000 (11:31 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 26 Mar 2014 15:31:23 +0000 (11:31 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/load.c

index 711ac04216383c42ef44e887a8472f6f6022ded6..e732baa80e9f1200fc4e1994f94533d77c718b6e 100644 (file)
@@ -97,12 +97,9 @@ int cmd_load(int argc, const char **argv)
 
        if (!opt_load_all) {
                session_name = poptGetArg(pc);
-               if (!session_name) {
-                       ERR("A session name must be provided if the \"all\" option is not used.");
-                       ret = CMD_ERROR;
-                       goto end;
+               if (session_name) {
+                       DBG2("Loading session name: %s", session_name);
                }
-               DBG2("Loading session name: %s", session_name);
        }
 
        ret = config_load_session(opt_input_path, session_name, opt_force);
@@ -112,8 +109,10 @@ int cmd_load(int argc, const char **argv)
        } else {
                if (opt_load_all) {
                        MSG("All sessions have been loaded successfully");
-               } else {
+               } else if (session_name) {
                        MSG("Session %s has been loaded successfully", session_name);
+               } else {
+                       MSG("Session has been loaded successfully");
                }
        }
 end:
This page took 0.025813 seconds and 4 git commands to generate.