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

Add informative output in --help or --version where a config file is expected to be loaded #218

Open
6 tasks done
skyleo opened this issue Sep 11, 2024 · 2 comments
Open
6 tasks done

Comments

@skyleo
Copy link

skyleo commented Sep 11, 2024

Is your feature request related to a problem? Please describe.

  • I've tried to get mirro-rs to load my config file to no avail. I'm using version 0.2.3.
  • I've checked the PCKGBLD file in the non-AUR package of Arch Linux to verify it expects toml.
  • export returns XDG_CONFIG_HOME=/home/leo/.config as expected.
  • I've tried starting via XDG_CONFIG_HOME=/home/leo/.config mirro-rs
  • I've tried $XDG_CONFIG_HOME/mirro-rs/mirro-rs.toml as location
  • I've tried $XDG_CONFIG_HOME/mirro-rs.toml as location

But not a single filter of my config seems to be loaded.

Describe the solution you'd like

In order to debug such a problem easier, I'd have loved to know where mirro-rs looksup my configuration file and/or if it failed to find one. (In case it did find one and there's a parsing issue)

Attachments

The used config file:

[general]
outfile = "~/mirrorlist" # must not end with trailing slash
# Max number of mirrors to export
export = 25
view = "alphabetical" # alphabetical mirror-count
sort = "score" # percentage, duration, delay, score
cache-ttl = 24
url = "https://archlinux.org/mirrors/status/json/"
rate-speed = true
timeout = 5
#include = [
#  "https://cloudflaremirrors.com/archlinux/"
#]

[filters]
countries = [ Japan, Germany ]
age = 24
ipv6 = true
ipv4 = true
isos = false
protocols = [ "https" ]
completion-percent = 100
@skyleo
Copy link
Author

skyleo commented Sep 11, 2024

As I watch the syntax highlighting of the parser for the toml here in the issue description, I notice that I have to use " for the counties strings.

Doing this fixed my issue entirely.

But as I have stated in the issue, it'd be good if parsing errors were reported to the user instead of failing silently, making one believe that the configuration isn't found or loaded at all.

Thank you for your hard work. 🙇

@rtkay123
Copy link
Owner

Hi there. I'm taking a look at this. It seems like something that's very necessary to have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants