Commit be4c5997 authored by Aard's avatar Aard

[ssucli] Expose domain for use in scripts

parent 9fcbd9dd
......@@ -38,6 +38,23 @@ void RndSsuCli::handleResponse(){
}
}
void RndSsuCli::optDomain(QStringList opt){
QTextStream qout(stdout);
if (opt.count() == 3 && opt.at(2) == "-s"){
qout << ssu.domain();
state = Idle;
} else if (opt.count() == 3){
qout << "Changing domain from " << ssu.domain()
<< " to " << opt.at(2) << endl;
ssu.setDomain(opt.at(2));
state = Idle;
} else if (opt.count() == 2) {
qout << "Device domain is currently: " << ssu.domain() << endl;
state = Idle;
}
}
void RndSsuCli::optFlavour(QStringList opt){
QTextStream qout(stdout);
......@@ -475,7 +492,8 @@ void RndSsuCli::run(){
optRelease(arguments);
else if (arguments.at(1) == "update" || arguments.at(1) == "up")
optUpdateCredentials(arguments);
else if (arguments.at(1) == "domain")
optDomain(arguments);
// functions that need to wait for a response from ssu should set a flag so
// we can do default exit catchall here
if (state == Idle)
......
......@@ -30,6 +30,7 @@ class RndSsuCli: public QObject {
int state;
void usage();
void uidWarning(QString message="");
void optDomain(QStringList opt);
void optFlavour(QStringList opt);
void optMode(QStringList opt);
void optModel(QStringList opt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment