osb/source/base/StarVersionOptionParser.hpp

25 lines
654 B
C++
Raw Permalink Normal View History

#pragma once
2023-06-20 04:33:09 +00:00
#include "StarOptionParser.hpp"
#include "StarVersion.hpp"
namespace Star {
// Option parser that accepts -h to print the help and exit and -v to print the
// version and exit.
class VersionOptionParser : public OptionParser {
public:
static void printVersion(std::ostream& os);
VersionOptionParser();
// Parse the command line options, or, in the case of an error, -h, or -v,
// prints the appropriate text and immediately exits.
Options parseOrDie(StringList const& cmdLineArguments) const;
// First sets the command name based on argv[0], then calls parseOrDie.
Options commandParseOrDie(int argc, char** argv);
};
}