MythTV  master
mythcommflag/commandlineparser.cpp
Go to the documentation of this file.
1 #include <QString>
2 
3 #include "mythcorecontext.h"
4 #include "commandlineparser.h"
5 
9 
11 {
12  addHelp();
14  addVersion();
15  addJob();
16  addRecording();
17  addLogging();
18 
19  CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
20  << new CommandLineArg("chanid")
21  << new CommandLineArg("jobid")
22  << add(QStringList{"-f", "--file"},
23  "file", "",
24  "Specify file to operate on.", "")
25  ->SetGroup("Input")
26  << add("--video", "video", "",
27  "Rebuild the seek table for a video (non-recording) file.", "")
28  ->SetGroup("Input") );
29 
30  CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
31  << add("--gencutlist", "gencutlist", false,
32  "Copy the commercial skip list to the cutlist.", "")
33  ->SetDeprecated("use mythutil instead")
34  << add("--clearcutlist", "clearcutlist", false,
35  "Clear the cutlist.", "")
36  ->SetDeprecated("use mythutil instead")
37  << add("--clearskiplist", "clearskiplist", false,
38  "Clear the commercial skip list.", "")
39  ->SetDeprecated("use mythutil instead")
40  << add("--getcutlist", "getcutlist", false,
41  "Display the current cutlist.", "")
42  ->SetDeprecated("use mythutil instead")
43  << add("--getskiplist", "getskiplist", false,
44  "Display the current commercial skip list.", "")
45  ->SetDeprecated("use mythutil instead")
46  << add("--setcutlist", "setcutlist", "",
47  "Set a new cutlist in the form:\n"
48  "#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
49  ->SetDeprecated("use mythutil instead")
50  << add("--skipdb", "skipdb", false, "",
51  "Intended for external 3rd party use.")
52  ->SetGroup("Advanced")
53  ->SetRequires("file")
54  << add("--rebuild", "rebuild", false,
55  "Do not flag commercials, just rebuild the seektable.", "")
56  ->SetGroup("Commflagging")
57  ->SetBlocks("commmethod") );
58 
59  add("--method", "commmethod", "",
60  "Commercial flagging method[s] to employ:\n"
61  "off, blank, scene, blankscene, logo, all, "
62  "d2, d2_logo, d2_blank, d2_scene, d2_all", "")
63  ->SetGroup("Commflagging");
64  add("--outputmethod", "outputmethod", "",
65  "Format of output written to outputfile, essentials, full.", "")
66  ->SetGroup("Commflagging");
67  add("--queue", "queue", false,
68  "Insert flagging job into the JobQueue, rather than "
69  "running flagging in the foreground.", "");
70  add("--noprogress", "noprogress", false,
71  "Don't print progress on stdout.", "")
72  ->SetGroup("Logging");
73  add("--force", "force", false,
74  "Force operation, even if program appears to be in use.", "")
75  ->SetGroup("Advanced");
76  add("--dontwritetodb", "dontwritedb", false, "",
77  "Intended for external 3rd party use.")
78  ->SetGroup("Advanced");
79  add("--onlydumpdb", "dumpdb", false, "", "?")
80  ->SetGroup("Advanced");
81  add("--outputfile", "outputfile", "",
82  "File to write commercial flagging output [debug].", "")
83  ->SetGroup("Advanced");
84  add("--dry-run", "dryrun", false,
85  "Don't actually queue operation, just list what would be done", "");
86 
87  add("--sleep", "fullspeed", false, "", "")
88  ->SetRemoved("If your system is incapable of performing\n"
89  " commercial detection without disrupting other\n"
90  " operations, use the jobqueue execution window\n"
91  " settings to ensure tasks do not run during the\n"
92  " time you may be running such other operations.",
93  "0.25");
94  add("--nopercentage", "nopercentage", false, "", "")
95  ->SetRemoved("Use --noprogress instead.", "0.25");
96  add("--very-quiet", "veryquiet", false, "", "")
97  ->SetRemoved("Use --quiet instead. Can be used multiple times\n"
98  " for increased effect.", "0.25");
99  add("--all", "runall", false, "", "")
100  ->SetRemoved("Use --queue with no content definition for\n"
101  " similar behavior. Will queue all tasks to be\n"
102  " run through the jobqueue, rather than run them\n"
103  " all synchronously within this instance.", "0.25");
104  add("--allstart", "allstart", "", "", "")
105  ->SetRemoved("and is no longer available in this version.", "0.25");
106  add("--allend", "allend", "", "", "")
107  ->SetRemoved("and is no longer available in this version.", "0.25");
108  add("--hogcpu", "hogcpu", "", "", "")
109  ->SetRemoved("and is no longer available in this version.", "0.25");
110 }
111 
CommandLineArg * add(QString arg, QString name, bool def, QString help, QString longhelp)
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.
static void AllowOneOf(QList< CommandLineArg * > args)
Mark a list of arguments as mutually exclusive.
#define MYTH_APPNAME_MYTHCOMMFLAG
void addJob(void)
Canned argument definition for –jobid.
CommandLineArg * SetRemoved(QString remstr="", QString remver="")
Set option as removed.
CommandLineArg * SetGroup(const QString &group)
void addSettingsOverride(void)
Canned argument definition for –override-setting and –override-settings-file.
void addRecording(void)
Canned argument definition for –chanid and –starttime.