-
Notifications
You must be signed in to change notification settings - Fork 343
/
commandlineparser.cpp
59 lines (52 loc) · 2.55 KB
/
commandlineparser.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using namespace std;
#include <QString>
#include "mythcorecontext.h"
#include "commandlineparser.h"
MythShutdownCommandLineParser::MythShutdownCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHSHUTDOWN)
{ LoadArguments(); }
void MythShutdownCommandLineParser::LoadArguments(void)
{
addHelp();
addVersion();
addLogging();
add(QStringList( QStringList() << "-w" << "--setwakeup" ), "setwakeup", "",
"Set the wakeup time (yyyy-MM-ddThh:mm:ss)", "");
add(QStringList( QStringList() << "-t" << "--setscheduledwakeup" ), "setschedwakeup",
false, "Set wakeup time to the next scheduled recording", "");
add(QStringList( QStringList() << "-q" << "--shutdown" ), "shutdown", false,
"Apply wakeup time to nvram and shutdown.", "");
add(QStringList( QStringList() << "-x" << "--safeshutdown" ), "safeshutdown",
false, "Check if shutdown is possible, and shutdown", "");
add(QStringList( QStringList() << "-p" << "--startup" ), "startup", false,
"Check startup status",
"Check startup status\n"
" returns 0 - automatic startup\n"
" 1 - manual startup");
add(QStringList( QStringList() << "-c" << "--check" ), "check", 1,
"Check whether shutdown is possible",
"Check whether shutdown is possible depending on input\n"
" input 0 - dont check recording status\n"
" 1 - do check recording status\n\n"
" returns 0 - ok to shut down\n"
" 1 - not ok, idle check reset");
add(QStringList( QStringList() << "-l" << "--lock" ), "lock", false,
"disable shutdown", "");
add(QStringList( QStringList() << "-u" << "--unlock" ), "unlock", false,
"enable shutdown", "");
add(QStringList( QStringList() << "-s" << "--status" ), "status", 1,
"check current status",
"check current status depending on input\n"
" input 0 - dont check recording status\n"
" 1 - do check recording status\n\n"
" returns 0 - Idle\n"
" 1 - Transcoding\n"
" 2 - Commercial Detection\n"
" 4 - Grabbing EPG data\n"
" 8 - Recording (only valid if input=1)\n"
" 16 - Locked\n"
" 32 - Jobs running or pending\n"
" 64 - In daily wakeup/shutdown period\n"
" 128 - Less than 15 minutes to next wakeup period\n"
" 255 - Setup is running");
}