Unverified Commit 1983b979 authored by gsn9's avatar gsn9 Committed by GitHub
Browse files

Cli last (#4884)

* added needed file for kaguyaTC tests

* added function to create a new command line

* fixed buildNewCommandLine func and addressed feedback

* fixed whitespace

* fixed whitespace

* temp commit

* fixed cli last issue

* removed old function

* fixed feedback
parent f3b8d4dd
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -518,6 +518,11 @@ namespace Isis {
      }

    }
    if(usedDashLast == true){
      Pvl temp;
      CommandLine(temp);
      cout << BuildNewCommandLineFromPvl(temp) << endl;
    }

    // Can't use the batchlist with the gui, save, last or restore option
    if ( BatchListSize() != 0 && (p_interactive || usedDashLast || p_saveFile != ""
@@ -535,7 +540,20 @@ namespace Isis {
    }
  }

  QString UserInterface::BuildNewCommandLineFromPvl(Pvl temp){
    PvlGroup group = temp.group(0);
    int numKeywords = group.keywords();
    QString returnVal = ""; 

    for(int i = 0; i < numKeywords; i++){
      PvlKeyword key = group[i];
      returnVal += key.name();
      returnVal += "=";
      returnVal += QString(key);
      returnVal += " ";
    }
    return returnVal;
  }
  /**
   * Loads the previous history for the program
   *
@@ -591,7 +609,6 @@ namespace Isis {
            }
          }

          cout << commandline << endl;
          return;
        }

+3 −0
Original line number Diff line number Diff line
@@ -191,11 +191,14 @@ namespace Isis {
      QString GetInfoFileName();
      bool GetInfoFlag();

      QString BuildNewCommandLineFromPvl(Pvl temp);

      void SetBatchList(int i);
      void SetErrorList(int i);

      void SaveHistory();


    private:
      void loadBatchList(const QString file);
      void loadCommandLine(QVector<QString> &args, bool ignoreAppName=true);