Re: GNU's /bin/true

"Amit Aronovitch" <[email protected]> Sun, 24 Feb 2008 02:46:29 +0200
Newsgroups gmane.culture.hackers.israel
Message-ID <[email protected]>
On Sat, Feb 23, 2008 at 10:51 AM, Shlomi Fish <shlomif-ik1l9ssToec+JF/[email protected]> wrote:
> Hi all.
>
>  Inspired by the bit about the Solaris true here:
>
>  http://thedailywtf.com/Articles/The-Comcast-Bill,-A-Buggy-Traffic-Light,-and-More.aspx
>
>  I decided to see how my GNU/Linux's /bin/true is all about. "less /bin/true"
>  indicated it was a binary executable and had many symbols to show for
>  (including many printf-formats). And:
>
>  <<<<
>  $ ls -l /bin/true
>  -rwxr-xr-x 1 root root 23468 2008-01-29 13:21 /bin/true
>  >>>>
>
>  I wondered why it should be so large, given all it had to do was "return 0;",
>  and so I did "man true":
>
>  <<<<<<<<<<<<<<
>  NAME
>        true - do nothing, successfully
>
>  SYNOPSIS
>        true [ignored command line arguments]
>        true OPTION
>
>  DESCRIPTION
>        Exit with a status code indicating success.
>
>        --help display this help and exit
>
>        --version
>               output version information and exit
>
>        NOTE: your shell may have its own version of true, which usually super‐
>        sedes the version described here.  Please refer to your  shell's  docu‐
>        mentation for details about the options it supports.
>  >>>>>>>>>>>>>
>
>  I laughed quite a bit seeing it accepts some command-line arguments.
>

Funny or not - it has to. Thats the GNU Coding Standards for you...

http://www.gnu.org/prep/standards/standards.html#Command_002dLine-Interfaces

Sec. 4.7: "... All programs should support two standard options:
'--version' and '--help'. ..."