hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Hofhansl (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-3924) Improve Shell's CLI help
Date Tue, 27 Dec 2011 19:32:31 GMT

    [ 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

        

Mime
View raw message