noborus / ov

🎑Feature-rich terminal-based text viewer. It is a so-called terminal pager.
https://noborus.github.io/ov
MIT License
1.43k stars 38 forks source link

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

Open dickon opened 7 months ago

dickon commented 7 months ago

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 commented 7 months ago

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

noborus commented 7 months ago

v0.33.2 has been released which fixes this issue.

minhtrancccp commented 2 months ago

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 commented 2 months ago

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

I will fix it.

minhtrancccp commented 2 months ago

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