00001
00002 #include "mythcorecontext.h"
00003
00004
00005 #include "commandlineparser.h"
00006
00007 MythUtilCommandLineParser::MythUtilCommandLineParser() :
00008 MythCommandLineParser(MYTH_APPNAME_MYTHUTIL)
00009 { LoadArguments(); }
00010
00011 void MythUtilCommandLineParser::LoadArguments(void)
00012 {
00013 CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
00014
00015 << add("--copyfile", "copyfile", false,
00016 "Copy a MythTV Storage Group file", "")
00017 ->SetGroup("File")
00018 ->SetRequiredChild(QStringList("infile") << "outfile")
00019
00020
00021 << add("--pidcounter", "pidcounter", false,
00022 "Count pids in a MythTV Storage Group file", "")
00023 ->SetGroup("MPEG-TS")
00024 ->SetRequiredChild("infile")
00025 << add("--pidfilter", "pidfilter", false,
00026 "Filter pids in a MythTV Storage Group file", "")
00027 ->SetGroup("MPEG-TS")
00028 ->SetRequiredChild(QStringList("infile") << "outfile")
00029 << add("--pidprinter", "pidprinter", false,
00030 "Print PSIP pids in a MythTV Storage Group file", "")
00031 ->SetGroup("MPEG-TS")
00032 ->SetRequiredChild("infile")
00033 ->SetChild("outfile")
00034
00035
00036 << add("--gencutlist", "gencutlist", false,
00037 "Copy the commercial skip list to the cutlist.", "")
00038 ->SetGroup("Recording Markup")
00039 ->SetRequiredChild(QStringList("chanid") << "starttime")
00040 << add("--getcutlist", "getcutlist", false,
00041 "Display the current cutlist.", "")
00042 ->SetGroup("Recording Markup")
00043 ->SetRequiredChild(QStringList("chanid") << "starttime")
00044 << add("--setcutlist", "setcutlist", "",
00045 "Set a new cutlist in the form:\n"
00046 "#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
00047 ->SetGroup("Recording Markup")
00048 ->SetRequiredChild(QStringList("chanid") << "starttime")
00049 << add("--clearcutlist", "clearcutlist", false,
00050 "Clear the cutlist.", "")
00051 ->SetGroup("Recording Markup")
00052 ->SetRequiredChild(QStringList("chanid") << "starttime")
00053 << add("--getskiplist", "getskiplist", false,
00054 "Display the current commercial skip list.", "")
00055 ->SetGroup("Recording Markup")
00056 ->SetRequiredChild(QStringList("chanid") << "starttime")
00057 << add("--setskiplist", "setskiplist", "",
00058 "Set a new commercial skip list in the form:\n"
00059 "#-#[,#-#]... (ie, 1-100,1520-3012,4091-5094)", "")
00060 ->SetGroup("Recording Markup")
00061 ->SetRequiredChild(QStringList("chanid") << "starttime")
00062 << add("--clearskiplist", "clearskiplist", false,
00063 "Clear the commercial skip list.", "")
00064 ->SetGroup("Recording Markup")
00065 ->SetRequiredChild(QStringList("chanid") << "starttime")
00066
00067
00068 << add("--resched", "resched", false,
00069 "Trigger a run of the recording scheduler on the existing "
00070 "master backend.",
00071 "This command will connect to the master backend and trigger "
00072 "a run of the recording scheduler. The call will return "
00073 "immediately, however the scheduler run may take several "
00074 "seconds to a minute or longer to complete.")
00075 ->SetGroup("Backend")
00076 << add("--scanvideos", "scanvideos", false,
00077 "Trigger a rescan of media content in MythVideo.",
00078 "This command will connect to the master backend and trigger "
00079 "a run of the Video scanner. The call will return "
00080 "immediately, however the scanner may take several seconds "
00081 "to tens of minutes, depending on how much new or moved "
00082 "content it has to hash, and how quickly the scanner can "
00083 "access those files to do so. If enabled, this will also "
00084 "trigger the bulk metadata scanner upon completion.")
00085 ->SetGroup("Backend")
00086 << add("--event", "event", QVariant::StringList,
00087 "Send a backend event test message.", "")
00088 ->SetGroup("Backend")
00089 << add("--systemevent", "systemevent", "",
00090 "Send a backend SYSTEM_EVENT test message.", "")
00091 ->SetGroup("Backend")
00092 << add("--clearcache", "clearcache", false,
00093 "Trigger a cache clear on all connected MythTV systems.",
00094 "This command will connect to the master backend and trigger "
00095 "a cache clear event, which will subsequently be pushed to "
00096 "all other connected programs. This event will clear the "
00097 "local database settings cache used by each program, causing "
00098 "options to be re-read from the database upon next use.")
00099 ->SetGroup("Backend")
00100 << add("--parse-video-filename", "parsevideo", "", "",
00101 "Diagnostic tool for testing filename formats against what "
00102 "the Video Library name parser will detect them as.")
00103 ->SetGroup("Backend")
00104
00105
00106 << add("--queuejob", "queuejob", "",
00107 "Insert a new job into the JobQueue.",
00108 "Schedule the specified job type (transcode, commflag, "
00109 "metadata, userjob1, userjob2, userjob3, userjob4) to run "
00110 "for the recording with the given chanid and starttime.")
00111 ->SetGroup("JobQueue")
00112 ->SetRequiredChild("chanid")
00113 ->SetRequiredChild("starttime")
00114
00115
00116 << add("--message", "message", false,
00117 "Display a message on a frontend", "")
00118 ->SetGroup("Messaging")
00119 << add("--print-template", "printtemplate", false,
00120 "Print the template to be sent to the frontend", "")
00121 ->SetGroup("Messaging")
00122 );
00123
00124
00125 add("--pids", "pids", "", "Pids to process", "")
00126 ->SetRequiredChildOf("pidfilter")
00127 ->SetRequiredChildOf("pidprinter");
00128 add("--ptspids", "ptspids", "", "Pids to extract PTS from", "")
00129 ->SetGroup("MPEG-TS");
00130 add("--packetsize", "packetsize", 188, "TS Packet Size", "")
00131 ->SetChildOf("pidcounter")
00132 ->SetChildOf("pidfilter");
00133 add("--noautopts", "noautopts", false, "Disables PTS discovery", "")
00134 ->SetChildOf("pidprinter");
00135 add("--xml", "xml", false, "Enables XML output of PSIP", "")
00136 ->SetChildOf("pidprinter");
00137
00138
00139 add("--udpport", "udpport", 6948, "(optional) UDP Port to send to", "")
00140 ->SetChildOf("message");
00141 add("--bcastaddr", "bcastaddr", "127.0.0.1", "(optional) IP address to send to", "")
00142 ->SetChildOf("message");
00143
00144
00145 addRecording();
00146 addInFile(true);
00147 addSettingsOverride();
00148 addHelp();
00149 addVersion();
00150 addLogging();
00151 allowExtras();
00152 }
00153
00154 QString MythUtilCommandLineParser::GetHelpHeader(void) const
00155 {
00156 return "MythUtil is a command line utility application for MythTV.";
00157 }
00158
00159