Bug 214370 - app-portage/gentoolkit-0.2.4_rc3: revdep-rebuild should display error messages at beginning of output
Bug#: 214370 Product:  Portage Development Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: trivial Priority: P2
Resolution: FIXED Assigned To: tools-portage@gentoo.org Reported By: gentoo-bugs@allenjb.me.uk
Component: Tools
URL: 
Summary: app-portage/gentoolkit-0.2.4_rc3: revdep-rebuild should display error messages at beginning of output
Keywords:  InSVN
Status Whiteboard: 
Opened: 2008-03-23 14:01 0000
Description:   Opened: 2008-03-23 14:01 0000
When revdep-rebuild displays error messages (eg. unrecongnized parameter), it
displays it at the end of the output, below the help output. This is counter to
common practice and makes the error message hard to find. I believe that the
usability would be improved if the error message was displayed before the help
output.

It might also be an idea not to display the entire usage output automatically
for error messages at all. In my opinion, this information is easy enough to
find already and "hides" the error message. Perhaps add a message along the
lines of "see 'revdep-rebuild -h' for full usage information" to error messages
instead.

Current output:
$ revdep-rebuild -a
Usage: revdep-rebuild [OPTIONS] [--] [EMERGE_OPTIONS]

Broken reverse dependency rebuilder.

  -C, --nocolor        Turn off colored output
  -d, --debug          Print way too much information (uses bash's set -xv)
  -e, --exact          Emerge based on exact package version
  -h, --help           Print this usage
  -i, --ignore         Ignore temporary files from previous runs
  -k, --keep-temp      Do not delete temporary files on exit
  -L, --library NAME   Emerge existing packages that use the library with NAME
      --library=NAME   NAME can be a full path to the library or a basic
                       regular expression (man grep)
  -l, --no-ld-path     Do not set LD_LIBRARY_PATH
  -o, --no-order       Do not check the build order
                       (Saves time, but may cause breakage.)
  -p, --pretend        Do a trial run without actually emerging anything
                       (also passed to emerge command)
  -P, --no-progress    Turn off the progress meter
  -q, --quiet          Be less verbose (also passed to emerge command)
  -v, --verbose        Be more verbose (also passed to emerge command)
  -u, --no-util UTIL   Do not use features provided by UTIL
      --no-util=UTIL   UTIL can be one of portage-utils or pkgcore
                       or it can be a *quoted* space-delimited list.

Calls emerge, options after -- are ignored by revdep-rebuild
and passed directly to emerge.

Report bugs to <http://bugs.gentoo.org>

Encountered unrecognized option -a.

revdep-rebuild no longer automatically passes unrecognized options to portage.
Separate emerge-only options from revdep-rebuild options with the -- flag.


Expected output:
$ revdep-rebuild -a
Encountered unrecognized option -a.

revdep-rebuild no longer automatically passes unrecognized options to portage.
Separate emerge-only options from revdep-rebuild options with the -- flag.

Usage: revdep-rebuild [OPTIONS] [--] [EMERGE_OPTIONS]

Broken reverse dependency rebuilder.

  -C, --nocolor        Turn off colored output
  -d, --debug          Print way too much information (uses bash's set -xv)
  -e, --exact          Emerge based on exact package version
  -h, --help           Print this usage
  -i, --ignore         Ignore temporary files from previous runs
  -k, --keep-temp      Do not delete temporary files on exit
  -L, --library NAME   Emerge existing packages that use the library with NAME
      --library=NAME   NAME can be a full path to the library or a basic
                       regular expression (man grep)
  -l, --no-ld-path     Do not set LD_LIBRARY_PATH
  -o, --no-order       Do not check the build order
                       (Saves time, but may cause breakage.)
  -p, --pretend        Do a trial run without actually emerging anything
                       (also passed to emerge command)
  -P, --no-progress    Turn off the progress meter
  -q, --quiet          Be less verbose (also passed to emerge command)
  -v, --verbose        Be more verbose (also passed to emerge command)
  -u, --no-util UTIL   Do not use features provided by UTIL
      --no-util=UTIL   UTIL can be one of portage-utils or pkgcore
                       or it can be a *quoted* space-delimited list.

Calls emerge, options after -- are ignored by revdep-rebuild
and passed directly to emerge.

Report bugs to <http://bugs.gentoo.org>

------- Comment #1 From Michael A. Smith 2008-04-05 19:02:37 0000 -------
Created an attachment (id=148771) [details]
revdep-rebuild_unrecopts.patch

OK, I'm down with that. How's this patch against r485, too verbose?

------- Comment #2 From Paul Varner 2008-04-23 20:05:39 0000 -------
$ svn commit -m "Change error message to be clearer when unknown option is
passed. (Bug #214370)"
Sending        revdep-rebuild/revdep-rebuild
Transmitting file data .
Committed revision 487.

------- Comment #3 From Paul Varner 2008-04-24 02:32:56 0000 -------
Released in gentoolkit-0.2.4_rc4