cpp-project-template 0.0.1.0
C++ Project Template
Loading...
Searching...
No Matches
UserOpt.hpp
Go to the documentation of this file.
1
6
7#ifndef CPP_PROJ_USEROPT_HPP
8#define CPP_PROJ_USEROPT_HPP
9
10#include <span>
11#include <string_view>
12
16namespace cpp_proj
17{
18
23inline std::string_view
24 progName; // NOLINT: Yes, I know that global variables should
25 // be constant (whenever possible) and carefully used.
26 // In this case it should be fine.
27
33void parseUserOptions(const std::span<char*>& args);
34
38void printHelp();
42void printVersion();
46[[noreturn]] void printHelpAndExit();
50[[noreturn]] void printVersionAndExit();
51
52} // namespace cpp_proj
53
54#endif
Namespace for this application.
Definition UserOpt.cpp:12
std::string_view progName
This application's executable name, to be set at the start of the main function.
Definition UserOpt.hpp:24
void printHelp()
Print the usage of the application.
Definition UserOpt.cpp:14
void printVersionAndExit()
Calls cpp_proj::printVersion and exits with success.
Definition UserOpt.cpp:37
void parseUserOptions(const std::span< char * > &args)
Gets the user options from the command line.
Definition UserOpt.cpp:43
void printHelpAndExit()
Calls cpp_proj::printHelp and exits with success.
Definition UserOpt.cpp:31
void printVersion()
Print the version of the application.
Definition UserOpt.cpp:22