[ 
https://issues.apache.org/jira/browse/IGNITE-20179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksandr updated IGNITE-20179:
-------------------------------
    Description: 
We have several command options that should accept a list of strings, for 
example {{cluster init --cmg-nodes}}.  cmg-nodes can accept a single sting, 
string with comma-separated node names without a space, and finally, can be 
repeated. 

Imagine you are a user that types a command

{{[defaultNode]> cluster init --cluster-name my --meta-storage-node defaultNode 
--cmg-node defaultNode, defaultNode2}}

And get the error:
Unmatched argument at index 7: 'defaultNode2'

That is not clear what is wrong but the reason is that you typed a space before 
the comma. 

I suggest rethinking the way CLI supports lists of strings and offering a more 
user-friendly solution. Probably, we have to redefine our own jline3 parser. I 
would expect and least a clear error message about what is wrong and how to fix 
it. 

Another challenge here is to improve autocompletion in interactive mode. 
Imagine I want to use <TAB> completion against a cluster of two nodes node1 and 
node2: 

{{[defaultNode]> cluster init --cluster-name my --meta-storage-node <TAB1>node1 
--meta-storage-node <TAB2>node2}}

On TAB1 I can see the completion of 2 variants: node1 and node2. That is 
correct. On TAB2 I expect to see only node2 completion but I still see node1 
and node2. That is not correct, because the list of nodes is not expected to 
contain duplicates.

As a result of this ticket, I expect: 
- correct errors with examples
- correct completions
- a common solution to be used in all commands that need lists of string


  was:
We have several command options that should accept a list of strings, for 
example {{cluster init --cmg-nodes}}.  cmg-nodes can accept a single sting, 
string with comma-separated node names without a space, and finally, can be 
repeated. 

Imagine you are a user that types a command

{{[defaultNode]> cluster init --cluster-name my --meta-storage-node defaultNode 
--cmg-node defaultNode, defaultNode2}}

And get the error:
Unmatched argument at index 7: 'defaultNode2'

That is not clear what is wrong but the reason is that you typed a space before 
the comma. 

I suggest rethinking the way CLI supports lists of strings and offering a more 
user-friendly solution. Probably, we have to redefine our own jline3 parser. I 
would expect and least a clear error message about what is wrong and how to fix 
it. 

Another challenge here is to improve autocompletion in interactive mode. 
Imagine I want to use <TAB> completion against a cluster of two nodes node1 and 
node2: 

{{[defaultNode]> cluster init --cluster-name my --meta-storage-node <TAB1>node1 
--meta-storage-node <TAB2>node2}}

On TAB1 I can see the completion of 2 variants: node1 and node2. That is 
correct. On TAB2 I expect to see only node2 completion but I still see node1 
and node2. That is not correct, because the list of nodes is not expected to 
contain duplicates.



> CLI should provide user-friendly list options
> ---------------------------------------------
>
>                 Key: IGNITE-20179
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20179
>             Project: Ignite
>          Issue Type: Task
>          Components: cli
>    Affects Versions: 3.0.0-beta1
>            Reporter: Aleksandr
>            Priority: Major
>              Labels: ignite-3, ignite-3-cli-tool
>
> We have several command options that should accept a list of strings, for 
> example {{cluster init --cmg-nodes}}.  cmg-nodes can accept a single sting, 
> string with comma-separated node names without a space, and finally, can be 
> repeated. 
> Imagine you are a user that types a command
> {{[defaultNode]> cluster init --cluster-name my --meta-storage-node 
> defaultNode --cmg-node defaultNode, defaultNode2}}
> And get the error:
> Unmatched argument at index 7: 'defaultNode2'
> That is not clear what is wrong but the reason is that you typed a space 
> before the comma. 
> I suggest rethinking the way CLI supports lists of strings and offering a 
> more user-friendly solution. Probably, we have to redefine our own jline3 
> parser. I would expect and least a clear error message about what is wrong 
> and how to fix it. 
> Another challenge here is to improve autocompletion in interactive mode. 
> Imagine I want to use <TAB> completion against a cluster of two nodes node1 
> and node2: 
> {{[defaultNode]> cluster init --cluster-name my --meta-storage-node 
> <TAB1>node1 --meta-storage-node <TAB2>node2}}
> On TAB1 I can see the completion of 2 variants: node1 and node2. That is 
> correct. On TAB2 I expect to see only node2 completion but I still see node1 
> and node2. That is not correct, because the list of nodes is not expected to 
> contain duplicates.
> As a result of this ticket, I expect: 
> - correct errors with examples
> - correct completions
> - a common solution to be used in all commands that need lists of string



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to