VladimirMarkelov / ttdl

TTDL - Terminal Todo List Manager
MIT License
210 stars 17 forks source link

--fields on cli has no effect if fields set in config file #42

Closed samuelallan72 closed 3 years ago

samuelallan72 commented 3 years ago

If I have the following set in config:

[global]
fields = "pri,done,due"

ttdl list outputs the headers # D P Due Subject as expected.

But if I try to override the fields on the cli, like ttdl list --fields 'due,thr', the changes are not overridden. If I then remove the fields = config from the config file, the --fields flag override does work.

I would expect the --fields flag to override anything set in the config file.

VladimirMarkelov commented 3 years ago

Yes, CLI options should have higher priority. I'll check it.

VladimirMarkelov commented 3 years ago

Moved parsing config in the very beginning, CLI options are parsed after it. At least, --fields override works.

samuelallan72 commented 3 years ago

@VladimirMarkelov can confirm that it solves the issue noted above, thank you! :D