MythTV master
mythshutdown_commandlineparser.cpp
Go to the documentation of this file.
1#include <QString>
2
4
6
10
12{
13 add("-l", "oldlock", false, "disable shutdown", "")
14 ->SetRemoved("Please use the full argument '--lock' instead.");
15
16 addHelp();
17 addVersion();
18 addLogging("none", LOG_ERR);
19
20 CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
21 << add(QStringList{"-w", "--setwakeup"},
22 "setwakeup", "",
23 "Set the wakeup time (yyyy-MM-ddThh:mm:ss) "
24 "default is in local time", "")
25 << add(QStringList{"-t", "--setscheduledwakeup"},
26 "setschedwakeup", false,
27 "Set wakeup time to the next scheduled recording", "")
28 << add(QStringList{"-q", "--shutdown"},
29 "shutdown", false,
30 "Apply wakeup time to nvram and shutdown.", "")
31 << add(QStringList{"-x", "--safeshutdown"},
32 "safeshutdown", false,
33 "Check if shutdown is possible, and shutdown", "")
34 << add(QStringList{"-p", "--startup"},
35 "startup", false,
36 "Check startup status",
37 "Check startup status\n"
38 " returns 0 - automatic startup\n"
39 " 1 - manual startup")
40 << add(QStringList{"-c", "--check"},
41 "check", 1,
42 "Check whether shutdown is possible",
43 "Check whether shutdown is possible depending on input\n"
44 " input 0 - dont check recording status\n"
45 " 1 - do check recording status\n\n"
46 " returns 0 - ok to shut down\n"
47 " 1 - not ok, idle check reset")
48 << add("--lock" , "lock", false, "disable shutdown", "")
49 << add(QStringList{"-u", "--unlock"},
50 "unlock", false,
51 "enable shutdown", "")
52 << add(QStringList{"-s", "--status"},
53 "status", 1,
54 "check current status",
55 "check current status depending on input\n"
56 " input 0 - dont check recording status\n"
57 " 1 - do check recording status\n\n"
58 " returns 0 - Idle\n"
59 " 1 - Transcoding\n"
60 " 2 - Commercial Detection\n"
61 " 4 - Grabbing EPG data\n"
62 " 8 - Recording (only valid if input=1)\n"
63 " 16 - Locked\n"
64 " 32 - Jobs running or pending\n"
65 " 64 - In daily wakeup/shutdown period\n"
66 " 128 - Less than 15 minutes to next wakeup period\n"
67 " 255 - Setup is running") );
68
69 // The localtime command line parameter exists solely to make scripts
70 // using this executable self documenting.
71
72 CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
73 << add("--utc",
74 "utc", false,
75 "Specify that the wakeup time is in utc", "")
76 << add("--localtime",
77 "localtime", false,
78 "Specify that the wakeup time is in local time", "") );
79}
80
static void AllowOneOf(const QList< CommandLineArg * > &args)
Mark a list of arguments as mutually exclusive.
CommandLineArg * SetRemoved(QString remstr="", QString remver="")
Set option as removed.
Parent class for defining application command line parsers.
void addVersion(void)
Canned argument definition for –version.
void addLogging(const QString &defaultVerbosity="general", LogLevel_t defaultLogLevel=LOG_INFO)
Canned argument definition for all logging options, including –verbose, –logpath, –quiet,...
CommandLineArg * add(const QString &arg, const QString &name, bool def, QString help, QString longhelp)
void addHelp(void)
Canned argument definition for –help.
static constexpr const char * MYTH_APPNAME_MYTHSHUTDOWN
Definition: mythappname.h:14