You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by ткаленко кирилл <tk...@yandex.ru> on 2020/09/07 14:46:55 UTC

[DISCUSSION] Add autocompletion for commands in control.sh

Hello, folks!

I spent time to analyze the possibility of adding auto completion for the "control.sh" with the [1].

To do this, at the beginning, we need to adapt the "control.sh" code to [1], then we can automatically create a "bash completion script" via [2], and then install it, for example, with the "source" command and the "control.sh" script itself via "install".

This is only possible for nix systems.

It is theoretically possible to add the "control.sh" extension via plugins and auto-generate "bash completion script".

Thus, I propose a plan:
1)Adapt "control.sh" to [1];
2)Automatic creation of "bash completion script" for the release build;
3)Adding extensibility "control.sh" and automatic re-creation of "bash completion script". (optional)

What do you think, comments?

[1] - https://picocli.info/
[2] - https://picocli.info/autocomplete.html#_completion_script_generation_details

Re: [DISCUSSION] Add autocompletion for commands in control.sh

Posted by Anton Kalashnikov <ka...@yandex.ru>.
Hello,

This idea looks great in my opinion. I agree that a more common approach would be better but I am the same as Kirill haven't found the better one. So in my point of view, this library is better than nothing, and if nobody will recommend a different one we can take picocli right now.

-- 
Best regards,
Anton Kalashnikov



14.09.2020, 13:15, "Данилов Семён" <sa...@yandex.ru>:
> Hello!
>
> I've looked through the picocli manual and it looks really great.
> We will be able easily add i18n and stuff like this.
> Nevertheless, we will get rid of the manual formatting of examples and help texts.
>
> Kind regards,
> Semyon.
>
> 14.09.2020, 13:00, "Alexey Goncharuk" <al...@gmail.com>:
>>  Hi folks,
>>
>>  Despite the autocompletion support only for bash, I see the following
>>  benefits from this change:
>>   * It may unify all the CLI tooliing in Ignite, providing a better user
>>  experience
>>   * The library has an ability to generate man pages, which may be nice
>>   * I see there is an open issue for adding support to powershell, so
>>  Windows platform will be also somewhat covered
>>
>>  Overall, I support this idea.
>>
>>  вт, 8 сент. 2020 г. в 10:43, ткаленко кирилл <tk...@yandex.ru>:
>>
>>>   Hello, Ilya!
>>>
>>>   I agree that it would be better if we found a common approach, but I
>>>   haven't found one yet.
>>>
>>>   07.09.2020, 18:50, "Ilya Kasnacheev" <il...@gmail.com>:
>>>   > Hello!
>>>   >
>>>   > Not everyone is using bash, which leads me to question whether there's
>>>   any
>>>   > common approach where we can hint a shell what our executable can do so
>>>   > that it can discover and auto-complete our control.sh
>>>   >
>>>   > Regards,
>>>   > --
>>>   > Ilya Kasnacheev
>>>   >
>>>   > пн, 7 сент. 2020 г. в 17:47, ткаленко кирилл <tk...@yandex.ru>:
>>>   >
>>>   >> Hello, folks!
>>>   >>
>>>   >> I spent time to analyze the possibility of adding auto completion for
>>>   the
>>>   >> "control.sh" with the [1].
>>>   >>
>>>   >> To do this, at the beginning, we need to adapt the "control.sh" code to
>>>   >> [1], then we can automatically create a "bash completion script" via
>>>   [2],
>>>   >> and then install it, for example, with the "source" command and the
>>>   >> "control.sh" script itself via "install".
>>>   >>
>>>   >> This is only possible for nix systems.
>>>   >>
>>>   >> It is theoretically possible to add the "control.sh" extension via
>>>   plugins
>>>   >> and auto-generate "bash completion script".
>>>   >>
>>>   >> Thus, I propose a plan:
>>>   >> 1)Adapt "control.sh" to [1];
>>>   >> 2)Automatic creation of "bash completion script" for the release build;
>>>   >> 3)Adding extensibility "control.sh" and automatic re-creation of "bash
>>>   >> completion script". (optional)
>>>   >>
>>>   >> What do you think, comments?
>>>   >>
>>>   >> [1] - https://picocli.info/
>>>   >> [2] -
>>>   >>
>>>   https://picocli.info/autocomplete.html#_completion_script_generation_details

