Use -hh to show config file options

This commit is contained in:
badaix 2020-03-05 23:26:31 +01:00
parent c8c1871573
commit c977a884f7
2 changed files with 6 additions and 4 deletions

View file

@ -4,10 +4,10 @@ snapserver - Snapcast server
.SH SYNOPSIS .SH SYNOPSIS
\fBsnapserver\fR [\fIOPTION\fR]... \fBsnapserver\fR [\fIOPTION\fR]...
.SH DESCRIPTION .SH DESCRIPTION
Snapcast is a multi-room client-server audio player, where all clients are Snapcast is a multiroom client-server audio player, where all clients are
time synchronized with the server to play perfectly synced audio. It's not a time synchronized with the server to play perfectly synced audio. It's not a
standalone player, but an extension that turns your existing audio player into standalone player, but an extension that turns your existing audio player into
a Sonos-like multi-room solution. a Sonos-like multiroom solution.
.br .br
The server's audio input is a named pipe `/tmp/snapfifo`. All data that is fed The server's audio input is a named pipe `/tmp/snapfifo`. All data that is fed
into this file will be send to the connected clients. One of the most generic into this file will be send to the connected clients. One of the most generic
@ -16,7 +16,7 @@ which can be configured to use a named pipe as audio output.
.SS Allowed options: .SS Allowed options:
.TP .TP
\fB-h, --help\fR \fB-h, --help\fR
Produce help message Produce help message, use -hh to show options from config file
.TP .TP
\fB-v, --version\fR \fB-v, --version\fR
Show version number Show version number

View file

@ -57,7 +57,7 @@ int main(int argc, char* argv[])
std::string config_file = "/etc/snapserver.conf"; std::string config_file = "/etc/snapserver.conf";
OptionParser op("Allowed options"); OptionParser op("Allowed options");
auto helpSwitch = op.add<Switch>("h", "help", "Produce help message"); auto helpSwitch = op.add<Switch>("h", "help", "Produce help message, use -hh to show options from config file");
auto groffSwitch = op.add<Switch, Attribute::hidden>("", "groff", "produce groff message"); auto groffSwitch = op.add<Switch, Attribute::hidden>("", "groff", "produce groff message");
auto versionSwitch = op.add<Switch>("v", "version", "Show version number"); auto versionSwitch = op.add<Switch>("v", "version", "Show version number");
#ifdef HAS_DAEMON #ifdef HAS_DAEMON
@ -157,6 +157,8 @@ int main(int argc, char* argv[])
if (helpSwitch->is_set()) if (helpSwitch->is_set())
{ {
cout << op << "\n"; cout << op << "\n";
if (helpSwitch->count() > 1)
cout << conf << "\n";
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }