(Please direct this question to a different repo if warranted).
Current implementation:
https://github.com/TracerBench/tracerbench/blob/c9b4a5457cfcd21af93dc96f7cd1221eedf6b269/packages/cli/src/helpers/flags.ts#L7-L13
Use-case:
We have certain instances where we want to type check and parse flag values differently depending on if a default config.json value is being consumed vs explicitly flagged within the CLI command directly. ie
CLI: COMMAND --markers foo,buzz
CONFIG.json: "markers": ["foo", "buzz"]
parse: m => {
// return do something with m under both scenarios
}
Is it possible to "force" parse to execute within the context of flags.build when a default value is set. Appears currently if a default flag value is set parse is never executed.
flags.build#parse will execute
export const foo = flags.build({
description: `foo foo`,
parse: f => {
if (typeof f === 'string') {
// do something
}
}
});
flags.build#parse will NOT execute
export const foo = flags.build({
default: 'foo',
description: `foo foo`,
parse: f => {
if (typeof f === 'string') {
// do something
}
}
});
(Please direct this question to a different repo if warranted).
Current implementation:
https://github.com/TracerBench/tracerbench/blob/c9b4a5457cfcd21af93dc96f7cd1221eedf6b269/packages/cli/src/helpers/flags.ts#L7-L13
Use-case:
We have certain instances where we want to type check and parse flag values differently depending on if a default config.json value is being consumed vs explicitly flagged within the CLI command directly. ie
CLI:
COMMAND --markers foo,buzzCONFIG.json:
"markers": ["foo", "buzz"]parse: m => {
// return do something with m under both scenarios
}
Is it possible to "force"
parseto execute within the context offlags.buildwhen a default value is set. Appears currently if a default flag value is setparseis never executed.flags.build#parsewill executeflags.build#parsewill NOT execute