Review Board 1.7.22


Sqoop2: Help option for shell command functions

Review Request #10100 - Created March 24, 2013 and updated

Vasanth kumar RJ
sqoop-965
Reviewers
Sqoop
sqoop-sqoop2
There is no help option for shell command's functions. Introducing the help argument for functions.
Done
Total:
4
Open:
4
Resolved:
0
Dropped:
0
Status:
From:
Description From Last Updated Status
line.getArgs().length >= 1? Abraham Elmahrek March 26, 2013, 2:59 a.m. Open
line.getArgs().length >= 1? Abraham Elmahrek March 26, 2013, 2:59 a.m. Open
line.getArgs().length >= 1? Abraham Elmahrek March 26, 2013, 2:59 a.m. Open
line.getArgs().length >= 1? Abraham Elmahrek March 26, 2013, 2:59 a.m. Open
Review request changed
Updated (April 8, 2013, 8:28 p.m.)
Implemented Jarek's suggestions.
Help Usage:
>help command function

also
>command function help

If this implementation patch is fine then I will update document with this patch.

Vasanth kumar
Posted (April 13, 2013, 7:01 p.m.)
Hi Vasanth,
thank you for working on this patch, greatly appreciated. I do have one comment:
I would argue that this might be quite confusing for end user as "show connection --jid 1 help" will show the help but "show connection help --jid 1" won't. I think that using just the "help" command for getting help will be enough, what do you think?
  1. Hi Jarek,
    Thank you for your review comments. I am fine with your suggestion. Current patch we append word "help" while using help for functions and again execute command. Now to avoid help at the end of command, we have to use a internal help flag to display help. Such that help flag will be appended in help command and check for the flag in SqoopFunction. This way make simple and we have to hard code the help flag. 
    
    Otherwise, if(args.contains(Constants.CMD_HELP)) will work for both the way.
    
    Kindly suggest
  2. Hi Vasanth,
    my proposal is not to change the execute() method of each function at all. Instead we can just create smart enough help command that will inspect other commands/functions and display the help accordingly.
  3. Hi Jarek,
    Ok. Can you provide small example? It will help to understand how help inspect command/function.
    
    current patch solves
    >help command function
    Additionally:
    >command function help args
    >command function args help -(Requires patch update)
    In this patch modified in abstract SqoopFunction.java. So no need to modify each function.
    
    Please give example of your suggestion.
    
    Thanks,
    Vasanth
  4. Hi Vasanth,
    please accept my apologies for this late reply. I think that it would be nice to have help command that would behave such as:
    
    * "help command" would display available functions
    * "help command function" would display all available arguments
    * Would be great if the implementation would not be too intrusive (e.g. I would prefer if we can leave execute() method intact by adding proper help).
    
    Jarcec
Jarcec