mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 09:03:40 +02:00
2017-10-14 Fred Gleason <fredg@paravelsystems.com>
* Implemented a '%r' wildcard for Rivendell Host Name.
This commit is contained in:
@@ -34,6 +34,7 @@ MainObject::MainObject(QObject *parent)
|
||||
{
|
||||
QString date="";
|
||||
QString datetime="";
|
||||
QString service="";
|
||||
|
||||
//
|
||||
// Read Command Options
|
||||
@@ -50,6 +51,10 @@ MainObject::MainObject(QObject *parent)
|
||||
datetime=cmd->value(i);
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(cmd->key(i)=="--service") {
|
||||
service=cmd->value(i);
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(!cmd->processed(i)) {
|
||||
fprintf(stderr,"datedecode_test: unknown option \"%s\"\n",
|
||||
(const char *)cmd->value(i));
|
||||
@@ -67,15 +72,23 @@ MainObject::MainObject(QObject *parent)
|
||||
exit(256);
|
||||
}
|
||||
|
||||
//
|
||||
// Open Config
|
||||
//
|
||||
RDConfig *config=new RDConfig();
|
||||
config->load();
|
||||
|
||||
//
|
||||
// Process Code
|
||||
//
|
||||
if(!date.isEmpty()) {
|
||||
printf("%s\n",
|
||||
(const char *)RDDateDecode(date,QDate::currentDate()));
|
||||
(const char *)RDDateDecode(date,QDate::currentDate(),config,
|
||||
service));
|
||||
}
|
||||
if(!datetime.isEmpty()) {
|
||||
printf("%s\n",(const char *)RDDateTimeDecode(datetime,QDateTime(QDate::currentDate(),QTime::currentTime())));
|
||||
printf("%s\n",(const char *)RDDateTimeDecode(datetime,
|
||||
QDateTime(QDate::currentDate(),QTime::currentTime()),config,service));
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
#define DATEDECODE_TEST_USAGE "[options]\n\nTest the Rivendell date decoding routines\n\nOptions are:\n--date=<date-code>\n Decode the <date-code> string using RDDateDecode() and print the result\n on stdout.\n\n--datetime=<datetime-code>\n Decode the <datetime-code> string using RDDateTimeDecode() and print\n the result on stdout.\n\n"
|
||||
#define DATEDECODE_TEST_USAGE "[options]\n\nTest the Rivendell date decoding routines\n\nOptions are:\n--date=<date-code>\n Decode the <date-code> string using RDDateDecode() and print the result\n on stdout.\n\n--datetime=<datetime-code>\n Decode the <datetime-code> string using RDDateTimeDecode() and print\n the result on stdout.\n\n--service=<svc-name>\n Service name to use.\n\n"
|
||||
|
||||
class MainObject : public QObject
|
||||
{
|
||||
|
Reference in New Issue
Block a user