Open dzmitry-lahoda opened 10 months ago
will donate 100 USD in crypto for such tool :)
I believe there is a tool that wraps clap for use in bash. Not finding it atm but on mobile.
One challenge with the suggested approach is that the tool can't modify the outside environment. It could dump a script to be source
d or it can wrap a command.
I believe there is a tool that wraps clap for use in bash. Not finding it atm but on mobile.
Yeah, I searched various terms, not found yet.
I am ok with Go/C/Zig/AOT compiled bytecode - as long as startup is fast.
I just found that clap seems fits as per clap-serde crate already does half of work.
One challenge with the suggested approach is that the tool can't modify the outside environment. It could dump a script to be sourced or it can wrap a command.
yeah, i see.
so it can be something like:
# bash is bad here, but kind of this to work
source < $(clap2nix clap-config.toml $@)
and other option try work:
# so not clear how process reuse shell called it - seems not great until there is 100% portable robust cargo to handle that
clap2nix clap-config.toml $@ -- echo $SOME_PAR
flow considered
https://discourse.nixos.org/t/nix-bash-maxi-declaratively-configured-cli-args-to-env-vars-tool/37735
Run
example.sh --some-par=42
:will give