Issue #13849 has been updated by sonots (Naotoshi Seo).



version, copyright, usage, help, yydebug, syntax, parsetree, parsetree_with_comment, insns are available as an argument of --dump option.
I now wonder which I should support. I want yydebug, parsetree, and insns (parsetree_with_comment is too long to show in help?)
Any opinions?

```
diff --git a/ruby.c b/ruby.c
index f2f3c86e09..808a2bdce6 100644
--- a/ruby.c
+++ b/ruby.c
@@ -191,7 +191,7 @@ static struct {
 static void
 show_usage_line(const char *str, unsigned int namelen, unsigned int secondlen, int help)
 {
-    const unsigned int w = 16;
+    const unsigned int w = 17;
     const int wrap = help && namelen + secondlen - 2 > w;
     printf("  %.*s%-*.*s%-*s%s\n", namelen-1, str,
           (wrap ? 0 : w - namelen + 1),
@@ -238,6 +238,9 @@ usage(const char *name, int help)
        M("-W[level=2]",   "",                     "set warning level; 0=silence, 1=medium, 2=verbose"),
        M("-x[directory]", "",                     "strip off text before #!ruby line and perhaps cd to directory"),
        M("-h",            "",                     "show this message, --help for more info"),
+       M("--dump=insns",     "",                          "dump YARV instructions"),
+       M("--dump=yydebug",   "",                          "dump yydebug of yacc parser generator"),
+       M("--dump=parsetree", "",                          "dump parsetree"),
     };
     static const struct message help_msg[] = {
        M("--copyright",                   "", "print the copyright"),
``

----------------------------------------
Feature #13849: Show --dump options in help
https://bugs.ruby-lang.org/issues/13849#change-66331

* Author: sonots (Naotoshi Seo)
* Status: Open
* Priority: Normal
* Assignee: sonots (Naotoshi Seo)
* Target version: next minor
----------------------------------------
Current help does not show any helps for --dump options such as --dump=insns.
I want to get them.

```
$ ./ruby --help
Usage: ./ruby [switches] [--] [programfile] [arguments]
  -0[octal]       specify record separator (\0, if no argument)
  -a              autosplit mode with -n or -p (splits $_ into $F)
  -c              check syntax only
  -Cdirectory     cd to directory before executing your script
  -d, --debug     set debugging flags (set $DEBUG to true)
  -e 'command'    one line of script. Several -e's allowed. Omit [programfile]
  -Eex[:in], --encoding=ex[:in]
                  specify the default external and internal character encodings
  -Fpattern       split() pattern for autosplit (-a)
  -i[extension]   edit ARGV files in place (make backup if extension supplied)
  -Idirectory     specify $LOAD_PATH directory (may be used more than once)
  -l              enable line ending processing
  -n              assume 'while gets(); ... end' loop around your script
  -p              assume loop like -n but print line also like sed
  -rlibrary       require the library before executing your script
  -s              enable some switch parsing for switches after script name
  -S              look for the script using PATH environment variable
  -T[level=1]     turn on tainting checks
  -v, --verbose   print version number, then turn on verbose mode
  -w              turn warnings on for your script
  -W[level=2]     set warning level; 0=silence, 1=medium, 2=verbose
  -x[directory]   strip off text before #!ruby line and perhaps cd to directory
  --copyright     print the copyright
  --enable=feature[,...], --disable=feature[,...]
                  enable or disable features
  --external-encoding=encoding, --internal-encoding=encoding
                  specify the default external or internal character encoding
  --version       print the version
  --help          show this message, -h for short message
Features:
  gems            rubygems (default: enabled)
  did_you_mean    did_you_mean (default: enabled)
  rubyopt         RUBYOPT environment variable (default: enabled)
  frozen-string-literal
                  freeze all string literals (default: disabled)
```




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>