Skip to content

Commit

Permalink
Merge branch 'jb48218' into 'master'
Browse files Browse the repository at this point in the history
[vault] Add getter for option value. Contributes to JB#48218

See merge request mer-core/vault!13
  • Loading branch information
MikeSalmela committed Dec 12, 2019
2 parents 9ae3a60 + 4b18408 commit 2bbd9a4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions lib/unit.cpp
Expand Up @@ -509,6 +509,9 @@ int execute(QVariantMap const &info)
} catch (error::Error const &e) {
qCDebug(lcBackup) << e;
return 1;
} catch (std::exception const &e) {
qCDebug(lcBackup) << e.what();
return 2;
}
return 0;
}
Expand All @@ -527,4 +530,16 @@ int runProcess(const QString &program, const QStringList &args)
return 0;
}

QString optValue(const QString &arg)
{
try {
return getopt()->value(arg);
} catch (error::Error const &e) {
qCDebug(lcBackup) << e;
} catch (std::exception const & e) {
qCDebug(lcBackup) << e.what();
}
return QString();
}

}} // namespace vault::unit
2 changes: 2 additions & 0 deletions lib/unit.h
Expand Up @@ -25,6 +25,8 @@ int execute(QVariantMap const &info);

int runProcess(const QString &program, const QStringList &args);

QString optValue(const QString &arg);

}}

#endif // _CUTES_UNIT_HPP_
2 changes: 1 addition & 1 deletion rpm/vault.spec
@@ -1,6 +1,6 @@
Summary: Incremental backup/restore framework
Name: vault
Version: 1.0.1
Version: 1.0.2
Release: 1
License: LGPLv2
Group: Development/Libraries
Expand Down

0 comments on commit 2bbd9a4

Please sign in to comment.