Closed chshersh closed 1 year ago
Just to clarify, when the user type tool default-config --path
, we should just print the path that gets returned by resolve_config_path()
?
@zixuanzhang-x Yes, you're correct, we should print only the path to stdout. But it shouldn't be the result of resolve_config_path()
.
I propose to move the following part into a separate function like get_default_config_path()
and use it in the --path
option and in the resolve_config_path()
functions.
match dirs::home_dir() {
Some(home_path) => {
let mut path = PathBuf::new();
path.push(home_path);
path.push(DEFAULT_CONFIG_PATH);
path
}
Instead of outputting the config content, it should output the path to the default config location.
Relevant code parts:
https://github.com/chshersh/tool-sync/blob/df7d4768c9cff2a91616bd9686bc928a52fc8c10/src/config/cli.rs#L21-L22
https://github.com/chshersh/tool-sync/blob/df7d4768c9cff2a91616bd9686bc928a52fc8c10/src/lib.rs#L21
https://github.com/chshersh/tool-sync/blob/df7d4768c9cff2a91616bd9686bc928a52fc8c10/src/lib.rs#L29-L44