arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.1k stars 61 forks source link

Feature request: Support async `validator` #165

Closed Ayc0 closed 2 months ago

Ayc0 commented 2 months ago

I use clipanion in a huge codebase where we have a lot of CLIs defined in a few folders. To register all of them, we go through all the files specific CLIs folders and require() all of them to have all CLIs available in 1 CLI

But to avoid initial CPU overhead, we limited the amount of code that is run at require time, to have them all at run time.

One of our blockers are validator are they can only be synchronous functions, but we may need to import() variables from other files, and thus need to be async.

Can we allow validator in clipanion to support async functions too to support this use-case?

Ayc0 commented 2 months ago

Actually I already opened https://github.com/arcanis/clipanion/issues/142 in the past, so I'll close this one as it's duplicated 😬

Sorry about that