Author: jkupec Date: Thu Apr 17 22:30:50 2008 New Revision: 9690 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9690&view=rev Log: - rug global options added: - --debug -> alias for -vv - --no-abbrev - will be used to disable abbreviations in tables once they're used - --normal-output - this is the default, will be ignored 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=9690&r1=9689&r2=9690&view=diff ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Thu Apr 17 22:30:50 2008 @@ -264,7 +264,13 @@ {"verbose", no_argument, 0, 'v'}, {"quiet", no_argument, 0, 'q'}, {"version", no_argument, 0, 'V'}, + // rug compatibility alias for -vv + {"debug", no_argument, 0, 0 }, + // rug compatibility alias for the default output level => ignored + {"normal-output", no_argument, 0, 0 }, + // not implemented currently => ignored {"terse", no_argument, 0, 't'}, + {"no-abbrev", no_argument, 0, 0 }, {"table-style", required_argument, 0, 's'}, {"rug-compatible", no_argument, 0, 'r'}, {"non-interactive", no_argument, 0, 'n'}, @@ -294,13 +300,21 @@ parsed_opts::const_iterator it; + // ====== output setup ====== + // depends on global options, that's we set it up here + //! \todo create a default in the zypper constructor, recreate here. + // determine the desired verbosity int iverbosity = 0; - if (gopts.count("quiet")) { + //// --quiet + if (gopts.count("quiet")) + { _gopts.verbosity = iverbosity = -1; DBG << "Verbosity " << _gopts.verbosity << endl; } - if ((it = gopts.find("verbose")) != gopts.end()) { + //// --verbose + if ((it = gopts.find("verbose")) != gopts.end()) + { //! \todo if iverbosity is -1 now, say we conflict with -q _gopts.verbosity += iverbosity = it->second.size(); // _gopts.verbosity += gopts["verbose"].size(); @@ -315,11 +329,19 @@ default: verbosity = Out::DEBUG; } + //// --debug + // rug compatibility alias for -vv + if (gopts.count("debug")) + verbosity = Out::DEBUG; + // create output object + + //// --xml-out if (gopts.count("xmlout")) { _out_ptr = new OutXML(verbosity); _gopts.machine_readable = true; + _gopts.no_abbrev = true; } else _out_ptr = new OutNormal(verbosity); @@ -328,6 +350,29 @@ DBG << "Verbosity " << verbosity << endl; DBG << "Output type " << _out_ptr->type() << endl; + if (gopts.count("no-abbrev")) + _gopts.no_abbrev = true; + + if ((it = gopts.find("table-style")) != gopts.end()) + { + unsigned s; + str::strtonum (it->second.front(), s); + if (s < _End) + Table::defaultStyle = (TableStyle) s; + else + out().error(str::form(_("Invalid table style %d."), s), + str::form(_("Use an integer number from %d to %d"), 0, 8)); + } + + if (gopts.count("terse")) + { + _gopts.machine_readable = true; + _gopts.no_abbrev = true; + out().error("--terse is not implemented, does nothing"); + } + + // ======== other global options ======== + if (gopts.count("rug-compatible")) { _gopts.is_rug_compatible = true; @@ -356,15 +401,6 @@ MIL << "Entering no-gpg-checks mode" << endl; } - if ((it = gopts.find("table-style")) != gopts.end()) { - unsigned s; - str::strtonum (it->second.front(), s); - if (s < _End) - Table::defaultStyle = (TableStyle) s; - else - out().error(boost::str(format(_("Invalid table style %s")) % s) /** \todo hint */); - } - if ((it = gopts.find("root")) != gopts.end()) { _gopts.root_dir = it->second.front(); Pathname tmp(_gopts.root_dir); @@ -401,12 +437,6 @@ DBG << "cache dir = " << _gopts.rm_options.repoCachePath << endl; DBG << "raw cache dir = " << _gopts.rm_options.repoRawCachePath << endl; - if (gopts.count("terse")) - { - _gopts.machine_readable = true; - out().error("--terse is not implemented, does nothing"); - } - if (gopts.count("disable-repositories")) { MIL << "Repositories disabled, using target only." << endl; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org