-
Notifications
You must be signed in to change notification settings - Fork 341
/
commandlineparser.cpp
199 lines (186 loc) · 9.56 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// libmyth* headers
#include "mythcorecontext.h"
// local headers
#include "commandlineparser.h"
MythUtilCommandLineParser::MythUtilCommandLineParser() :
MythCommandLineParser(MYTH_APPNAME_MYTHUTIL)
{ LoadArguments(); }
void MythUtilCommandLineParser::LoadArguments(void)
{
CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
// fileutils.cpp
<< add("--copyfile", "copyfile", false,
"Copy a MythTV Storage Group file using RingBuffers", "")
->SetGroup("File")
->SetRequiredChild(QStringList("infile") << "outfile")
<< add("--download", "download", false,
"Download a file using MythDownloadManager", "")
->SetGroup("File")
->SetRequiredChild(QStringList("infile") << "outfile")
// mpegutils.cpp
<< add("--pidcounter", "pidcounter", false,
"Count pids in a MythTV Storage Group file", "")
->SetGroup("MPEG-TS")
->SetRequiredChild("infile")
<< add("--pidfilter", "pidfilter", false,
"Filter pids in a MythTV Storage Group file", "")
->SetGroup("MPEG-TS")
->SetRequiredChild(QStringList("infile") << "outfile")
<< add("--pidprinter", "pidprinter", false,
"Print PSIP pids in a MythTV Storage Group file", "")
->SetGroup("MPEG-TS")
->SetRequiredChild("infile")
->SetChild("outfile")
// markuputils.cpp
<< add("--gencutlist", "gencutlist", false,
"Copy the commercial skip list to the cutlist.", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
<< add("--getcutlist", "getcutlist", false,
"Display the current cutlist.", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
<< add("--setcutlist", "setcutlist", "",
"Set a new cutlist in the form:\n"
"#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
<< add("--clearcutlist", "clearcutlist", false,
"Clear the cutlist.", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
<< add("--getskiplist", "getskiplist", false,
"Display the current commercial skip list.", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
<< add("--setskiplist", "setskiplist", "",
"Set a new commercial skip list in the form:\n"
"#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
<< add("--clearskiplist", "clearskiplist", false,
"Clear the commercial skip list.", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
<< add("--clearseektable", "clearseektable", false,
"Clear the seek table.", "")
->SetGroup("Recording Markup")
->SetRequiredChild(QStringList("chanid") << "starttime")
// backendutils.cpp
<< add("--resched", "resched", false,
"Trigger a run of the recording scheduler on the existing "
"master backend.",
"This command will connect to the master backend and trigger "
"a run of the recording scheduler. The call will return "
"immediately, however the scheduler run may take several "
"seconds to a minute or longer to complete.")
->SetGroup("Backend")
<< add("--scanvideos", "scanvideos", false,
"Trigger a rescan of media content in MythVideo.",
"This command will connect to the master backend and trigger "
"a run of the Video scanner. The call will return "
"immediately, however the scanner may take several seconds "
"to tens of minutes, depending on how much new or moved "
"content it has to hash, and how quickly the scanner can "
"access those files to do so. If enabled, this will also "
"trigger the bulk metadata scanner upon completion.")
->SetGroup("Backend")
<< add("--event", "event", QVariant::StringList,
"Send a backend event test message.", "")
->SetGroup("Backend")
<< add("--systemevent", "systemevent", "",
"Send a backend SYSTEM_EVENT test message.", "")
->SetGroup("Backend")
<< add("--clearcache", "clearcache", false,
"Trigger a cache clear on all connected MythTV systems.",
"This command will connect to the master backend and trigger "
"a cache clear event, which will subsequently be pushed to "
"all other connected programs. This event will clear the "
"local database settings cache used by each program, causing "
"options to be re-read from the database upon next use.")
->SetGroup("Backend")
<< add("--parse-video-filename", "parsevideo", "", "",
"Diagnostic tool for testing filename formats against what "
"the Video Library name parser will detect them as.")
->SetGroup("Backend")
// jobutils.cpp
<< add("--queuejob", "queuejob", "",
"Insert a new job into the JobQueue.",
"Schedule the specified job type (transcode, commflag, "
"metadata, userjob1, userjob2, userjob3, userjob4) to run "
"for the recording with the given chanid and starttime.")
->SetGroup("JobQueue")
->SetRequiredChild("chanid")
->SetRequiredChild("starttime")
// messageutils.cpp
<< add("--message", "message", false,
"Display a message on a frontend", "")
->SetGroup("Messaging")
<< add("--print-message-template", "printmtemplate", false,
"Print the template to be sent to the frontend", "")
->SetGroup("Messaging")
<< add("--notification", "notification", false,
"Display a notification on a frontend", "")
->SetGroup("Messaging")
<< add("--print-notification-template", "printntemplate", false,
"Print the template to be sent to the frontend", "")
->SetGroup("Messaging")
);
// mpegutils.cpp
add("--pids", "pids", "", "Pids to process", "")
->SetRequiredChildOf("pidfilter")
->SetRequiredChildOf("pidprinter");
add("--ptspids", "ptspids", "", "Pids to extract PTS from", "")
->SetGroup("MPEG-TS");
add("--packetsize", "packetsize", 188, "TS Packet Size", "")
->SetChildOf("pidcounter")
->SetChildOf("pidfilter");
add("--noautopts", "noautopts", false, "Disables PTS discovery", "")
->SetChildOf("pidprinter");
add("--xml", "xml", false, "Enables XML output of PSIP", "")
->SetChildOf("pidprinter");
// messageutils.cpp
add("--message_text", "message_text", "message", "(optional) message to send", "")
->SetChildOf("message")
->SetChildOf("notification");
add("--timeout", "timeout", 0, "(optional) notification duration", "")
->SetChildOf("message")
->SetChildOf("notification");
add("--udpport", "udpport", 6948, "(optional) UDP Port to send to", "")
->SetChildOf("message")
->SetChildOf("notification");
add("--bcastaddr", "bcastaddr", "127.0.0.1", "(optional) IP address to send to", "")
->SetChildOf("message")
->SetChildOf("notification");
add("--image", "image", "image_path", "(optional) Path to image to send to (http://, myth://)", "")
->SetChildOf("notification");
add("--origin", "origin", "text", "(optional) notification origin text", "")
->SetChildOf("notification");
add("--description", "description", "text", "(optional) notification description text", "")
->SetChildOf("notification");
add("--extra", "extra", "text", "(optional) notification extra text", "")
->SetChildOf("notification");
add("--progress_text", "progress_text", "text", "(optional) notification progress text", "")
->SetChildOf("notification");
add("--progress", "progress", -1.0, "(optional) progress value (must be between 0 and 1)", "")
->SetChildOf("notification");
add("--fullscreen", "fullscreen", false, "(optional) display notification in full screen mode", "")
->SetChildOf("notification");
add("--error", "error", false, "(optional) set notification to be displayed as an error", "")
->SetChildOf("notification");
add("--visibility", "visibility", 0, "(optional) bitmask indicating where to show the notification", "")
->SetChildOf("notification");
// Generic Options used by more than one utility
addRecording();
addInFile(true);
addSettingsOverride();
addHelp();
addVersion();
addLogging();
allowExtras();
}
QString MythUtilCommandLineParser::GetHelpHeader(void) const
{
return "MythUtil is a command line utility application for MythTV.";
}
/* vim: set expandtab tabstop=4 shiftwidth=4: */