orhun / flawz

A Terminal UI for browsing security vulnerabilities (CVEs)
Apache License 2.0
325 stars 8 forks source link

make completions and manpage as subcommands? #27

Open chenrui333 opened 1 month ago

chenrui333 commented 1 month ago

👋 right now, the cargo build generates flawz-completions and flawz-mapage, I wonder if it would be better to create subcommands as flawz completions and flawz manpage. Let me know if that makes sense.

orhun commented 1 month ago

Hello! 👋🏼 Can you share your use-case ? Why using separate binaries isn't exactly convenient for you?

I'm happy to change this if there is a good reason for it 🐻

chenrui333 commented 1 month ago

it is technically the same, but I just feel like the binaries are not very user friendly (i see you have the similar setup in daktilo as well).

as I come from homebrew, the subcommands would ease the installation process as we do with other rust formulae. I think it would help with other package managers as well.

Let me know if that makes sense.

orhun commented 1 month ago

Yeah, definitely makes sense.

as I come from homebrew, the subcommands would ease the installation process as we do with other rust formulae.

Can you share an example of how you generate completions for Rust packages in Homebrew? I'm curious about how subcommand vs binary approach looks like 👀

chenrui333 commented 3 weeks ago

we have some syntax sugar like generate_completions_from_executable, you can see the code ref in brew repo

and basically it would just have command running completion subcmd and consume them into pre-defined completion dir respectively.

I can see argc and ast-grep are doing completions command thing

orhun commented 3 weeks ago

Can you send some links or share snippets from both approaches?