Permalink
Browse files

Break commandlineparser into separate file for consistency.

This moves the command line parser argument definitions out of main.cpp
and into commandlineparser.cpp to maintain consistency with other
applications.
  • Loading branch information...
1 parent 20c814a commit d4ccef8376e8f3979267c1da3e305ed1cc16464e @wagnerrp wagnerrp committed Apr 23, 2012
@@ -0,0 +1,52 @@
+
+using namespace std;
+
+#include <QString>
+#include <QList>
+
+#include "mythcorecontext.h"
+#include "commandlineparser.h"
+
+MythMetadataLookupCommandLineParser::MythMetadataLookupCommandLineParser() :
+ MythCommandLineParser(MYTH_APPNAME_MYTHMETADATALOOKUP)
+{ LoadArguments(); }
+
+void MythMetadataLookupCommandLineParser::LoadArguments(void)
+{
+ addHelp();
+ addVersion();
+ addRecording();
+ addJob();
+ addLogging();
+
+ CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
+ << add("--refresh-all", "refresh-all", false,
+ "Batch update recorded program metadata. If a recording's "
+ "rule has an inetref but the recording does not, it will "
+ "be inherited.", "")
+ << add("--refresh-rules", "refresh-rules", false,
+ "Also update inetref for recording rules when metadata is "
+ "found for a recording (Best effort only, imperfect)", "")
+ << add("--refresh-all-rules", "refresh-all-rules", false,
+ "Batch update metadata for recording rules. This will "
+ "set inetrefs for your recording rules based on an automated "
+ "lookup. This is a best effort, and not guaranteed! If your "
+ "recordings lack inetrefs but one is found for the rule, it "
+ "will be inherited.", "")
+ << add("--refresh-all-artwork", "refresh-all-artwork", false,
+ "Batch update artwork for non-generic recording rules "
+ "and recordings. This is a more conservative option "
+ "which only operates on items for which it is likely "
+ "to be able to find artwork. This option will not "
+ "overwrite any existing artwork.", "")
+ << add("--refresh-all-artwork-dangerously",
+ "refresh-all-artwork-dangerously", false,
+ "Batch update artwork for ALL recording rules and recordings. "
+ "This will attempt to download fanart, coverart, and banner "
+ "for each season of each recording rule and all recordings. "
+ "This option will not overwrite any existing artwork. If a "
+ "rule or recording has not been looked up, this will attempt "
+ "to look it up. This is a very aggressive option! Use with "
+ "care.", "") );
+}
+
@@ -0,0 +1,10 @@
+
+#include "mythcommandlineparser.h"
+
+class MythMetadataLookupCommandLineParser : public MythCommandLineParser
+{
+ public:
+ MythMetadataLookupCommandLineParser();
+ void LoadArguments(void);
+};
+
@@ -18,7 +18,7 @@ using namespace std;
#include "jobqueue.h"
#include "mythtranslation.h"
#include "mythconfig.h"
-#include "mythcommandlineparser.h"
+#include "commandlineparser.h"
#include "mythlogging.h"
#include "lookup.h"
@@ -53,56 +53,6 @@ namespace
bool inJobQueue = false;
-class MythMetadataLookupCommandLineParser : public MythCommandLineParser
-{
- public:
- MythMetadataLookupCommandLineParser();
- void LoadArguments(void);
-};
-
-MythMetadataLookupCommandLineParser::MythMetadataLookupCommandLineParser() :
- MythCommandLineParser(MYTH_APPNAME_MYTHMETADATALOOKUP)
-{ LoadArguments(); }
-
-void MythMetadataLookupCommandLineParser::LoadArguments(void)
-{
- addHelp();
- addVersion();
- addRecording();
- addJob();
- addLogging();
-
- CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
- << add("--refresh-all", "refresh-all", false,
- "Batch update recorded program metadata. If a recording's "
- "rule has an inetref but the recording does not, it will "
- "be inherited.", "")
- << add("--refresh-rules", "refresh-rules", false,
- "Also update inetref for recording rules when metadata is "
- "found for a recording (Best effort only, imperfect)", "")
- << add("--refresh-all-rules", "refresh-all-rules", false,
- "Batch update metadata for recording rules. This will "
- "set inetrefs for your recording rules based on an automated "
- "lookup. This is a best effort, and not guaranteed! If your "
- "recordings lack inetrefs but one is found for the rule, it "
- "will be inherited.", "")
- << add("--refresh-all-artwork", "refresh-all-artwork", false,
- "Batch update artwork for non-generic recording rules "
- "and recordings. This is a more conservative option "
- "which only operates on items for which it is likely "
- "to be able to find artwork. This option will not "
- "overwrite any existing artwork.", "")
- << add("--refresh-all-artwork-dangerously",
- "refresh-all-artwork-dangerously", false,
- "Batch update artwork for ALL recording rules and recordings. "
- "This will attempt to download fanart, coverart, and banner "
- "for each season of each recording rule and all recordings. "
- "This option will not overwrite any existing artwork. If a "
- "rule or recording has not been looked up, this will attempt "
- "to look it up. This is a very aggressive option! Use with "
- "care.", "") );
-}
-
int main(int argc, char *argv[])
{
MythMetadataLookupCommandLineParser cmdline;
@@ -14,6 +14,6 @@ INSTALLS = target
QMAKE_CLEAN += $(TARGET)
# Input
-HEADERS += lookup.h
-SOURCES += main.cpp lookup.cpp
+HEADERS += lookup.h commandlineparser.h
+SOURCES += main.cpp lookup.cpp commandlineparser.cpp

0 comments on commit d4ccef8

Please sign in to comment.