Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/base/StarVersionOptionParser.hpp
blob: b2ed9e15bb43c0da66e6e6369611403f8bf6a441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#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);
};

}