Closed mattyclarkson closed 6 years ago
Thanks for this suggestion! Instead of having this built-in, I think it might be better to add another Castable
implementation outside of the core. E.g.:
export class SomeOptions extends Options {
@option({
flag: 'c',
description: 'some configuration',
// Currently a string value might be needed to trigger the casting,
// might add another option on castable to force casting `undefined`.
// Search `defaultValue` in `cli.ts` for details.
default: '',
})
config: Config;
}
Thanks for the suggestion. Will look into it.
The
rc
package provides a standard way to lookup configuration files. It would be great ifclime
had built in support for the same lookup. I am keen to implement this if you think it would be a good addition to the project. We can avoidstatSync
thatrc
does becauseclime
isasync
by default so we can do the file lookups asynchronously.If 👍 on this idea, I can do some investigation and figure out a spec before actually implementing it. I imagine it would be in
preprocessArguments
but that's based on 1 minute or research.