Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ssucli] Expose domain for use in scripts
  • Loading branch information
Bernd Wachter committed Jul 4, 2013
1 parent 9fcbd9d commit be4c599
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion rndssucli/rndssucli.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions rndssucli/rndssucli.h
Expand Up @@ -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);
Expand Down

0 comments on commit be4c599

Please sign in to comment.