Replies: 0 comments 1 reply
-
This isn't currently supported since oclif expects all flags and args to be placed after the command id. Although I think we could likely support it if there's enough demand for it (or someone would like to make a PR). I'm imagining some sort of configuration like this "oclif": {
"preCommandFlags": ["paginate"]
} Then this function (and the handful of functions it invokes) would need to know that the command id will be found after all the As for defining and parsing the So putting it all together, you'd have this configuration in your package.json "oclif": {
"preCommandFlags": ["paginate"]
} Then you'd have a base command that defines the That's just off the top of my head though - I'm open to alternative implementations |
Beta Was this translation helpful? Give feedback.
-
Do you want to request a feature or report a bug?
Most likely this is a question.
I'd like to add options to the top level command, similar to e.g.
git
where you can do:and the option
--paginate
is passed to subcommands log and show.From the hello-world example I can see how to add options to subcommands by editing the index.ts files (e.g.
src/commands/hello/index.ts
). However, I'm not able to do the same for the top level command. I tried to tweaksrc/index.ts
and the package settings, but I had no luck so far.Beta Was this translation helpful? Give feedback.
All reactions