Skip to content

Lookup subcommand more strictly and consistently #10132

@soloestoy

Description

@soloestoy

After #9504 we treat subcommands as commands, it's a good step, but it also introduced ambiguity, i.e. get|key is a bad command or a base command get? Maybe you will say it's a base command because get doesn't have subcommands, but it's very confused to users.

Here are some examples:

  1. About COMMAND INFO
    • command info config|get returns subcommand config|get's info.
    • command info get|key returns base command get's info.
  2. About ACL setuser
    • acl setuser test +config|get allows user execute subcommand config|get.
    • acl setuser test +config|get|dir allows user execute subcommand config|get with first arg dir.
    • acl setuser test +config|xxx returns error.
    • acl setuser test +get|key allows user execute base command get with first arg key.
    • acl setuser test +get|key1|key2 allows user execute base command get with the second arg key2, key1 lost.

To me the result is very confused, I thinks we should treat get|key as a bad command, and use another character instead of | to indicate the first arg.

BTW the first-arg rule is very difficult to understand IMHO, it's too flexible.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions