vadimdemedes / pastel

🎨 Next.js-like framework for CLIs made with Ink
https://term.ink/pastel
MIT License
2.2k stars 36 forks source link

Global options are not implemented (options on top-level command) #62

Open olegtaranenko opened 1 year ago

olegtaranenko commented 1 year ago

Looking into the code, I noticed the lack of global options, are scoped to all app's (sub)command, like --debug/-cache etc. To me it is a kind of show-stopper ;-(

olegtaranenko commented 1 year ago

Patch is created, but honestly this is a quick-n-dirty solution.

vadimdemedes commented 1 year ago

Try creating a commands/index.ts to define global options without exporting a command and see if it works.

Going to close the other PR, because as you said yourself, it's a quick-n-dirty solution.

ulken commented 1 year ago

Try creating a commands/index.ts to define global options without exporting a command and see if it works.

Works if you target the index command, but not if specifying a subcommand, unfortunately.