- if (session_name == NULL) {
- ret = get_default_session_name(&session_name);
- if (ret < 0 || session_name == NULL) {
+
+ opt_session_name = (char *) poptGetArg(pc);
+
+ if (opt_session_name == NULL) {
+ /* No session name specified, lookup default */
+ session_name = get_session_name();
+ if (session_name == NULL) {
+ ret = CMD_ERROR;