Project

General

Profile

Actions

Feature #9960

closed

Add support for GNU --long options

Added by jaalto (Jari Aalto) almost 10 years ago. Updated almost 10 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:63244]

Description

Please consider adding GNU --long option equivalents. Notes:

  • Prefer uppercase "V" for version, as small "v" is customarily user for --verbose.
  • Change word "switches" into more commonly used "options" word in USAGE line.

SUGGESTIONS

Usage: ruby [switches] [--] [programfile] [arguments]
  -0[octal]       specify record separator (\0, if no argument)

  -a, --autosplit
        autosplit mode with -n or -p (splits $_ into $F)

  -c, --check
        check syntax only

  -Cdirectory, --directory DIRECTORY
        cd to directory before executing your script

  -d, --debug
        set debugging flags (set $DEBUG to true)

  -e 'command', --eval
        one line of script. Several -e's allowed. Omit [programfile]

  -Eex[:in], --encoding [EXTERNAL:INTERNAL]       
        specify the default external and internal character encodings

  -Fpattern, --autosplit-pattern PATTERN
        split() pattern for autosplit (-a)

  -i[extension], --in-place [EXTENSION]
        edit ARGV files in place (make backup if extension supplied)

  -Idirectory, --include DIRECTORY
        specify $LOAD_PATH directory (may be used more than once)

  -l, --eol-processing
        enable line ending processing

  -n, --autoloop-noprint
        assume 'while gets(); ... end' loop around your script

  -p, --autoloop
        assume loop like -n but print line also like sed

  -rlibrary, --require LIBRARY
        require the library before executing your script

  -s, --switch-parse
        enable some switch parsing for switches after script name

  -S, --search-path
        look for the script using PATH environment variable

  -T[level=1], --taint [NUMBER]
        turn on tainting checks

  -V, --version
        print version number, then turn on verbose mode

  -w, --warning
        turn warnings on for your script

  -W[level=2], --warning-level [NUMBER]
        set warning level; 0=silence, 1=medium, 2=verbose

  -x[directory], --extract [DIRECTORY]
        strip off text before #!ruby line and perhaps cd to directory

  -h, --help
        show this message, --help for more info

Updated by jaalto (Jari Aalto) almost 10 years ago

[With markup]

Please consider adding GNU --long option equivalents. Notes:

  • Prefer uppercase "V" for version, as small "v" is customarily user for --verbose.
  • Change word "switches" into more commonly used "options" word in USAGE line.

SUGGESTIONS

Usage: ruby [switches] [--] [programfile] [arguments]
  -0[octal]       specify record separator (\0, if no argument)

  -a, --autosplit
        autosplit mode with -n or -p (splits $_ into $F)

  -c, --check
        check syntax only

  -Cdirectory, --directory DIRECTORY
        cd to directory before executing your script

  -d, --debug
        set debugging flags (set $DEBUG to true)

  -e 'command', --eval
        one line of script. Several -e's allowed. Omit [programfile]

  -Eex[:in], --encoding [EXTERNAL:INTERNAL]       
        specify the default external and internal character encodings

  -Fpattern, --autosplit-pattern PATTERN
        split() pattern for autosplit (-a)

  -i[extension], --in-place [EXTENSION]
        edit ARGV files in place (make backup if extension supplied)

  -Idirectory, --include DIRECTORY
        specify $LOAD_PATH directory (may be used more than once)

  -l, --eol-processing
        enable line ending processing

  -n, --autoloop-noprint
        assume 'while gets(); ... end' loop around your script

  -p, --autoloop
        assume loop like -n but print line also like sed

  -rlibrary, --require LIBRARY
        require the library before executing your script

  -s, --switch-parse
        enable some switch parsing for switches after script name

  -S, --search-path
        look for the script using PATH environment variable

  -T[level=1], --taint [NUMBER]
        turn on tainting checks

  -V, --version
        print version number, then turn on verbose mode

  -w, --warning
        turn warnings on for your script

  -W[level=2], --warning-level [NUMBER]
        set warning level; 0=silence, 1=medium, 2=verbose

  -x[directory], --extract [DIRECTORY]
        strip off text before #!ruby line and perhaps cd to directory

  -h, --help
        show this message, --help for more info

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback
  • Priority changed from Normal to 3

Jari Aalto wrote:

Please consider adding GNU --long option equivalents. Notes:

  • Prefer uppercase "V" for version, as small "v" is customarily user for --verbose.

What do you mean by "customarily user"?
Options for ruby cannot be customized by users.

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

Jari Aalto wrote:

  • Prefer uppercase "V" for version, as small "v" is customarily user for --verbose.

'-v' is verbose option now.

Updated by avit (Andrew Vit) almost 10 years ago

@nobu (Nobuyoshi Nakada) "customarily" means "commonly" (English noun "a custom" vs. adjective "custom": a traditional and widely accepted way of behaving or doing something that is specific to a particular society, place, or time)

It is true that most often -v means --verbose and -V means --version but it's not consistent, and not sure it's worth changing now.

Updated by mame (Yusuke Endoh) almost 10 years ago

Prefer uppercase "V" for version, as small "v" is customarily user for --verbose.

I don't think the convention is common. I investigated some compilers and interpreters:

-v users:

  • ruby: -v, --version
  • perl: -v, -version, --version
  • lua: -v
  • php: -v, --version
  • guile: -v, --version
  • gst: -v, -version, --version
  • coffee: -v, -version, --version
  • gforth: -v, -version, --version
  • groovy: -v, -version, --version
  • nodejs: -v, --version
  • ocamlc: -v, -version, -vnum
  • octave: -v, -version, --version
  • pike: -v, --version, -version
  • tcc: -v, -version

-V users:

  • python: -V, --version
  • gosh: -V
  • iverilog: -V
  • gawk: -V --version
  • cobc: -V, -version, --version
  • ghc: -V, --version
  • icont: -V
  • parrot: -V, --version

others that do not use -V nor -v:

  • scala: -version
  • valac: --version
  • gcc: --version
  • mcs: --version
  • clisp: --version
  • gfortran: --version
  • javac: -version
  • fpc: -iV
  • R: --version

Especially, some GNU projects (guile, GNU Smalltalk, and gforth) use "V" for verbose, and "v" for version.

--
Yusuke Endoh

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0