MythTV master
mythutil_commandlineparser.cpp
Go to the documentation of this file.
2
4
8
10{
11 QStringList ChanidStartimeVideo;
12 ChanidStartimeVideo << "chanid" << "starttime" << "video";
13 CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
14 // fileutils.cpp
15 << add("--copyfile", "copyfile", false,
16 "Copy a MythTV Storage Group file using RingBuffers", "")
17 ->SetGroup("File")
18 ->SetRequiredChild(QStringList("infile") << "outfile")
19 << add("--download", "download", false,
20 "Download a file using MythDownloadManager", "")
21 ->SetGroup("File")
22 ->SetRequiredChild(QStringList("infile") << "outfile")
23
24 // mpegutils.cpp
25 << add("--pidcounter", "pidcounter", false,
26 "Count pids in a MythTV Storage Group file", "")
27 ->SetGroup("MPEG-TS")
28 ->SetRequiredChild("infile")
29 << add("--pidfilter", "pidfilter", false,
30 "Filter pids in a MythTV Storage Group file", "")
31 ->SetGroup("MPEG-TS")
32 ->SetRequiredChild(QStringList("infile") << "outfile")
33 << add("--pidprinter", "pidprinter", false,
34 "Print PSIP pids in a MythTV Storage Group file", "")
35 ->SetGroup("MPEG-TS")
36 ->SetRequiredChild("infile")
37 ->SetChild("outfile")
38
39 // markuputils.cpp
40 << add("--gencutlist", "gencutlist", false,
41 "Copy the commercial skip list to the cutlist.", "")
42 ->SetGroup("Recording Markup")
43 ->SetParentOf(ChanidStartimeVideo)
44 << add("--getcutlist", "getcutlist", false,
45 "Display the current cutlist.", "")
46 ->SetGroup("Recording Markup")
47 ->SetParentOf(ChanidStartimeVideo)
48 << add("--setcutlist", "setcutlist", "",
49 "Set a new cutlist in the form:\n"
50 "#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
51 ->SetGroup("Recording Markup")
52 ->SetParentOf(ChanidStartimeVideo)
53 << add("--clearcutlist", "clearcutlist", false,
54 "Clear the cutlist.", "")
55 ->SetGroup("Recording Markup")
56 ->SetParentOf(ChanidStartimeVideo)
57 << add("--getskiplist", "getskiplist", false,
58 "Display the current commercial skip list.", "")
59 ->SetGroup("Recording Markup")
60 ->SetParentOf(ChanidStartimeVideo)
61 << add("--setskiplist", "setskiplist", "",
62 "Set a new commercial skip list in the form:\n"
63 "#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
64 ->SetGroup("Recording Markup")
65 ->SetParentOf(ChanidStartimeVideo)
66 << add("--clearskiplist", "clearskiplist", false,
67 "Clear the commercial skip list.", "")
68 ->SetGroup("Recording Markup")
69 ->SetParentOf(ChanidStartimeVideo)
70 << add("--clearseektable", "clearseektable", false,
71 "Clear the seek table.", "")
72 ->SetGroup("Recording Markup")
73 ->SetParentOf(ChanidStartimeVideo)
74 << add("--clearbookmarks", "clearbookmarks", false,
75 "Clear all bookmarks.", "This command will reset the playback "
76 "start to the very beginning of the recording file.")
77 ->SetGroup("Recording Markup")
78 ->SetParentOf(ChanidStartimeVideo)
79 << add("--getmarkup", "getmarkup", "",
80 "Write markup data to the specified local file.", "")
81 ->SetGroup("Recording Markup")
82 ->SetParentOf(ChanidStartimeVideo)
83 << add("--setmarkup", "setmarkup", "",
84 "Read markup data from the specified local file, and\n"
85 "use it to set the markup for the recording or video.", "")
86 ->SetGroup("Recording Markup")
87 ->SetParentOf(ChanidStartimeVideo)
88
89 // backendutils.cpp
90 << add("--resched", "resched", false,
91 "Trigger a run of the recording scheduler on the existing "
92 "master backend.",
93 "This command will connect to the master backend and trigger "
94 "a run of the recording scheduler. The call will return "
95 "immediately, however the scheduler run may take several "
96 "seconds to a minute or longer to complete.")
97 ->SetGroup("Backend")
98 << add("--scanimages", "scanimages", false,
99 "Trigger a rescan of media content in Images.",
100 "This command will connect to the master backend and trigger "
101 "a run of the image scanner. The call will return "
102 "immediately, however the scanner may take several seconds "
103 "to tens of minutes, depending on how much new or moved "
104 "content it has to hash, and how quickly the scanner can "
105 "access those files to do so..")
106 ->SetGroup("Backend")
107 << add("--scanvideos", "scanvideos", false,
108 "Trigger a rescan of media content in MythVideo.",
109 "This command will connect to the master backend and trigger "
110 "a run of the Video scanner. The call will return "
111 "immediately, however the scanner may take several seconds "
112 "to tens of minutes, depending on how much new or moved "
113 "content it has to hash, and how quickly the scanner can "
114 "access those files to do so. If enabled, this will also "
115 "trigger the bulk metadata scanner upon completion.")
116 ->SetGroup("Backend")
117 << add("--event", "event", QMetaType::QStringList,
118 "Send a backend event test message.", "")
119 ->SetGroup("Backend")
120 << add("--systemevent", "systemevent", "",
121 "Send a backend SYSTEM_EVENT test message.", "")
122 ->SetGroup("Backend")
123 << add("--clearcache", "clearcache", false,
124 "Trigger a cache clear on all connected MythTV systems.",
125 "This command will connect to the master backend and trigger "
126 "a cache clear event, which will subsequently be pushed to "
127 "all other connected programs. This event will clear the "
128 "local database settings cache used by each program, causing "
129 "options to be re-read from the database upon next use.")
130 ->SetGroup("Backend")
131 << add("--parse-video-filename", "parsevideo", "", "",
132 "Diagnostic tool for testing filename formats against what "
133 "the Video Library name parser will detect them as.")
134 ->SetGroup("Backend")
135
136 // jobutils.cpp
137 << add("--queuejob", "queuejob", "",
138 "Insert a new job into the JobQueue.",
139 "Schedule the specified job type (transcode, commflag, "
140 "metadata, userjob1, userjob2, userjob3, userjob4) to run "
141 "for the recording with the given chanid and starttime.")
142 ->SetGroup("JobQueue")
143 ->SetRequiredChild("chanid")
144 ->SetRequiredChild("starttime")
145
146 // messageutils.cpp
147 << add("--message", "message", false,
148 "Display a message on a frontend", "")
149 ->SetGroup("Messaging")
150 << add("--print-message-template", "printmtemplate", false,
151 "Print the template to be sent to the frontend", "")
152 ->SetGroup("Messaging")
153 << add("--notification", "notification", false,
154 "Display a notification on a frontend", "")
155 ->SetGroup("Messaging")
156 << add("--print-notification-template", "printntemplate", false,
157 "Print the template to be sent to the frontend", "")
158 ->SetGroup("Messaging")
159
160 // musicmetautils.cpp
161 << add("--scanmusic", "scanmusic", false,
162 "Scan the 'Music' Storage Group for music files", "")
163 ->SetGroup("Music Scanning")
164 << add("--updateradiostreams", "updateradiostreams", false,
165 "Downloads an updated radio stream list from the MythTV server", "")
166 ->SetGroup("Music Scanning")
167 << add("--updatemeta", "updatemeta", false,
168 "Update a music tracks database record and tag with new metadata", "")
169 ->SetGroup("Metadata Reading/Writing")
170 << add("--extractimage", "extractimage", false,
171 "Extract an embedded image from a tracks tag and cache it in the AlbumArt storage group", "")
172 ->SetGroup("Metadata Reading/Writing")
173 << add("--calctracklen", "calctracklen", false,
174 "Decode a track to determine its exact length", "")
175 ->SetGroup("Metadata Reading/Writing")
176 << add("--findlyrics", "findlyrics", false,
177 "Search for some lyrics for a track", "")
178 ->SetGroup("Metadata Reading/Writing")
179 ->SetRequiredChild(QStringList("songid"))
180 ->SetParentOf(QStringList() << "artist" << "album" << "title")
181
182 // recordingutils.cpp
183 << add("--checkrecordings", "checkrecordings", false,
184 "Check all recording exist and have a seektable etc.", "")
185 ->SetGroup("Recording Utils")
186
187 // eitutils.cpp
188 << add("--cleareit", "cleareit", false,
189 "Clear guide received from EIT.", "")
190 ->SetGroup("EIT Utils")
191 );
192
193 // mpegutils.cpp
194 add("--pids", "pids", "", "Pids to process", "")
195 ->SetRequiredChildOf("pidfilter")
196 ->SetRequiredChildOf("pidprinter");
197 add("--ptspids", "ptspids", "", "Pids to extract PTS from", "")
198 ->SetGroup("MPEG-TS");
199 add("--packetsize", "packetsize", 188, "TS Packet Size", "")
200 ->SetChildOf("pidcounter")
201 ->SetChildOf("pidfilter");
202 add("--noautopts", "noautopts", false, "Disables PTS discovery", "")
203 ->SetChildOf("pidprinter");
204 add("--xml", "xml", false, "Enables XML output of PSIP", "")
205 ->SetChildOf("pidprinter");
206
207 // messageutils.cpp
208 add("--message_text", "message_text", "message", "(optional) message to send", "")
209 ->SetChildOf("message")
210 ->SetChildOf("notification");
211 add("--timeout", "timeout", 0, "(optional) notification duration", "")
212 ->SetChildOf("message")
213 ->SetChildOf("notification");
214 add("--udpport", "udpport", 6948, "(optional) UDP Port to send to", "")
215 ->SetChildOf("message")
216 ->SetChildOf("notification");
217 add("--bcastaddr", "bcastaddr", "127.0.0.1", "(optional) IP address to send to", "")
218 ->SetChildOf("message")
219 ->SetChildOf("notification");
220 add("--image", "image", "image_path", "(optional) Path to image to send to (http://, myth://)", "")
221 ->SetChildOf("notification");
222 add("--origin", "origin", "text", "(optional) notification origin text", "")
223 ->SetChildOf("notification");
224 add("--description", "description", "text", "(optional) notification description text", "")
225 ->SetChildOf("notification");
226 add("--extra", "extra", "text", "(optional) notification extra text", "")
227 ->SetChildOf("notification");
228 add("--progress_text", "progress_text", "text", "(optional) notification progress text", "")
229 ->SetChildOf("notification");
230 add("--progress", "progress", -1.0, "(optional) progress value (must be between 0 and 1)", "")
231 ->SetChildOf("notification");
232 add("--fullscreen", "fullscreen", false, "(optional) display notification in full screen mode", "")
233 ->SetChildOf("notification");
234 add("--error", "error", false, "(optional) set notification to be displayed as an error", "")
235 ->SetChildOf("notification");
236 add("--visibility", "visibility", 0, "(optional) bitmask indicating where to show the notification", "")
237 ->SetChildOf("notification");
238 add("--type", "type", "type", "(optional) type of notification (normal, error, warning, check, busy", "")
239 ->SetChildOf("notification");
240
241 // musicmetautils.cpp
242 add("--force", "musicforce", false, "Ignore file timestamps", "")
243 ->SetChildOf("scanmusic");
244 add("--songid", "songid", "", "ID of track to update", "")
245 ->SetChildOf("updatemeta");
246 add("--title", "title", "", "(optional) Title of track", "")
247 ->SetChildOf("updatemeta");
248 add("--artist", "artist", "", "(optional) Artist of track", "")
249 ->SetChildOf("updatemeta");
250 add("--album", "album", "", "(optional) Album of track", "")
251 ->SetChildOf("updatemeta");
252 add("--genre", "genre", "", "(optional) Genre of track", "")
253 ->SetChildOf("updatemeta");
254 add("--trackno", "trackno", "", "(optional) Track No. of track", "")
255 ->SetChildOf("updatemeta");
256 add("--year", "year", "", "(optional) Year of track", "")
257 ->SetChildOf("updatemeta");
258 add("--rating", "rating", "", "(optional) Rating of track", "")
259 ->SetChildOf("updatemeta");
260 add("--playcount", "playcount", "", "(optional) Playcount of track", "")
261 ->SetChildOf("updatemeta");
262 add("--lastplayed", "lastplayed", "", "(optional) Last played of track", "")
263 ->SetChildOf("updatemeta");
264 add("--songid", "songid", "", "ID of track from which to get the image", "")
265 ->SetChildOf("extractimage");
266 add("--imagetype", "imagetype", "", "Type of image to extract (front, back, cd, inlay, unknown)", "")
267 ->SetChildOf("extractimage");
268 add("--songid", "songid", "", "ID of track to determine the length", "")
269 ->SetChildOf("calctracklen");
270 add("--songid", "songid", "", "ID of track to find lyrics for", "")
271 ->SetChildOf("findlyrics");
272 add("--grabber", "grabber", "", "(optional) Name of grabber to use or 'ALL' to try all available grabbers", "")
273 ->SetChildOf("findlyrics");
274 add("--artist", "grabber", "", "(optional) Artist of track to find lyrics for", "")
275 ->SetChildOf("findlyrics");
276 add("--album", "grabber", "", "(optional) Album of track to find lyrics for", "")
277 ->SetChildOf("findlyrics");
278 add("--title", "grabber", "", "(optional) Title of track to find lyrics for", "")
279 ->SetChildOf("findlyrics");
280
281 // recordingutils.cpp
282 add("--fixseektable", "fixseektable", false, "(optional) fix the seektable if missing for a recording", "")
283 ->SetChildOf("checkrecordings");
284
285 // eitutils.cpp
286 add("--sourceid", "sourceid", -1, "(optional) specify sourceid of video source to operate on instead of all", "")
287 ->SetChildOf("cleareit");
288
289 // Generic Options used by more than one utility
290 addRecording();
291 addInFile(true);
293 addHelp();
294 addVersion();
295 addLogging();
296 allowExtras();
297 // Note: This globally prevents --chanid and --video from being
298 // used together, but this is almost certainly a valid restriction
299 // in all cases.
300 CommandLineArg::AllowOneOf(QList<CommandLineArg*>() <<
301 new CommandLineArg("chanid") <<
302 add("--video", "video", "",
303 "Specify path name of Video Gallery video "
304 "to operate on.", ""));
305}
306
308{
309 return "MythUtil is a command line utility application for MythTV.";
310}
311
312/* vim: set expandtab tabstop=4 shiftwidth=4: */
Definition for a single command line option.
static void AllowOneOf(const QList< CommandLineArg * > &args)
Mark a list of arguments as mutually exclusive.
CommandLineArg * SetChildOf(const QString &opt)
Set argument as child of given parent.
CommandLineArg * SetGroup(const QString &group)
CommandLineArg * SetRequiredChildOf(const QString &opt)
Set argument as child required by given parent.
Parent class for defining application command line parsers.
void addVersion(void)
Canned argument definition for –version.
void addSettingsOverride(void)
Canned argument definition for –override-setting and –override-settings-file.
void addRecording(void)
Canned argument definition for –chanid and –starttime.
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.
void addInFile(bool addOutFile=false)
Canned argument definition for –infile and –outfile.
void allowExtras(bool allow=true)
Specify that parser should allow and collect additional key/value pairs not explicitly defined for pr...
QString GetHelpHeader(void) const override
static constexpr const char * MYTH_APPNAME_MYTHUTIL
Definition: mythappname.h:19