return ZYPPER_EXIT_ERR_PRIVILEGES;
}
+ // too many arguments
+ if (arguments.size() > 2)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
+ }
+
// indeterminate indicates the user has not specified the values
tribool enabled(indeterminate);
tribool refresh(indeterminate);
{
cerr << _("Required argument missing.") << endl;
ERR << "Required argument missing." << endl;
+ cout_n << _("Usage") << ':' << endl;
cout_n << specific_help;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
+ // too many arguments
+ //! \todo allow to specify multiple repos to delete
+ else if (arguments.size() > 1)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
+ }
+
warn_if_zmd ();
bool found = remove_repo(arguments[0]);
cout_n << specific_help;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
+ // too many arguments
+ else if (arguments.size() > 2)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
+ }
// cond_init_target ();
warn_if_zmd ();
cout_n << specific_help;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
+ // too many arguments
+ if (arguments.size() > 1)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
+ }
modify_repo(arguments[0]);
}
{
ZyppSearchOptions options;
- if (ghelp) {
+ if (ghelp)
+ {
cout << specific_help;
- return !ghelp;
+ return ZYPPER_EXIT_OK;
}
if (gSettings.disable_system_resolvables || copts.count("uninstalled-only"))
// TODO: rug summary
else if (command == ZypperCommand::PATCH_CHECK) {
- if (ghelp) {
+ if (ghelp)
+ {
cout << specific_help;
- return !ghelp;
+ return ZYPPER_EXIT_OK;
+ }
+
+ // too many arguments
+ if (arguments.size() > 0)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
cond_init_target ();
// --------------------------( patches )------------------------------------
else if (command == ZypperCommand::SHOW_PATCHES) {
- if (ghelp) {
+ if (ghelp)
+ {
cout << specific_help;
- return !ghelp;
+ return ZYPPER_EXIT_OK;
+ }
+
+ // too many arguments
+ if (arguments.size() > 0)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
cond_init_target ();
// --------------------------( list updates )-------------------------------
else if (command == ZypperCommand::LIST_UPDATES) {
- if (ghelp) {
- // FIXME catalog...
+ if (ghelp)
+ {
cout << specific_help;
- return !ghelp;
+ return ZYPPER_EXIT_OK;
+ }
+
+ // too many arguments
+ if (arguments.size() > 0)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
string skind = copts.count("type")? copts["type"].front() :
// -----------------( xml list updates and patches )------------------------
else if (command == ZypperCommand::XML_LIST_UPDATES_PATCHES) {
-
- if (ghelp) { cout << specific_help << endl; return !ghelp; }
+ if (ghelp)
+ {
+ cout << specific_help;
+ return ZYPPER_EXIT_OK;
+ }
cond_init_target ();
int initret = init_repos();
// -----------------------------( update )----------------------------------
else if (command == ZypperCommand::UPDATE) {
- if (ghelp) { cout << specific_help; return !ghelp; }
+ if (ghelp)
+ {
+ cout << specific_help;
+ return ZYPPER_EXIT_OK;
+ }
// check root user
if (geteuid() != 0)
return ZYPPER_EXIT_ERR_PRIVILEGES;
}
+ // too many arguments
+ if (arguments.size() > 0)
+ {
+ report_too_many_arguments(specific_help);
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
+ }
+
// rug compatibility code
// switch on non-interactive mode if no-confirm specified
if (copts.count("no-confirm"))
else if (command == ZypperCommand::INFO ||
command == ZypperCommand::RUG_PATCH_INFO) {
- if (ghelp || arguments.size() == 0) {
- cerr << specific_help;
- return !ghelp;
+ if (ghelp)
+ {
+ cout << specific_help;
+ return ZYPPER_EXIT_OK;
+ }
+
+ if (arguments.size() < 1)
+ {
+ cerr << _("Required argument missing.") << endl;
+ ERR << "Required argument missing." << endl;
+ cout_n << _("Usage") << ':' << endl;
+ cout_n << specific_help;
+ return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
cond_init_target ();