You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Lars George (JIRA)" <ji...@apache.org> on 2011/05/26 13:47:47 UTC

[jira] [Created] (HBASE-3924) Improve Shell's CLI help

Improve Shell's CLI help
------------------------

                 Key: HBASE-3924
                 URL: https://issues.apache.org/jira/browse/HBASE-3924
             Project: HBase
          Issue Type: Improvement
          Components: shell
    Affects Versions: 0.90.3
            Reporter: Lars George
            Priority: Trivial
             Fix For: 0.90.4, 0.92.0


In the hirb.rb source we have

{noformat}
# so they don't go through to irb.  Output shell 'usage' if user types '--help'
cmdline_help = <<HERE # HERE document output as shell usage
HBase Shell command-line options:
 format        Formatter for outputting results: console | html.
Default: console
 -d | --debug  Set DEBUG log levels.
HERE
found = []
format = 'console'
script2run = nil
log_level = org.apache.log4j.Level::ERROR
for arg in ARGV
 if arg =~ /^--format=(.+)/i
   format = $1
   if format =~ /^html$/i
     raise NoMethodError.new("Not yet implemented")
   elsif format =~ /^console$/i
     # This is default
   else
     raise ArgumentError.new("Unsupported format " + arg)
   end
   found.push(arg)
 elsif arg == '-h' || arg == '--help'
   puts cmdline_help
   exit
 elsif arg == '-d' || arg == '--debug'
   log_level = org.apache.log4j.Level::DEBUG
   $fullBackTrace = true
   puts "Setting DEBUG log level..."
 else
   # Presume it a script. Save it off for running later below
   # after we've set up some environment.
   script2run = arg
   found.push(arg)
   # Presume that any other args are meant for the script.
   break
 end
end
{noformat}

We should enhance the help printed when using -h/--help to look like this?

{noformat}
cmdline_help = <<HERE # HERE document output as shell usage
HBase Shell command-line options:
 --format={console|html}        Formatter for outputting results.
Default: console
 -d | --debug  Set DEBUG log levels.
 -h | --help   This help.
 <script-filename> [<script-options>]
HERE
{noformat}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Lars Hofhansl (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176281#comment-13176281 ] 

Lars Hofhansl commented on HBASE-3924:
--------------------------------------

It's still a bit confusing I think.

How about something like?

{code}
Usage: HBase shell [OPTIONS] [SCRIPT [ARGUMENTS]]

 --format=OPTION                Formatter for outputting results.
                                Valid options are: console, html.
                                (Default: console)

 -d | --debug                   Set DEBUG log levels.
 -h | --help                    This help.
{code}

                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "stack (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176353#comment-13176353 ] 

stack commented on HBASE-3924:
------------------------------

+1 on patch.  SCRIPTFILE sounds better, yeah, and *HBase* shell is superfluous.  I don't think formatter other than console works but thats for another issue.
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3924) Improve Shell's CLI help

Posted by "Lars Hofhansl (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl updated HBASE-3924:
---------------------------------

      Resolution: Fixed
    Hadoop Flags: Reviewed
          Status: Resolved  (was: Patch Available)
    
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.94.0
>
>         Attachments: 3924.txt, HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3924) Improve Shell's CLI help

Posted by "Harsh J (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated HBASE-3924:
---------------------------

    Fix Version/s: 0.94.0
                   0.92.0
           Status: Patch Available  (was: Open)

Patch was against trunk, but should apply to both 0.92 and trunk. Would be good to have in a further 0.92 rev.
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Hadoop QA (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176182#comment-13176182 ] 

Hadoop QA commented on HBASE-3924:
----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12508673/HBASE-3924.patch
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    -1 javadoc.  The javadoc tool appears to have generated -151 warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    -1 findbugs.  The patch appears to introduce 77 new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

     -1 core tests.  The patch failed these unit tests:
                       org.apache.hadoop.hbase.regionserver.wal.TestLogRolling
                  org.apache.hadoop.hbase.mapred.TestTableMapReduce
                  org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat

Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/604//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/604//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/604//console

This message is automatically generated.
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13177002#comment-13177002 ] 

Hudson commented on HBASE-3924:
-------------------------------

Integrated in HBase-TRUNK-security #53 (See [https://builds.apache.org/job/HBase-TRUNK-security/53/])
    HBASE-3924  Improve Shell's CLI help (Harsh J)

larsh : 
Files : 
* /hbase/trunk/bin/hirb.rb

                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.94.0
>
>         Attachments: 3924.txt, HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13177087#comment-13177087 ] 

Harsh J commented on HBASE-3924:
--------------------------------

Lars,

Sorry for the late get back. Thanks for committing your changes in! :)
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.94.0
>
>         Attachments: 3924.txt, HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3924) Improve Shell's CLI help

