/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2010 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.
This program is Free Software; you can redistribute it and/or
- modify it under the terms of version two of the GNU General Public
+ modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*
* Kern Sibbald, September MM
*
- * Version $Id$
*/
#include "bacula.h"
} else if (stat == 0) { /* timeout */
if (strcmp(prompt, "*") == 0) {
tid = start_bsock_timer(UA_sock, timeout);
- bnet_fsend(UA_sock, ".messages");
+ UA_sock->fsend(".messages");
stop_bsock_timer(tid);
} else {
continue;
}
} else {
- at_prompt = FALSE;
+ at_prompt = false;
/* @ => internal command for us */
if (UA_sock->msg[0] == '@') {
parse_args(UA_sock->msg, &args, &argc, argk, argv, MAX_CMD_ARGS);
continue;
}
tid = start_bsock_timer(UA_sock, timeout);
- if (!bnet_send(UA_sock)) { /* send command */
+ if (!UA_sock->send()) { /* send command */
stop_bsock_timer(tid);
break; /* error */
}
break;
}
tid = start_bsock_timer(UA_sock, timeout);
- while ((stat = bnet_recv(UA_sock)) >= 0) {
+ while ((stat = UA_sock->recv()) >= 0) {
if (at_prompt) {
if (!stop) {
sendit("\n");
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));
{"schedule=", ".schedule" },
{"volume=", ".media" },
{"oldvolume=", ".media" },
- {"volstatus=", ".volstatus" }
+ {"volstatus=", ".volstatus" },
+ {"ls", ".ls" },
+ {"cd", ".lsdir" },
+ {"mark", ".ls" },
+ {"m", ".ls" },
+ {"unmark", ".lsmark" },
+ {"actiononpurge=", ".actiononpurge" }
};
#define key_size ((int)(sizeof(cpl_keywords)/sizeof(struct cpl_keywords_t)))
matches = (char **)NULL;
/* If this word is at the start of the line, then it is a command
- to complete. Otherwise it is the name of a file in the current
- directory. */
+ * to complete. Otherwise it is the name of a file in the current
+ * directory.
+ */
s = get_previous_keyword(start, 0);
cmd = get_first_keyword();
if (s) {
rl_completion_entry_function = dummy_completion_function;
rl_attempted_completion_function = readline_completion;
rl_filename_completion_desired = 0;
+ stifle_history(100);
#endif
return ret;