00001
00002 using namespace std;
00003
00004 #include <QString>
00005
00006 #include "mythcorecontext.h"
00007 #include "commandlineparser.h"
00008
00009 MythShutdownCommandLineParser::MythShutdownCommandLineParser() :
00010 MythCommandLineParser(MYTH_APPNAME_MYTHSHUTDOWN)
00011 { LoadArguments(); }
00012
00013 void MythShutdownCommandLineParser::LoadArguments(void)
00014 {
00015 add("-l", "oldlock", false, "disable shutdown", "")
00016 ->SetRemoved("Please use the full argument '--lock' instead.");
00017
00018 addHelp();
00019 addVersion();
00020 addLogging();
00021
00022 CommandLineArg::AllowOneOf( QList<CommandLineArg*>()
00023 << add(QStringList( QStringList() << "-w" << "--setwakeup" ),
00024 "setwakeup", "",
00025 "Set the wakeup time (yyyy-MM-ddThh:mm:ss)", "")
00026 << add(QStringList( QStringList() << "-t" << "--setscheduledwakeup" ),
00027 "setschedwakeup", false,
00028 "Set wakeup time to the next scheduled recording", "")
00029 << add(QStringList( QStringList() << "-q" << "--shutdown" ),
00030 "shutdown", false,
00031 "Apply wakeup time to nvram and shutdown.", "")
00032 << add(QStringList( QStringList() << "-x" << "--safeshutdown" ),
00033 "safeshutdown", false,
00034 "Check if shutdown is possible, and shutdown", "")
00035 << add(QStringList( QStringList() << "-p" << "--startup" ),
00036 "startup", false,
00037 "Check startup status",
00038 "Check startup status\n"
00039 " returns 0 - automatic startup\n"
00040 " 1 - manual startup")
00041 << add(QStringList( QStringList() << "-c" << "--check" ),
00042 "check", 1,
00043 "Check whether shutdown is possible",
00044 "Check whether shutdown is possible depending on input\n"
00045 " input 0 - dont check recording status\n"
00046 " 1 - do check recording status\n\n"
00047 " returns 0 - ok to shut down\n"
00048 " 1 - not ok, idle check reset")
00049 << add("--lock" , "lock", false, "disable shutdown", "")
00050 << add(QStringList( QStringList() << "-u" << "--unlock" ),
00051 "unlock", false,
00052 "enable shutdown", "")
00053 << add(QStringList( QStringList() << "-s" << "--status" ),
00054 "status", 1,
00055 "check current status",
00056 "check current status depending on input\n"
00057 " input 0 - dont check recording status\n"
00058 " 1 - do check recording status\n\n"
00059 " returns 0 - Idle\n"
00060 " 1 - Transcoding\n"
00061 " 2 - Commercial Detection\n"
00062 " 4 - Grabbing EPG data\n"
00063 " 8 - Recording (only valid if input=1)\n"
00064 " 16 - Locked\n"
00065 " 32 - Jobs running or pending\n"
00066 " 64 - In daily wakeup/shutdown period\n"
00067 " 128 - Less than 15 minutes to next wakeup period\n"
00068 " 255 - Setup is running") );
00069 }
00070