Mechanism to customize each part displayed by `showUsage`
If you can make an issue to explain or visually share some screenshot of desired output i can help to improve built-in showUsage usable for rolldown.
Originally posted by @pi0 in https://github.com/unjs/citty/issues/135#issuecomment-2043033387
The showUsage currently provided can be customized with own customized showUsage in runMain, but there is no way to customize the built-in showUsage that citty has.
The showUsage renders the following parts via renderUsage.
- header (include, command name and versions)
- usage or sub command
- options
It would be useful to have a mechanism to custom render each of these parts, so that the logic of showUsage does not have to be reused.
In the rolldown use case, we would like to customize only the header.
Hi. Sure we can think of some kind of text AST structure to allow hooking into and modifying the output 👍🏼
In the rolldown use case, we would like to customize only the header.
I want to investigate this first although. Can you share the desired header change? If it is more beautiful, i am up to simply update the default usage to it so not going to the customization path :)
I want to investigate this first although. Can you share the desired header change? If it is more beautiful, i am up to simply update the default usage to it so not going to the customization path :)
@pi0 Thanks!
rolldown header test is here:
rolldown 0.10.1 - Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.
rolldown header image is here:
rolldown cli is a layout and color adjustment for the header customization.