Commit e794d8cb authored by Bernd Wachter's avatar Bernd Wachter

Fix accidental commit of rndssucli, add force option for update

parent a3925211
......@@ -33,12 +33,7 @@ void RndSsuCli::run(){
QStringList arguments = QCoreApplication::arguments();
if (arguments.count() >= 2){
usage();
return;
}
if (arguments.at(1) == "register"){
if (arguments.at(1) == "register" && arguments.count() == 2){
QString username, password;
QTextStream qin(stdin);
......@@ -48,12 +43,16 @@ void RndSsuCli::run(){
password = qin.readLine();
ssu.sendRegistration(username, password);
} else if (arguments.at(1) == "update"){
} else if (arguments.at(1) == "update" &&
(arguments.count() == 2 || arguments.count() == 3)){
if (!ssu.isRegistered()){
qout << "Device is not registered, can't update credentials" << endl;
QCoreApplication::exit(1);
} else {
ssu.updateCredentials();
bool force = false;
if (arguments.count() == 3 && arguments.at(2) == "-f")
force = true;
ssu.updateCredentials(force);
}
} else if (arguments.at(1) == "resolve"){
QString repo;
......@@ -67,12 +66,11 @@ void RndSsuCli::run(){
if (arguments.count() >= 3){
//qout << (arguments.at(3).compare("false")||arguments.at(3).compare("0"));
qout << (arguments.at(3).compare("false"));
}
qout << ssu.repoUrl(arguments.at(2));
QCoreApplication::exit(1);
} else if (arguments.at(1) == "status"){
} else if (arguments.at(1) == "status" && arguments.count() == 2){
qout << "Device registration status: "
<< (ssu.isRegistered() ? "registered" : "not registered") << endl;
qout << "Device family: " << ssu.deviceFamily() << endl;
......@@ -86,6 +84,6 @@ void RndSsuCli::run(){
void RndSsuCli::usage(){
QTextStream qout(stdout);
qout << "Usage: rndssu register|update|status" << endl;
qout << "Usage: rndssu register|update [-f]|status" << endl;
QCoreApplication::exit(1);
}
* Mon Mar 11 2013 Bernd Wachter <bernd.wachter@jollamobile.com> - 0.23
- Add force option to rndssu update
* Mon Mar 11 2013 Bernd Wachter <bernd.wachter@jollamobile.com> - 0.22
- Add systemd logging to core library
- Move zypper plugin logging to core library
......
Name: ssu
Version: 0.22
Version: 0.23
Release: 1
Summary: SSU enabler for RND
Group: System/Base
......
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