Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output a helpful message when there's no configuration #150

Open
2 tasks
chshersh opened this issue Oct 21, 2022 · 0 comments · May be fixed by #155
Open
2 tasks

Output a helpful message when there's no configuration #150

chshersh opened this issue Oct 21, 2022 · 0 comments · May be fixed by #155
Labels
CLI Command Line Interface documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest https://hacktoberfest.com/ output Fancy (and not so) output of the tool

Comments

@chshersh
Copy link
Owner

Currently, when you run tool sync and there's no .tool.toml file, you see the following message:

❯ tool sync
Aborting 'tool-sync' with error:

    * Error parsing configuration at path /home/chshersh/.tool.toml: [IO Error] No such file or directory (os error 2)

Instead, it would be better to tell more information:

  • How to generate the default configuration file (copy instructions from the documentation)
  • Tell, how you can specify the path of a custom configuration using the --config flag

This would require matching on error here:

fn parse_file(config_path: &PathBuf, proxy: Option<String>) -> Result<Config, TomlError> {
let contents = fs::read_to_string(config_path).map_err(|e| TomlError::IO(format!("{}", e)))?;
parse_string(&contents, proxy)
}

@chshersh chshersh added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers CLI Command Line Interface hacktoberfest https://hacktoberfest.com/ labels Oct 21, 2022
@chshersh chshersh added output Fancy (and not so) output of the tool and removed enhancement New feature or request labels Oct 21, 2022
gybrish added a commit to gybrish/tool-sync that referenced this issue Oct 23, 2022
…ot found (chshersh#150)

Resolves chshersh#150

- [ ] Documentation for changes provided/changed
- [ ] Tests added
- [ ] Updated CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Command Line Interface documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest https://hacktoberfest.com/ output Fancy (and not so) output of the tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant