Merge pull request #142 from SunshineStream/update-help-argument

Update help argument
This commit is contained in:
ReenigneArcher 2022-04-29 13:06:28 -04:00 committed by GitHub
commit ceb7f5f41a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,24 +57,34 @@ struct NoDelete {
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", int)
/** Print the help to stdout.
This function prints output to stdout.
*/
void print_help(const char *name) {
std::cout
<< "Usage: "sv << name << " [options] [/path/to/configuration_file] [--cmd]"sv << std::endl
<< " Any configurable option can be overwritten with: \"name=value\""sv << std::endl
<< std::endl
<< " Note: The configuration will be created if it doesn't exist."sv << std::endl
<< std::endl
<< " --help | print help"sv << std::endl
<< " --creds username password | set user credentials for the Web manager" << std::endl
<< " --version | print the version of sunshine" << std::endl
<< " --creds username password | set user credentials for the Web manager"sv << std::endl
<< " --version | print the version of sunshine"sv << std::endl
<< std::endl
<< " flags"sv << std::endl
<< " -0 | Read PIN from stdin"sv << std::endl
<< " -1 | Do not load previously saved state and do retain any state after shutdown"sv << std::endl
<< " | Effectively starting as if for the first time without overwriting any pairings with your devices"sv << std::endl
<< " -2 | Force replacement of headers in video stream" << std::endl
<< " -p | Enable/Disable UPnP" << std::endl
<< " -2 | Force replacement of headers in video stream"sv << std::endl
<< " -p | Enable/Disable UPnP"sv << std::endl
<< std::endl;
}
/** Call the print_help function.
Calls the print_help function and then exits.
*/
namespace help {
int entry(const char *name, int argc, char *argv[]) {
print_help(name);
@ -82,6 +92,10 @@ int entry(const char *name, int argc, char *argv[]) {
}
} // namespace help
/** Print the version details to stdout.
This function prints the version details to stdout and then exits.
*/
namespace version {
int entry(const char *name, int argc, char *argv[]) {
std::cout << PROJECT_NAME << " version: v" << PROJECT_VER << std::endl;
@ -326,4 +340,4 @@ int write_file(const char *path, const std::string_view &contents) {
std::uint16_t map_port(int port) {
return (std::uint16_t)((int)config::sunshine.port + port);
}
}