rtkay123 / mirro-rs

An Arch Linux mirrorlist manager with a TUI
Apache License 2.0
82 stars 1 forks source link

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

Open skyleo opened 1 month ago

skyleo commented 1 month ago

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

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 commented 1 month ago

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. :bow:

rtkay123 commented 1 week ago

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