Posted by "Lars Hofhansl (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl updated HBASE-3924:
---------------------------------

    Attachment: 3924.txt

This is what I committed to trunk.
(Don't think we should burden 0.92 with it)
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.94.0
>
>         Attachments: 3924.txt, HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3924) Improve Shell's CLI help

Posted by "Harsh J (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated HBASE-3924:
---------------------------

    Attachment: HBASE-3924.patch

Patch that addresses Lars' comments.

{code}
HBase Shell command-line options:
 <script-file> [script-options] Script to run, along with its arguments.

 --format=OPTION                Formatter for outputting results.
                                Valid options are: console, html.
                                (Default: console)

 -d | --debug                   Set DEBUG log levels.
 -h | --help                    This help.
{code}
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Lars Hofhansl (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176386#comment-13176386 ] 

Lars Hofhansl commented on HBASE-3924:
--------------------------------------

@Harsh J: do you want to update the patch? I'm happy to do that as part of the commit.

                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176299#comment-13176299 ] 

Harsh J commented on HBASE-3924:
--------------------------------

+1 on that. It does look much more readable.

Nit: I'd ditch the 'HBase' though, seems unnecessary. Or maybe use 'hbase' to avoid confusion about what it means there.
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (HBASE-3924) Improve Shell's CLI help

Posted by "Harsh J (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J reassigned HBASE-3924:
------------------------------

    Assignee: Harsh J
    
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176924#comment-13176924 ] 

Hudson commented on HBASE-3924:
-------------------------------

Integrated in HBase-TRUNK #2588 (See [https://builds.apache.org/job/HBase-TRUNK/2588/])
    HBASE-3924  Improve Shell's CLI help (Harsh J)

larsh : 
Files : 
* /hbase/trunk/bin/hirb.rb

                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.94.0
>
>         Attachments: 3924.txt, HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3924) Improve Shell's CLI help

Posted by "Lars Hofhansl (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176334#comment-13176334 ] 

Lars Hofhansl commented on HBASE-3924:
--------------------------------------

+1 on ditching HBase and just say  shell.
And should it say SCRIPT or SCRIPTFILE?
                
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-3924) Improve Shell's CLI help

Posted by "Lars Hofhansl (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl updated HBASE-3924:
---------------------------------

    Fix Version/s:     (was: 0.92.0)
    
> Improve Shell's CLI help
> ------------------------
>
>                 Key: HBASE-3924
>                 URL: https://issues.apache.org/jira/browse/HBASE-3924
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.90.3
>            Reporter: Lars George
>            Assignee: Harsh J
>            Priority: Trivial
>             Fix For: 0.94.0
>
>         Attachments: HBASE-3924.patch
>
>
> In the hirb.rb source we have
> {noformat}
> # so they don't go through to irb.  Output shell 'usage' if user types '--help'
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  format        Formatter for outputting results: console | html.
> Default: console
>  -d | --debug  Set DEBUG log levels.
> HERE
> found = []
> format = 'console'
> script2run = nil
> log_level = org.apache.log4j.Level::ERROR
> for arg in ARGV
>  if arg =~ /^--format=(.+)/i
>    format = $1
>    if format =~ /^html$/i
>      raise NoMethodError.new("Not yet implemented")
>    elsif format =~ /^console$/i
>      # This is default
>    else
>      raise ArgumentError.new("Unsupported format " + arg)
>    end
>    found.push(arg)
>  elsif arg == '-h' || arg == '--help'
>    puts cmdline_help
>    exit
>  elsif arg == '-d' || arg == '--debug'
>    log_level = org.apache.log4j.Level::DEBUG
>    $fullBackTrace = true
>    puts "Setting DEBUG log level..."
>  else
>    # Presume it a script. Save it off for running later below
>    # after we've set up some environment.
>    script2run = arg
>    found.push(arg)
>    # Presume that any other args are meant for the script.
>    break
>  end
> end
> {noformat}
> We should enhance the help printed when using -h/--help to look like this?
> {noformat}
> cmdline_help = <<HERE # HERE document output as shell usage
> HBase Shell command-line options:
>  --format={console|html}        Formatter for outputting results.
> Default: console
>  -d | --debug  Set DEBUG log levels.
>  -h | --help   This help.
>  <script-filename> [<script-options>]
> HERE
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira