MythTV  master
mythmetadatalookup/commandlineparser.cpp
Go to the documentation of this file.
1 #include <QString>
2 #include <QList>
3 
4 #include "mythcorecontext.h"
5 #include "commandlineparser.h"
6 
10 
12 {
13  addHelp();
14  addVersion();
15  addRecording();
16  addJob();
17  addLogging();
18 
19  CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
20  << add("--refresh-all", "refresh-all", false,
21  "Batch update recorded program metadata. If a recording's "
22  "rule has an inetref but the recording does not, it will "
23  "be inherited.", "")
24  << add("--refresh-all-rules", "refresh-all-rules", false,
25  "Batch update metadata for recording rules. This will "
26  "set inetrefs for your recording rules based on an automated "
27  "lookup. This is a best effort, and not guaranteed! If your "
28  "recordings lack inetrefs but one is found for the rule, it "
29  "will be inherited.", "")
30  << add("--refresh-all-artwork", "refresh-all-artwork", false,
31  "Batch update artwork for non-generic recording rules "
32  "and recordings. This is a more conservative option "
33  "which only operates on items for which it is likely "
34  "to be able to find artwork. This option will not "
35  "overwrite any existing artwork.", "")
36  << add("--refresh-all-artwork-dangerously",
37  "refresh-all-artwork-dangerously", false,
38  "Batch update artwork for ALL recording rules and recordings. "
39  "This will attempt to download fanart, coverart, and banner "
40  "for each season of each recording rule and all recordings. "
41  "This option will not overwrite any existing artwork. If a "
42  "rule or recording has not been looked up, this will attempt "
43  "to look it up. This is a very aggressive option! Use with "
44  "care.", "")
45  << new CommandLineArg("chanid")
46  << new CommandLineArg("jobid") );
47 
48  add("--refresh-rules", "refresh-rules", false,
49  "Also update inetref for recording rules when metadata is "
50  "found for a recording (Best effort only, imperfect)", "")
51  ->SetBlocks("refresh-all")
52  ->SetBlocks("refresh-all-rules")
53  ->SetBlocks("refresh-all-artwork")
54  ->SetBlocks("refresh-all-artwork-dangerously")
55  ->SetChildOf("chanid")
56  ->SetChildOf("jobid");
57 }
58 
CommandLineArg * add(QString arg, QString name, bool def, QString help, QString longhelp)
#define MYTH_APPNAME_MYTHMETADATALOOKUP
Parent class for defining application command line parsers.
void addVersion(void)
Canned argument definition for –version.
Definition for a single command line option.
void addLogging(const QString &defaultVerbosity="general", LogLevel_t defaultLogLevel=LOG_INFO)
Canned argument definition for all logging options, including –verbose, –logpath, –quiet,...
void addHelp(void)
Canned argument definition for –help.
CommandLineArg * SetChildOf(const QString &opt)
Set argument as child of given parent.
static void AllowOneOf(QList< CommandLineArg * > args)
Mark a list of arguments as mutually exclusive.
void addJob(void)
Canned argument definition for –jobid.
void addRecording(void)
Canned argument definition for –chanid and –starttime.
CommandLineArg * SetBlocks(const QString &opt)
Set argument as incompatible with given option.