Skip to content

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

Description

@chshersh

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)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLICommand Line InterfacedocumentationImprovements or additions to documentationgood first issueGood for newcomershacktoberfesthttps://hacktoberfest.com/outputFancy (and not so) output of the tool

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions