/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
*
* Kern Sibbald, September MM
*
- * Version $Id$
*/
#include "bacula.h"
if (is_bnet_stop(UA_sock)) {
break; /* error or term */
} else if (stat == BNET_SIGNAL) {
- if (UA_sock->msglen == BNET_PROMPT) {
+ if (UA_sock->msglen == BNET_SUB_PROMPT) {
at_prompt = true;
}
Dmsg1(100, "Got poll %s\n", bnet_sig_to_ascii(UA_sock));
typedef enum
{
- ITEM_ARG, /* item with simple list like .job */
+ ITEM_ARG, /* item with simple list like .jobs */
ITEM_HELP /* use help item=xxx and detect all arguments */
} cpl_item_t;
{"pool=", ".pool" },
{"fileset=", ".fileset" },
{"client=", ".client" },
- {"job=", ".job" },
+ {"job=", ".jobs" },
+ {"restorejob=",".jobs type=R" },
{"level=", ".level" },
{"storage=", ".storage" },
{"schedule=", ".schedule" },
{"mark", ".ls" },
{"m", ".ls" },
{"unmark", ".lsmark" },
+ {"catalog=", ".catalogs" },
{"actiononpurge=", ".actiononpurge" }
};
#define key_size ((int)(sizeof(cpl_keywords)/sizeof(struct cpl_keywords_t)))
return 1;
}
+/*
+ * Return 1 if OK
+ * 0 if no input
+ * -1 error (must stop)
+ */
int
get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec)
{
*/
line = readline((char *)prompt); /* cast needed for old readlines */
if (!line) {
- exit(1);
+ return -1; /* error return and exit */
}
strip_trailing_junk(line);
command = line;
sendit(_("Command logic problem\n"));
sock->msglen = 0;
sock->msg[0] = 0;
- return 0;
+ return 0; /* No input */
}
/*
actuallyfree(line); /* allocated by readline() malloc */
line = NULL;
}
- return 1;
+ return 1; /* OK */
}
#else /* no readline, do it ourselves */
int ret=0;
#ifdef HAVE_READLINE
-/* first, try to truncate the history file, and if it
- * fail, the file is probably not present, and we
+/*
+ * first, try to truncate the history file, and if it
+ * fails, the file is probably not present, and we
* can use write_history to create it
*/
} else {
ret = write_history(histfile);
}
-
#endif
return ret;
int ret=0;
#ifdef HAVE_READLINE
-
using_history();
ret = read_history(histfile);
/* Tell the completer that we want a complete . */