00001
00002 using namespace std;
00003
00004 #include <QString>
00005
00006 #include "mythcorecontext.h"
00007 #include "commandlineparser.h"
00008
00009 MythFillDatabaseCommandLineParser::MythFillDatabaseCommandLineParser() :
00010 MythCommandLineParser(MYTH_APPNAME_MYTHFILLDATABASE)
00011 { LoadArguments(); }
00012
00013 void MythFillDatabaseCommandLineParser::LoadArguments(void)
00014 {
00015 addHelp();
00016 addVersion();
00017 addLogging();
00018 allowPassthrough();
00019
00020 add("--manual", "manual", false, "Run interactive configuration",
00021 "Manual mode will interactively ask you questions about "
00022 "each channel as it is processed, to configure for "
00023 "future use.");
00024 add("--update", "update", false, "Run non-destructive updates",
00025 "Run non-destructive updates on the database for "
00026 "users in xmltv zones that do not provide channel "
00027 "data. Stops the addition of new channels and the "
00028 "changing of channel icons.")
00029 ->SetBlocks("manual");
00030
00031 add("--preset", "preset", false,
00032 "Use channel preset values instead of numbers",
00033 "For use with assigning preset numbers for each "
00034 "channel. Useful for non-US countries where people "
00035 "are used to assigning a sequenced number for each "
00036 "channel:\n1->TVE1(S41), 2->La 2(SE18), 3->TV(21)...");
00037 add("--file", "file", false,
00038 "Bypass grabbers and define sourceid and file",
00039 "Directly define the sourceid and XMLTV file to "
00040 "import.")
00041 ->SetBlocks("ddfile")
00042 ->SetBlocks("xawchannels")
00043 ->SetRequires("sourceid");
00044 add("--dd-file", "ddfile", false,
00045 "Bypass grabber, and read SD data from file",
00046 "Directly define the data needed to import a local "
00047 "DataDirect download.")
00048 ->SetBlocks("xawchannels")
00049 ->SetRequires("sourceid");
00050 add("--xawchannels", "xawchannels", false,
00051 "Read channels from xawtvrc file",
00052 "Import channels from an xawtvrc file.")
00053 ->SetRequires("sourceid");
00054
00055 add("--sourceid", "sourceid", 0, "Operate on single source",
00056 "Limit mythfilldatabase to only operate on the "
00057 "specified channel source.");
00058
00059 add("--offset", "offset", 0, "Day offset of input xml file",
00060 "Specify how many days offset from today is the "
00061 "information in the given XML file.")
00062 ->SetRequiredChildOf("ddfile");
00063
00064 add("--lineupid", "lineupid", 0, "DataDirect lineup of input xml file",
00065 "Specify the DataDirect lineup that corresponds to "
00066 "the information in the given XML file.")
00067 ->SetRequiredChildOf("ddfile");
00068
00069 add("--xmlfile", "xmlfile", "", "XML file to import manually",
00070 "Specify an XML guide data file to import directly "
00071 "rather than pull data through the specified grabber.")
00072 ->SetRequiredChildOf("ddfile")
00073 ->SetRequiredChildOf("file");
00074
00075 add("--xawtvrcfile", "xawtvrcfile", "",
00076 "xawtvrc file to import channels from",
00077 "Xawtvrc file containing channels to be imported.")
00078 ->SetRequiredChildOf("xawchannels");
00079
00080 add("--do-channel-updates", "dochannelupdates", false,
00081 "update channels using datadirect",
00082 "When using DataDirect, ask mythfilldatabase to "
00083 "overwrite channel names, frequencies, etc. with "
00084 "values available from the data source. This will "
00085 "override custom channel names, which is why it "
00086 "is disabled by default.")
00087 ->SetGroup("Channel List Handling");
00088 add("--remove-new-channels", "removechannels", false,
00089 "disable new channels on datadirect web interface",
00090 "When using DataDirect, ask mythfilldatabase to "
00091 "mark any new channels as disabled on the remote "
00092 "lineup. Channels can be manually enabled on the "
00093 "website at a later time, and incorporated into "
00094 "MythTV by running mythfilldatabase without this "
00095 "option. New digital channels cannot be directly "
00096 "imported and thus are disabled automatically.")
00097 ->SetBlocks("file")
00098 ->SetGroup("Channel List Handling");
00099 add("--do-not-filter-new-channels", "nofilterchannels", false,
00100 "don't filter ATSC channels for addition",
00101 "Normally, MythTV tries to avoid adding ATSC "
00102 "channels to NTSC channel lineups. This option "
00103 "restores the behavior of adding every channel in "
00104 "the downloaded channel lineup to MythTV's lineup, "
00105 "in case MythTV's smarts fail you.")
00106 ->SetGroup("Channel List Handling");
00107
00108 add("--cardtype", "cardtype", "", "", "No information.");
00109
00110 add("--refresh", "refresh", QVariant::StringList,
00111 "Provide a day or range of days to refresh. Can be "
00112 "used repeatedly.",
00113 "Provide days to refresh during the grabber run. Multiple \n"
00114 "days or ranges can be supplied by multiple instances of the \n"
00115 "option. Supported days are:\n"
00116 " [not]today\n"
00117 " [not]tomorrow\n"
00118 " [not]second\n"
00119 " #[-#]\n"
00120 " all\n\n"
00121 "example:\n"
00122 " --refresh today --refresh 4-8 --refresh nottomorrow")
00123 ->SetGroup("Filtering");
00124
00125 add("--max-days", "maxdays", 0, "force number of days to update",
00126 "Force the maximum number of days, counting today, "
00127 "for the guide data grabber to check for future "
00128 "listings.")
00129 ->SetGroup("Filtering");
00130 add("--refresh-today", "refreshtoday", false, "",
00131 "This option is only valid for selected grabbers.\n"
00132 "Force a refresh for today's guide data.\nThis can be used "
00133 "in combination with other --refresh-<n> options.\n"
00134 "If being used with datadirect, this option should not be "
00135 "used, rather use --dd-grab-all to pull all listings each time.")
00136 ->SetDeprecated("use --refresh instead")
00137 ->SetGroup("Filtering");
00138 add("--dont-refresh-tomorrow", "dontrefreshtomorrow", false, "",
00139 "This option is only valid for selected grabbers.\n"
00140 "Prevent mythfilldatabase from pulling information for "
00141 "tomorrow's listings. Data for tomorrow is always pulled "
00142 "unless specifically specified otherwise.\n"
00143 "If being used with datadirect, this option should not be "
00144 "used, rather use --dd-grab-all to pull all listings each time.")
00145 ->SetDeprecated("use --refresh instead")
00146 ->SetGroup("Filtering");
00147 add("--refresh-second", "refreshsecond", false, "",
00148 "This option is only valid for selected grabbers.\n"
00149 "Force a refresh for guide data two days from now. This can "
00150 "be used in combination with other --refresh-<n> options.\n"
00151 "If being used with datadirect, this option should not be "
00152 "used, rather use --dd-grab-all to pull all listings each time.")
00153 ->SetDeprecated("use --refresh instead")
00154 ->SetGroup("Filtering");
00155 add("--refresh-day", "refreshday", QVariant::StringList, "",
00156 "This option is only valid for selected grabbers.\n"
00157 "Force a refresh for guide data on a specific day. This can "
00158 "be used in combination with other --refresh-<n> options.\n"
00159 "If being used with datadirect, this option should not be "
00160 "used, rather use --dd-grab-all to pull all listings each time.")
00161 ->SetDeprecated("use --refresh instead")
00162 ->SetGroup("Filtering");
00163 add("--dont-refresh-tba", "dontrefreshtba", false,
00164 "don't refresh \"To be announced\" programs",
00165 "This option is only valid for selected grabbers.\n"
00166 "Prevent mythfilldatabase from automatically refreshing any "
00167 "programs marked as \"To be announced\".\n"
00168 "If being used with datadirect, this option should not be "
00169 "used, rather use --dd-grab-all to pull all listings each time.")
00170 ->SetGroup("Filtering");
00171
00172 add("--refresh-all", "refreshall", false, "",
00173 "This option is only valid for selected grabbers.\n"
00174 "This option forces a refresh of all guide data, but does so "
00175 "with fourteen downloads of one day each.\n"
00176 "If being used with datadirect, this option should not be "
00177 "used, rather use --dd-grab-all to pull all listings each time.")
00178 ->SetDeprecated("use --refresh instead")
00179 ->SetBlocks("dontrefreshtomorrow")
00180 ->SetBlocks("refreshsecond")
00181 ->SetBlocks("refreshday")
00182 ->SetBlocks("maxdays")
00183 ->SetGroup("Filtering");
00184
00185 add("--dd-grab-all", "ddgraball", false,
00186 "refresh full data using DataDirect",
00187 "This option is only valid for selected grabbers (DataDirect).\n"
00188 "This option is the preferred way of updating guide data from "
00189 "DataDirect, and pulls all fourteen days of guide data at once.")
00190 ->SetBlocks("refreshtoday")
00191 ->SetBlocks("dontrefreshtomorrow")
00192 ->SetBlocks("refreshsecond")
00193 ->SetBlocks("refreshall")
00194 ->SetBlocks("refreshday")
00195 ->SetBlocks("dontrefreshtba")
00196 ->SetBlocks("maxdays");
00197
00198 add("--only-update-channels", "onlychannels", false,
00199 "only update channel lineup",
00200 "Download as little listings data as possible to update the "
00201 "channel lineup.")
00202 ->SetGroup("Channel List Handling");
00203 add("--no-mark-repeats", "markrepeats", true, "do not mark repeats", "");
00204 add("--export-icon-map", "exporticonmap", "iconmap.xml",
00205 "export icon map to file", "")
00206 ->SetGroup("Channel Icon Handling");
00207 add("--import-icon-map", "importiconmap", "iconmap.xml",
00208 "import icon map to file", "")
00209 ->SetGroup("Channel Icon Handling");
00210 add("--update-icon-map", "updateiconmap", false,
00211 "updates icon map icons", "")
00212 ->SetGroup("Channel Icon Handling");
00213 add("--reset-icon-map", "reseticonmap", "", "resets icon maps",
00214 "Reset all icon maps. If given 'all' as an optional value, reset "
00215 "channel icons as well.")
00216 ->SetGroup("Channel Icon Handling");
00217
00218 add("--graboptions", "graboptions", "", "", "")
00219 ->SetRemoved("mythfilldatabase now passes any text after an\n"
00220 " independent '--' directly to the external grabber.\n"
00221 " e.g. mythfilldatabase -- --daily", "0.25");
00222 add("--mark-repeats", "oldmarkrepeats", "", "", "")
00223 ->SetRemoved("This is now the default behavior. Use\n"
00224 " --no-mark-repeats to disable.", "0.25");
00225 }