[ 
https://issues.apache.org/jira/browse/HBASE-8298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13684447#comment-13684447
 ] 

Hari Sekhon commented on HBASE-8298:
------------------------------------

Yes that would appear in the help command in the ddl command group next to 
describe, although it shouldn't be confusing since desc is the widely known 
common shortcut for describe across various systems and I've intentionally 
inherited from Describe so the help documentation and implementation is exactly 
the same and will inherit any changes made to Describe in the future.

Right now the code wouldn't support a regex without a more significant rewrite 
of the hbase shell. It's all pre-defined command lists which are just 
dynamically eval'ing the command files for the command classes containing the 
actual command method for the action. A regex wouldn't know where to find the 
actual class definitions.

If you leave desc off the pre-defined command list it never loads the desc 
class. Even if you move the Desc class to describe.rb which is loaded you don't 
get the command mapping and end up with an error "NoMethodError: undefined 
method..."

The command mapping is a class inheritance variable in the base Shell module, 
so the only other reasonably easy way that I can see to do this would be to add 
a special case in the base Shell module, which is slightly more hackish way of 
doing it and not in keeping with the current command framework, although the 
desc command will not show in the ddl group for help, it'll be a stealth 
shortcut.
                
> desc <tablename> shorthand for describe <tablename>, similar to how databases 
> have
> ----------------------------------------------------------------------------------
>
>                 Key: HBASE-8298
>                 URL: https://issues.apache.org/jira/browse/HBASE-8298
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.94.2
>            Reporter: Hari Sekhon
>            Priority: Trivial
>         Attachments: desc.patch
>
>
> It would be nice if you could type
> desc <tablename>
> in hbase shell as shorthand for
> describe <tablename>
> similar to how you can in traditional databases.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to