On 10.11.21 16:36, Michael Adler wrote:
>> How hard is it to use clap_generate for our build?
> 
> clap_generate is just a library, so it cannot be used directly (which is a 
> shame!), which is why I have written a tiny
> wrapper in Rust (30 LoC). The wrapper takes precisely one argument (the yaml 
> file) and generates the bash and zsh
> completions. So for clap_generate, I see the following options:
> 
> 1) Maybe the wrapper could be brought upstream since it would be potentially 
> useful to *any* non-Rust project which wants to
>    generate shell completions.
> 
> 2) Alternatively, the wrapper could be a project of its own, with the benefit 
> of providing statically linked binaries in some
>    registry, e.g. GitHub.
> 
> 3) The wrapper could be stored in this repository, e.g. in a `contrib` 
> directory.
> 
> For the build process this means we would either have to compile the Rust 
> source code (meaning we would pull in Rust as
> a new *build* dependency) or we would download the (statically linked) binary 
> from GitHub (or some other place).
> 
>> Or are there any alternatives that are packaged? Anything from python?
> 
> I'm only aware of argcomplete [1] which is packaged for both Arch and Debian. 
> However, I would argue that it is
> technically *inferior*: it does not generate proper zsh completions (instead 
> relying on bashcompinit) but even worse, it
> seems that argcomplete is a *runtime* dependency.
> 
>> Hmm, that is not that nice. We now have one file too much.
> 
> If we go with the clap_generate approach, we could keep the generated files 
> (it makes packaging much easier) but use CI
> to ensure that the yaml and generated files are in sync.

Then let's start with sharing the bits and pieces needed to generate in
form of installation instructions and a generator script. That could
then be translated into CI instructions as well.

> 
> Last but not least, we could drop the yaml files and from this point forward 
> maintain the completion files directly :)
> 
> [1] https://github.com/kislyuk/argcomplete
> 

In any case: Your new files are missing copyright headers.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/92009cb5-c5aa-5463-4215-ceb6e6ed7fe4%40siemens.com.

Reply via email to