src/dird/ua_cmds.c
static int cloud_cmd(UAContext *ua, const char *cmd)
{
   for (int i=0; i<ua->argc; i++) {
      if (strcasecmp(ua->argk[i], NT_("upload")) == 0) {
         return cloud_volumes_cmd(ua, cmd, "upload");

      } else if (strcasecmp(ua->argk[i], NT_("list")) == 0) {
         return cloud_list_cmd(ua, cmd);

      } else if (strcasecmp(ua->argk[i], NT_("truncate")) == 0) {
         return cloud_volumes_cmd(ua, cmd, "truncate cache");

      } else if (strcasecmp(ua->argk[i], NT_("status")) == 0) {

      } else if (strcasecmp(ua->argk[i], NT_("prune")) == 0) {
         return cloud_volumes_cmd(ua, cmd, "prunecache");

      } else {
         continue;
      }
   }

   for ( ;; ) {

      start_prompt(ua, _("Cloud choice: \n"));
      add_prompt(ua, _("List Cloud Volumes in the Cloud"));
      add_prompt(ua, _("Upload a Volume to the Cloud"));
      add_prompt(ua, _("Prune the Cloud Cache"));
      add_prompt(ua, _("Truncate a Volume Cache"));
      add_prompt(ua, _("Done"));

      switch(do_prompt(ua, "", _("Select action to perform on Cloud"), NULL, 0)) {
      case 0:                   /* list cloud */
         cloud_list_cmd(ua, cmd);
         break;
      case 1:                   /* upload */
         cloud_volumes_cmd(ua, cmd, "upload");
         break;
      case 2:                   /* Prune cache */
         cloud_volumes_cmd(ua, cmd, "prunecache");
         break;
      case 3:                   /* Truncate cache */
         cloud_volumes_cmd(ua, cmd, "truncate cache");
         break;
      default:
         ua->info_msg(_("Selection terminated.\n"));
         return 1;
      }
   }
   return 1;
}
/* Ask client to create/prune/delete a snapshot via the command line */
Ask client to create/prune/delete a snapshot via the command line
Ask client to create / prune / delete a snapshot via the command line
static int cloud_cmd(UAContext *ua, const char *cmd)
{
   for (int i=0; i<ua->argc; i++) {
      if (strcasecmp(ua->argk[i], NT_("upload")) == 0) {
         return cloud_volumes_cmd(ua, cmd, "upload");
      } else if (strcasecmp(ua->argk[i], NT_("list")) == 0) {
         return cloud_list_cmd(ua, cmd);
      } else if (strcasecmp(ua->argk[i], NT_("truncate")) == 0) {
         return cloud_volumes_cmd(ua, cmd, "truncate cache");
      } else if (strcasecmp(ua->argk[i], NT_("status")) == 0) {
      } else if (strcasecmp(ua->argk[i], NT_("prune")) == 0) {
         return cloud_volumes_cmd(ua, cmd, "prunecache");
      } else {
         continue;
      }
   }
   for ( ;; ) {
      start_prompt(ua, _("Cloud choice: \n"));
      add_prompt(ua, _("List Cloud Volumes in the Cloud"));
      add_prompt(ua, _("Upload a Volume to the Cloud"));
      add_prompt(ua, _("Prune the Cloud Cache"));
      add_prompt(ua, _("Truncate a Volume Cache"));
      add_prompt(ua, _("Done"));
      switch(do_prompt(ua, "", _("Select action to perform on Cloud"), NULL, 0)) {
      case 0:                   
         cloud_list_cmd(ua, cmd);
         break;
      case 1:                   
         cloud_volumes_cmd(ua, cmd, "upload");
         break;
      case 2:                   
         cloud_volumes_cmd(ua, cmd, "prunecache");
         break;
      case 3:                   
         cloud_volumes_cmd(ua, cmd, "truncate cache");
         break;
      default:
         ua->info_msg(_("Selection terminated.\n"));
         return 1;
      }
   }
   return 1;
}
static int cloud_cmd ( UAContext * ua , const char * cmd ) { for ( int i = 0 ; i < ua -> argc ; i ++ ) { if ( strcasecmp ( ua -> argk [ i ] , NT_ ( " " ) ) == 0 ) { return cloud_volumes_cmd ( ua , cmd , " " ) ; } else if ( strcasecmp ( ua -> argk [ i ] , NT_ ( " " ) ) == 0 ) { return cloud_list_cmd ( ua , cmd ) ; } else if ( strcasecmp ( ua -> argk [ i ] , NT_ ( " " ) ) == 0 ) { return cloud_volumes_cmd ( ua , cmd , " " ) ; } else if ( strcasecmp ( ua -> argk [ i ] , NT_ ( " " ) ) == 0 ) { } else if ( strcasecmp ( ua -> argk [ i ] , NT_ ( " " ) ) == 0 ) { return cloud_volumes_cmd ( ua , cmd , " " ) ; } else { continue ; } } for ( ; ; ) { start_prompt ( ua , _ ( " \n " ) ) ; add_prompt ( ua , _ ( " " ) ) ; add_prompt ( ua , _ ( " " ) ) ; add_prompt ( ua , _ ( " " ) ) ; add_prompt ( ua , _ ( " " ) ) ; add_prompt ( ua , _ ( " " ) ) ; switch ( do_prompt ( ua , " " , _ ( " " ) , NULL , 0 ) ) { case 0 : cloud_list_cmd ( ua , cmd ) ; break ; case 1 : cloud_volumes_cmd ( ua , cmd , " " ) ; break ; case 2 : cloud_volumes_cmd ( ua , cmd , " " ) ; break ; case 3 : cloud_volumes_cmd ( ua , cmd , " " ) ; break ; default : ua -> info_msg ( _ ( " \n " ) ) ; return 1 ; } } return 1 ; }
Ask client to create/prune/delete a snapshot via the command line
Ask client to create / prune / delete a snapshot via the command line
/* list cloud */ /* upload */ /* Prune cache */ /* Truncate cache */