-
Notifications
You must be signed in to change notification settings - Fork 51
Description
The default command in the cli is quite messy code. I think we should take a lot of its logic and make reusable methods that are used by that command rather than the large mess of nested if tests.
As well this code logic (not verbatim but the same idea) is present in more than one part of the code base, it seems like it should be a single reusable function:
const config = await loadConfig(
getConfigFromArgv(argv as ArgumentsCamelCase<SharedOptions>),
);
I don't like that the default command makes multiple loggers, there should just be done.
I think the check for upgrades could be done on all commands rather than just the default one - it just needs to check the config to see if it should happen or not. Thus we could move it out of just the default command.
Basically I feel that the default command and surrounding cli code has become messy and really hard to maintain.