66 Copyright (c) 2012 Scientific Computing and Imaging Institute,
77 University of Utah.
88
9-
9+
1010 Permission is hereby granted, free of charge, to any person obtaining a
1111 copy of this software and associated documentation files (the "Software"),
1212 to deal in the Software without restriction, including without limitation
@@ -57,14 +57,14 @@ class CommandLineParserInternal
5757 (" logfile,l" , po::value<std::string>(), " add output messages to a logfile--TODO" )
5858 (" interactive,i" , " interactive mode--TODO" )
5959 (" headless,x" , " disable GUI (Qt still needed, for now)" )
60- (" input-file" , po::value<std::string>(), " SCIRun Network Input File" )
60+ (" input-file" , po::value<std::vector<std:: string> >(), " SCIRun Network Input File" )
6161 (" script,s" , po::value<std::string>(), " SCIRun Python Script" )
6262 (" no_splash" , " Turn off splash screen" )
6363 (" verbose" , " Turn on debug log information" )
6464 (" threadMode" , po::value<std::string>(), " network execution threading mode--DEVELOPER USE ONLY" )
6565 (" reexecuteMode" , po::value<std::string>(), " network reexecution mode--DEVELOPER USE ONLY" )
6666 ;
67-
67+
6868 positional_.add (" input-file" , -1 );
6969 }
7070
@@ -91,7 +91,7 @@ class CommandLineParserInternal
9191 ostr << desc_;
9292 return ostr.str ();
9393 }
94-
94+
9595private:
9696 po::options_description desc_;
9797 po::positional_options_description positional_;
@@ -116,30 +116,30 @@ class ApplicationParametersImpl : public ApplicationParameters
116116 bool isRegressionMode,
117117 bool isVerboseMode) : help_(help), version_(version), executeNetwork_(executeNetwork),
118118 executeNetworkAndQuit_ (executeNetworkAndQuit), disableGui_(disableGui),
119- disableSplash_(disableSplash), isRegressionMode_(isRegressionMode), isVerboseMode_(isVerboseMode)
119+ disableSplash_(disableSplash), isRegressionMode_(isRegressionMode), isVerboseMode_(isVerboseMode)
120120 {}
121121 bool help_, version_, executeNetwork_, executeNetworkAndQuit_, disableGui_, disableSplash_, isRegressionMode_, isVerboseMode_;
122122 };
123123 ApplicationParametersImpl (
124124 const std::string& entireCommandLine,
125- const boost::optional <std::string>& inputFile ,
125+ std::vector <std::string>&& inputFiles ,
126126 const boost::optional<boost::filesystem::path>& pythonScriptFile,
127127 const boost::optional<boost::filesystem::path>& dataDirectory,
128128 const boost::optional<std::string>& threadMode,
129129 const boost::optional<std::string>& reexecuteMode,
130130 const Flags& flags
131131 ) : entireCommandLine_(entireCommandLine),
132- inputFile_(inputFile ), pythonScriptFile_(pythonScriptFile), dataDirectory_(dataDirectory),
132+ inputFiles_(inputFiles ), pythonScriptFile_(pythonScriptFile), dataDirectory_(dataDirectory),
133133 threadMode_(threadMode), reexecuteMode_(reexecuteMode),
134134 flags_(flags)
135135 {}
136136
137- virtual boost::optional <std::string> inputFile () const
137+ virtual const std::vector <std::string>& inputFiles () const
138138 {
139- return inputFile_ ;
139+ return inputFiles_ ;
140140 }
141141
142- virtual boost::optional<boost::filesystem::path> pythonScriptFile () const
142+ virtual boost::optional<boost::filesystem::path> pythonScriptFile () const
143143 {
144144 return pythonScriptFile_;
145145 }
@@ -173,7 +173,7 @@ class ApplicationParametersImpl : public ApplicationParameters
173173 {
174174 return flags_.disableGui_ ;
175175 }
176-
176+
177177 virtual bool disableSplash () const
178178 {
179179 return flags_.disableSplash_ ;
@@ -199,14 +199,14 @@ class ApplicationParametersImpl : public ApplicationParameters
199199 return reexecuteMode_;
200200 }
201201
202- virtual const std::string& entireCommandLine () const
202+ virtual const std::string& entireCommandLine () const
203203 {
204204 return entireCommandLine_;
205205 }
206206
207207private:
208208 std::string entireCommandLine_;
209- boost::optional <std::string> inputFile_ ;
209+ std::vector <std::string> inputFiles_ ;
210210 boost::optional<boost::filesystem::path> pythonScriptFile_;
211211 boost::optional<boost::filesystem::path> dataDirectory_;
212212 boost::optional<std::string> threadMode_, reexecuteMode_;
@@ -230,7 +230,7 @@ ApplicationParametersHandle CommandLineParser::parse(int argc, const char* argv[
230230 {
231231 auto parsed = impl_->parse (argc, argv);
232232 std::vector<std::string> cmdline (argv, argv + argc);
233- auto inputFile = parsed.count (" input-file" ) != 0 ? parsed[" input-file" ].as <std::string>() : boost::optional <std::string>();
233+ auto inputFiles = parsed.count (" input-file" ) != 0 ? parsed[" input-file" ].as <std::vector<std:: string>> () : std::vector <std::string>();
234234 auto pythonScriptFile = boost::optional<boost::filesystem::path>();
235235 if (parsed.count (" script" ) != 0 && !parsed[" script" ].empty () && !parsed[" script" ].defaulted ())
236236 {
@@ -245,7 +245,7 @@ ApplicationParametersHandle CommandLineParser::parse(int argc, const char* argv[
245245 auto reexecuteMode = parsed.count (" reexecuteMode" ) != 0 ? parsed[" reexecuteMode" ].as <std::string>() : boost::optional<std::string>();
246246 return boost::make_shared<ApplicationParametersImpl>
247247 (boost::algorithm::join (cmdline, " " ),
248- inputFile ,
248+ std::move (inputFiles) ,
249249 pythonScriptFile,
250250 dataDirectory,
251251 threadMode,
0 commit comments