[zypp-commit] r6351 - /trunk/zypper/src/zypper.cc
Author: jkupec
Date: Tue Jul 31 20:07:57 2007
New Revision: 6351
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6351&view=rev
Log:
- help texts consolidated
Modified:
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=6351&r1=6350&r2=6351&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Tue Jul 31 20:07:57 2007
@@ -58,21 +58,6 @@
DigestCallbacks digest_callbacks;
-static struct option global_options[] = {
- {"help", no_argument, 0, 'h'},
- {"verbose", no_argument, 0, 'v'},
- {"quiet", no_argument, 0, 'q'},
- {"version", no_argument, 0, 'V'},
- {"terse", no_argument, 0, 't'},
- {"table-style", required_argument, 0, 's'},
- {"rug-compatible", no_argument, 0, 'r'},
- {"non-interactive", no_argument, 0, 0},
- {"no-gpg-checks", no_argument, 0, 0},
- {"root", required_argument, 0, 'R'},
- {"opt", optional_argument, 0, 'o'},
- {0, 0, 0, 0}
-};
-
/**
* Constructor wrapper catching exceptions,
* returning an empty one on error.
@@ -90,28 +75,6 @@
return u;
}
-string help_commands = _(
- " Commands:\n"
- "\thelp\t\t\tHelp\n"
- "\tshell, sh\t\tAccept multiple commands at once\n"
- "\tinstall, in\t\tInstall packages or resolvables\n"
- "\tremove, rm\t\tRemove packages or resolvables\n"
- "\tsearch, se\t\tSearch for packages matching a pattern\n"
- "\trepos, lr\t\tList all defined repositories.\n"
- "\taddrepo, ar\t\tAdd a new repository\n"
- "\tremoverepo, rr\t\tRemove specified repository\n"
- "\trenamerepo, nr\t\tRename specified repository\n"
- "\tmodifyrepo, mr\t\tModify specified repository\n"
- "\trefresh, ref\t\tRefresh all repositories\n"
- "\tpatch-check, pchk\tCheck for patches\n"
- "\tpatches, pch\t\tList patches\n"
- "\tlist-updates, lu\tList updates\n"
- "\txml-updates, xu\t\tList updates and patches in xml format\n"
- "\tupdate, up\t\tUpdate installed resolvables with newer versions.\n"
- "\tinfo, if\t\tShow full information for packages\n"
- "\tpatch-info\t\tShow full information for patches\n"
- "");
-
bool ghelp = false;
/*
@@ -122,11 +85,60 @@
*/
ZypperCommand process_globals(int argc, char **argv)
{
- // global options
+ static struct option global_options[] = {
+ {"help", no_argument, 0, 'h'},
+ {"verbose", no_argument, 0, 'v'},
+ {"quiet", no_argument, 0, 'q'},
+ {"version", no_argument, 0, 'V'},
+ {"terse", no_argument, 0, 't'},
+ {"table-style", required_argument, 0, 's'},
+ {"rug-compatible", no_argument, 0, 'r'},
+ {"non-interactive", no_argument, 0, 0},
+ {"no-gpg-checks", no_argument, 0, 0},
+ {"root", required_argument, 0, 'R'},
+ {"opt", optional_argument, 0, 'o'},
+ {"disable-system-resolvables", optional_argument, 0, 'o'},
+ {0, 0, 0, 0}
+ };
+
+ // parse global options
gopts = parse_options (argc, argv, global_options);
if (gopts.count("_unknown"))
return ZypperCommand::NONE;
- //return "_unknown";
+
+ static string help_global_options = _(" Options:\n"
+ "\t--help, -h\t\tHelp.\n"
+ "\t--version, -V\t\tOutput the version number.\n"
+ "\t--quiet, -q\t\tSuppress normal output, print only error messages.\n"
+ "\t--verbose, -v\t\tIncrease verbosity.\n"
+ "\t--terse, -t\t\tTerse output for machine consumption.\n"
+ "\t--table-style, -s\tTable style (integer).\n"
+ "\t--rug-compatible, -r\tTurn on rug compatibility.\n"
+ "\t--non-interactive\tDon't ask anything, use default answers automatically.\n"
+ "\t--no-gpg-checks\t\tIgnore GPG check failures and continue.\n"
+ "\t--root, -R <dir>\tOperate on a different root directory.\n");
+
+ static string help_commands = _(
+ " Commands:\n"
+ "\thelp\t\t\tHelp\n"
+ "\tshell, sh\t\tAccept multiple commands at once\n"
+ "\tinstall, in\t\tInstall packages or resolvables\n"
+ "\tremove, rm\t\tRemove packages or resolvables\n"
+ "\tsearch, se\t\tSearch for packages matching a pattern\n"
+ "\trepos, lr\t\tList all defined repositories.\n"
+ "\taddrepo, ar\t\tAdd a new repository\n"
+ "\tremoverepo, rr\t\tRemove specified repository\n"
+ "\trenamerepo, nr\t\tRename specified repository\n"
+ "\tmodifyrepo, mr\t\tModify specified repository\n"
+ "\trefresh, ref\t\tRefresh all repositories\n"
+ "\tpatch-check, pchk\tCheck for patches\n"
+ "\tpatches, pch\t\tList patches\n"
+ "\tlist-updates, lu\tList updates\n"
+ "\txml-updates, xu\t\tList updates and patches in xml format\n"
+ "\tupdate, up\t\tUpdate installed resolvables with newer versions.\n"
+ "\tinfo, if\t\tShow full information for packages\n"
+ "\tpatch-info\t\tShow full information for patches\n"
+ "");
if (gopts.count("rug-compatible"))
gSettings.is_rug_compatible = true;
@@ -140,19 +152,6 @@
if (gopts.count("help"))
ghelp = true;
- string help_global_options = _(" Options:\n"
- "\t--help, -h\t\tHelp.\n"
- "\t--version, -V\t\tOutput the version number.\n"
- "\t--quiet, -q\t\tSuppress normal output, print only error messages.\n"
- "\t--verbose, -v\t\tIncrease verbosity.\n"
- "\t--terse, -t\t\tTerse output for machine consumption.\n"
- "\t--table-style, -s\tTable style (integer).\n"
- "\t--rug-compatible, -r\tTurn on rug compatibility.\n"
- "\t--non-interactive\tDon't ask anything, use default answers automatically.\n"
- "\t--no-gpg-checks\t\tIgnore GPG check failures and continue.\n"
- "\t--root, -R <dir>\tOperate on a different root directory.\n");
- ;
-
if (gopts.count("quiet")) {
gSettings.verbosity = -1;
DBG << "Verbosity " << gSettings.verbosity << endl;
@@ -189,7 +188,6 @@
gSettings.root_dir = gopts["root"].front();
}
-
// testing option
if (gopts.count("opt")) {
cout << "Opt arg: ";
@@ -333,18 +331,19 @@
{0, 0, 0, 0}
};
specific_options = service_add_options;
+ // TranslatorExplanation don't translate the repo types (well, the plaindir)
+ // since they must be used in their original shape
specific_help = _(
"addrepo (ar) [options] <URI> <alias>\n"
"\n"
- "Add repository specified by URI to the system and assing specified alias to it."
+ "Add repository specified by URI to the system and assing specified alias to it.\n"
"\n"
" Command options:\n"
- "\t--repo,-r
participants (1)
-
jkupec@svn.opensuse.org