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

If there is no config file and an error about that then it seems the command line options are ignored #488

Open
dickon opened this issue Jan 24, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@dickon
Copy link

dickon commented Jan 24, 2024

I installed ov from homebrew on OSX 14.2.1, did:

ov --follow-name --multi-color "ERROR,INFO,WARN,DEBUG,^2024-.{19},\[.*]" --wrap corda.log

and didn't get wrapping or the color highlighting, which I expected.

And I then noticed an error:

dickon.reed@LDNM-RP94MJ9T71 logs % ov   --follow-name --multi-color "ERROR,INFO,WARN,DEBUG,^2024-.{19},\[.*]" --wrap corda.log
failed to read config file: Config File "config" Not Found in "[/Users/dickon.reed/.config/ov]"

and figured nevermind, I don't need a config file yet.

If I create an empty config file at ~/.config/ov/config.yaml the command line options work as expected. Initially I tried to make an empty file ~/.config/ov which of course didn't work.

@noborus
Copy link
Owner

noborus commented Jan 24, 2024

Thank you for the issue.
Oops, I accidentally put in an early return.

noborus added a commit that referenced this issue Jan 24, 2024
viper.Unmarshal should run even if the configuration file is missing.
This is a fix for #488.
@noborus noborus added the bug Something isn't working label Jan 24, 2024
@noborus
Copy link
Owner

noborus commented Feb 1, 2024

v0.33.2 has been released which fixes this issue.

@noborus noborus closed this as completed Feb 1, 2024
@minhtrancccp
Copy link
Contributor

minhtrancccp commented Jun 29, 2024

i installed ov via go, namely go install github.com/noborus/ov@latest, and the mentioned issue still happened to me, even though i just typed ov -v, which returned:

failed to read config file: Config File "config" Not Found in "[($HOME)/.config/ov]"
ov version dev rev:HEAD

as i used ov with bat, the error message would overwrite the first line of bat's output as well.
image

@noborus noborus reopened this Jun 29, 2024
@noborus
Copy link
Owner

noborus commented Jun 29, 2024

Thank you.
There was a mistake in the error detection similar to the following issue:
spf13/viper#1139

I will fix it.

@minhtrancccp
Copy link
Contributor

minhtrancccp commented Jun 29, 2024

yup, can confirm it's fixed in the master branch now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants