1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#ifndef WSCLEAN_COMMAND_LINE_H
#define WSCLEAN_COMMAND_LINE_H
#include <string>
#include <cstring>
#include "settings.h"
namespace wsclean {
class CommandLine {
public:
/**
* Initialize wsclean from the given command line options
* @returns @c true when parameters indicate wsclean should
* be run, @c false e.g. when this is a dry run.
*/
static bool Parse(class WSClean& wsclean, int argc, const char* argv[],
bool isSlave) {
bool fullRun = ParseWithoutValidation(wsclean, argc, argv, isSlave);
if (fullRun) Validate(wsclean);
return fullRun;
}
/**
* Initialize wsclean from the given command line options, but
* do only limitted validation of the parameters. This is useful
* when the logging needs to be set up before further validation
* is done, as is used in distributed/wsclean-mp.cpp.
* Otherwise similar to @ref Parse().
*/
static bool ParseWithoutValidation(class WSClean& wsclean, int argc,
const char* argv[], bool isSlave);
/**
* Finish a call to ParseWithoutValidation().
*/
static void Validate(class WSClean& wsclean);
static void Run(class WSClean& wsclean);
};
} // namespace wsclean
#endif
|