Open swandir opened 2 years ago
Indeed; we could avoid that by making Option.String
& friends return a Proxy that would "buffer" all manipulations, but it'd be quite overkill imo. I'm not sure what else we can do 🤔
Hmm, could options return the actual value and register themselves for command routing as a side-effect? It would require to delay command construction until after cli.run
is called though 🤔
Options appear as regular public class fields but do not function as such during class instance construction.
https://stackblitz.com/edit/node-gbmupy?file=cli.ts
This behavior is understandable given the way options are declared, but still might take the user by surprise. Especially when it fails silently (optional property usage, for example).