[Bug 5612] New: --help returns an error code

bugzilla at busybox.net bugzilla at busybox.net
Fri Oct 19 15:47:47 UTC 2012


https://bugs.busybox.net/show_bug.cgi?id=5612

           Summary: --help returns an error code
           Product: Busybox
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Standard Compliance
        AssignedTo: unassigned at busybox.net
        ReportedBy: ra00103 at waxworlds.org
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


When running some (all?) busybox commands, via symlink or explicitly on the
command line, the "--help" command line argument is supported.  However, it
returns exit code 1, signaling an error.

For example,

  $ symlink -s /bin/busybox sort
  $ ./sort --help
  BusyBox v1.20.2 (Debian 1:1.20.0-7) multi-call binary.

  Usage: sort [-nrugMcszbdfimSTokt] [-o FILE] [-k start[.offset][opts
[,end[.offset][opts]] [-t CHAR] [FILE]...

  [...rest of output cut...]
  $ echo $?
  1

The --help command line argument isn't POSIX (as far as I know), it's a GNU
coding standard, which states that the exit code should be that of a success
[1].  Therefor, this is probably a bug.

Incidentally, when running busybox with no command and using --help, no error
is returned.

  $ busybox --help
  $ echo $?
  0

[1] http://www.gnu.org/prep/standards/standards.html#g_t_002d_002dhelp

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list