Re: [DISCUSSION] Add autocompletion for commands in control.sh

Posted by Данилов Семён <sa...@yandex.ru>.
Hello!

I've looked through the picocli manual and it looks really great.
We will be able easily add i18n and stuff like this.
Nevertheless, we will get rid of the manual formatting of examples and help texts.

Kind regards,
Semyon.

14.09.2020, 13:00, "Alexey Goncharuk" <al...@gmail.com>:
> Hi folks,
>
> Despite the autocompletion support only for bash, I see the following
> benefits from this change:
>  * It may unify all the CLI tooliing in Ignite, providing a better user
> experience
>  * The library has an ability to generate man pages, which may be nice
>  * I see there is an open issue for adding support to powershell, so
> Windows platform will be also somewhat covered
>
> Overall, I support this idea.
>
> вт, 8 сент. 2020 г. в 10:43, ткаленко кирилл <tk...@yandex.ru>:
>
>>  Hello, Ilya!
>>
>>  I agree that it would be better if we found a common approach, but I
>>  haven't found one yet.
>>
>>  07.09.2020, 18:50, "Ilya Kasnacheev" <il...@gmail.com>:
>>  > Hello!
>>  >
>>  > Not everyone is using bash, which leads me to question whether there's
>>  any
>>  > common approach where we can hint a shell what our executable can do so
>>  > that it can discover and auto-complete our control.sh
>>  >
>>  > Regards,
>>  > --
>>  > Ilya Kasnacheev
>>  >
>>  > пн, 7 сент. 2020 г. в 17:47, ткаленко кирилл <tk...@yandex.ru>:
>>  >
>>  >> Hello, folks!
>>  >>
>>  >> I spent time to analyze the possibility of adding auto completion for
>>  the
>>  >> "control.sh" with the [1].
>>  >>
>>  >> To do this, at the beginning, we need to adapt the "control.sh" code to
>>  >> [1], then we can automatically create a "bash completion script" via
>>  [2],
>>  >> and then install it, for example, with the "source" command and the
>>  >> "control.sh" script itself via "install".
>>  >>
>>  >> This is only possible for nix systems.
>>  >>
>>  >> It is theoretically possible to add the "control.sh" extension via
>>  plugins
>>  >> and auto-generate "bash completion script".
>>  >>
>>  >> Thus, I propose a plan:
>>  >> 1)Adapt "control.sh" to [1];
>>  >> 2)Automatic creation of "bash completion script" for the release build;
>>  >> 3)Adding extensibility "control.sh" and automatic re-creation of "bash
>>  >> completion script". (optional)
>>  >>
>>  >> What do you think, comments?
>>  >>
>>  >> [1] - https://picocli.info/
>>  >> [2] -
>>  >>
>>  https://picocli.info/autocomplete.html#_completion_script_generation_details

Re: [DISCUSSION] Add autocompletion for commands in control.sh

Posted by Alexey Goncharuk <al...@gmail.com>.
Hi folks,

Despite the autocompletion support only for bash, I see the following
benefits from this change:
 * It may unify all the CLI tooliing in Ignite, providing a better user
experience
 * The library has an ability to generate man pages, which may be nice
 * I see there is an open issue for adding support to powershell, so
Windows platform will be also somewhat covered

Overall, I support this idea.

вт, 8 сент. 2020 г. в 10:43, ткаленко кирилл <tk...@yandex.ru>:

> Hello, Ilya!
>
> I agree that it would be better if we found a common approach, but I
> haven't found one yet.
>
> 07.09.2020, 18:50, "Ilya Kasnacheev" <il...@gmail.com>:
> > Hello!
> >
> > Not everyone is using bash, which leads me to question whether there's
> any
> > common approach where we can hint a shell what our executable can do so
> > that it can discover and auto-complete our control.sh
> >
> > Regards,
> > --
> > Ilya Kasnacheev
> >
> > пн, 7 сент. 2020 г. в 17:47, ткаленко кирилл <tk...@yandex.ru>:
> >
> >>  Hello, folks!
> >>
> >>  I spent time to analyze the possibility of adding auto completion for
> the
> >>  "control.sh" with the [1].
> >>
> >>  To do this, at the beginning, we need to adapt the "control.sh" code to
> >>  [1], then we can automatically create a "bash completion script" via
> [2],
> >>  and then install it, for example, with the "source" command and the
> >>  "control.sh" script itself via "install".
> >>
> >>  This is only possible for nix systems.
> >>
> >>  It is theoretically possible to add the "control.sh" extension via
> plugins
> >>  and auto-generate "bash completion script".
> >>
> >>  Thus, I propose a plan:
> >>  1)Adapt "control.sh" to [1];
> >>  2)Automatic creation of "bash completion script" for the release build;
> >>  3)Adding extensibility "control.sh" and automatic re-creation of "bash
> >>  completion script". (optional)
> >>
> >>  What do you think, comments?
> >>
> >>  [1] - https://picocli.info/
> >>  [2] -
> >>
> https://picocli.info/autocomplete.html#_completion_script_generation_details
>

Re: [DISCUSSION] Add autocompletion for commands in control.sh

Posted by ткаленко кирилл <tk...@yandex.ru>.
Hello, Ilya!

I agree that it would be better if we found a common approach, but I haven't found one yet.

07.09.2020, 18:50, "Ilya Kasnacheev" <il...@gmail.com>:
> Hello!
>
> Not everyone is using bash, which leads me to question whether there's any
> common approach where we can hint a shell what our executable can do so
> that it can discover and auto-complete our control.sh
>
> Regards,
> --
> Ilya Kasnacheev
>
> пн, 7 сент. 2020 г. в 17:47, ткаленко кирилл <tk...@yandex.ru>:
>
>>  Hello, folks!
>>
>>  I spent time to analyze the possibility of adding auto completion for the
>>  "control.sh" with the [1].
>>
>>  To do this, at the beginning, we need to adapt the "control.sh" code to
>>  [1], then we can automatically create a "bash completion script" via [2],
>>  and then install it, for example, with the "source" command and the
>>  "control.sh" script itself via "install".
>>
>>  This is only possible for nix systems.
>>
>>  It is theoretically possible to add the "control.sh" extension via plugins
>>  and auto-generate "bash completion script".
>>
>>  Thus, I propose a plan:
>>  1)Adapt "control.sh" to [1];
>>  2)Automatic creation of "bash completion script" for the release build;
>>  3)Adding extensibility "control.sh" and automatic re-creation of "bash
>>  completion script". (optional)
>>
>>  What do you think, comments?
>>
>>  [1] - https://picocli.info/
>>  [2] -
>>  https://picocli.info/autocomplete.html#_completion_script_generation_details

Re: [DISCUSSION] Add autocompletion for commands in control.sh

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Not everyone is using bash, which leads me to question whether there's any
common approach where we can hint a shell what our executable can do so
that it can discover and auto-complete our control.sh

Regards,
-- 
Ilya Kasnacheev


пн, 7 сент. 2020 г. в 17:47, ткаленко кирилл <tk...@yandex.ru>:

> Hello, folks!
>
> I spent time to analyze the possibility of adding auto completion for the
> "control.sh" with the [1].
>
> To do this, at the beginning, we need to adapt the "control.sh" code to
> [1], then we can automatically create a "bash completion script" via [2],
> and then install it, for example, with the "source" command and the
> "control.sh" script itself via "install".
>
> This is only possible for nix systems.
>
> It is theoretically possible to add the "control.sh" extension via plugins
> and auto-generate "bash completion script".
>
> Thus, I propose a plan:
> 1)Adapt "control.sh" to [1];
> 2)Automatic creation of "bash completion script" for the release build;
> 3)Adding extensibility "control.sh" and automatic re-creation of "bash
> completion script". (optional)
>
> What do you think, comments?
>
> [1] - https://picocli.info/
> [2] -
> https://picocli.info/autocomplete.html#_completion_script_generation_details
>