]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_input.c
First cut of bat rerun a Job from Jobs Run
[bacula/bacula] / bacula / src / dird / ua_input.c
index ef081144df204041210f8553c84e1924454e24af..2b16f507433fc1e260febb4346fe5e8ae18faa66 100644 (file)
@@ -6,7 +6,7 @@
    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.
 
@@ -15,7 +15,7 @@
    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.
 
 /* Exported functions */
 
-int get_cmd(UAContext *ua, const char *prompt)
+/* 
+ * If subprompt is set, we send a BNET_SUB_PROMPT signal otherwise
+ *   send a BNET_TEXT_INPUT signal.
+ */
+int get_cmd(UAContext *ua, const char *prompt, bool subprompt)
 {
    BSOCK *sock = ua->UA_sock;
    int stat;
@@ -52,8 +56,13 @@ int get_cmd(UAContext *ua, const char *prompt)
    if (!sock || ua->batch) {          /* No UA or batch mode */
       return 0;
    }
+   if (!subprompt) {
+      sock->signal(BNET_TEXT_INPUT);
+   }
    sock->fsend("%s", prompt);
-   sock->signal(BNET_PROMPT);         /* request more input */
+   if (subprompt) {
+      sock->signal(BNET_SUB_PROMPT);
+   }
    for ( ;; ) {
       stat = sock->recv();
       if (stat == BNET_SIGNAL) {