return 1;
}
+ ResObject::Kind kind;
+
+
// --------------------------( service list )-------------------------------
if (command == "service-list" || command == "sl")
// --------------------------( service add )--------------------------------
- if (command == "service-add" || command == "sa")
+ else if (command == "service-add" || command == "sa")
{
if (copts.count("disabled")) {
cerr_v << "FAKE Disabled" << endl;
// --------------------------( service delete )-----------------------------
- if (command == "service-delete" || command == "sd")
+ else if (command == "service-delete" || command == "sd")
{
if (help || arguments.size() < 1) {
cerr << "service-delete [options] <URI|alias>\n"
// --------------------------( service rename )-----------------------------
- if (command == "service-rename" || command == "sr")
+ else if (command == "service-rename" || command == "sr")
{
if (help || arguments.size() < 2) {
cerr << "service-rename [options] <URI|alias> <new-alias>\n"
// --------------------------( refresh )------------------------------------
- if (command == "refresh" || command == "ref") {
+ else if (command == "refresh" || command == "ref") {
if (help || copts.count("help")) {
cerr << specific_help;
return !help;
refresh_sources();
}
+ // --------------------------( remove/install )-----------------------------
- ResObject::Kind kind;
+ else if (command == "install" || command == "in" ||
+ command == "remove" || command == "rm") {
- // --------------------------( remove/install )-----------------------------
-
- if (command == "install" || command == "in") {
- if (help || arguments.size() < 1) {
- cerr << "install [options] name...\n"
- << specific_help
- ;
- return !help;
- }
-
- gData.packages_to_install = arguments;
- }
- if (command == "remove" || command == "rm") {
- if (help || arguments.size() < 1) {
- cerr << "remove [options] name...\n"
- << specific_help
- ;
- return !help;
+ if (command == "install" || command == "in") {
+ if (help || arguments.size() < 1) {
+ cerr << "install [options] name...\n"
+ << specific_help
+ ;
+ return !help;
+ }
+
+ gData.packages_to_install = arguments;
}
- gData.packages_to_uninstall = arguments;
- }
+ if (command == "remove" || command == "rm") {
+ if (help || arguments.size() < 1) {
+ cerr << "remove [options] name...\n"
+ << specific_help
+ ;
+ return !help;
+ }
+
+ gData.packages_to_uninstall = arguments;
+ }
- if (command == "install" || command == "in" ||
- command == "remove" || command == "rm") {
string skind = copts.count("type")? copts["type"].front() : "package";
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << "Unknown resolvable type " << skind << endl;
- return 1;
+ cerr << "Unknown resolvable type " << skind << endl;
+ return 1;
}
cond_init_system_sources ();
// TODO -c, --catalog option
- if (command == "search" || command == "se") {
+ else if (command == "search" || command == "se") {
ZyppSearchOptions options;
if (help || copts.count("help")) {
// --------------------------( patch check )--------------------------------
// TODO: rug summary
- if (command == "patch-check" || command == "pchk") {
+ else if (command == "patch-check" || command == "pchk") {
if (help) {
cerr << "patch-check\n"
<< specific_help
// --------------------------( patches )------------------------------------
- if (command == "patches" || command == "pch") {
+ else if (command == "patches" || command == "pch") {
if (help) {
cerr << "patches\n"
<< specific_help
// --------------------------( list updates )-------------------------------
- if (command == "list-updates" || command == "lu") {
+ else if (command == "list-updates" || command == "lu") {
if (help) {
// FIXME catalog...
cerr << "list-updates [options]\n"
// -----------------------------( update )----------------------------------
- if (command == "update" || command == "up") {
+ else if (command == "update" || command == "up") {
if (help) {
cerr << "update [options]\n"
<< specific_help
// -----------------------------( info )------------------------------------
- if (command == "info" || command == "if" ||
- command == "patch-info") {
+ else if (command == "info" || command == "if" || command == "patch-info") {
if (help || copts.count("help")) {
cerr << specific_help;
return !help;
return 0;
}
+
+ else {
+ cerr << "Unknown command '" << command << "'." << endl << endl;
+ cerr << help_commands;
+ }
return 0;
}