buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.44k stars 90 forks source link

Add a config for default behaviour #156

Open ondrejfuhrer opened 4 years ago

ondrejfuhrer commented 4 years ago

As a user I would like to set a default behaviour to brew cu command. As an example I might wan't to always run it with --all option.

Desired flow:

> brew cu
==> Options
Include auto-update (-a): false
Include latest (-f): false

Config change

> brew cu config set auto-update true
Option "auto-update" has been set to "true" by default.
> brew cu
==> Options
Include auto-update (-a): true
Include latest (-f): false

Options overview:

Available keys:

muescha commented 4 years ago

what about a dotfile like .brewcu config file (in current dir and in your ~/ home dir

there i can set all options with like on command line

i would also expect only this new commands: brew cu -f ./current_config_file brew cu --ignore-config

order: 1 command line options 2 ./.brewcu 3 ~/.brewcu

ondrejfuhrer commented 4 years ago

Hey @muescha , thank you very much for your feedback! I really appreciate that. It would anyways use a dotfile (or some sort of config file in the home dir) to store those options, so what you are suggesting is very much possible. And true that probably the implementation would be much easier and adding the manipulation through brew cu config commands can be added later on.

Regarding the order: Do you see a use case where you would like to have a different behaviour based on the execution context? Wouldn't that bee too confusing?

brew cu -f ./current_config_file

Also do you see a valid use case here, having multiple settings? PS: -f is already taken, therefore it would be more likely -c and --config

muescha commented 4 years ago

i was just thinking in general about commands and their .dotfiles and where i expect it to read from which places and in which order.

Do you see a use case where you would like to have a different behaviour based on the execution context? Wouldn't that bee too confusing?

you are right we can remove that 2 ./.brewcu

brew cu -f ./current_config_file

Also do you see a valid use case here, having multiple settings?

maybe in a ci environment or something like this but you are sure i don't know where it is needed

muescha commented 4 years ago

should the pinned file also go somewhere here near the .brew-cu ... maybe in as a .brew-cu-ignore file?

ondrejfuhrer commented 4 years ago

@muescha I was also thinking about it and the "issue" I have with it is that this gets not cleaned after uninstalling. The cu command configuration is fine to be "persistent", it is basically a saved preference how you want to use it, but pinned info is more about a state. Therefore when you uninstall the tap the state should be removed as well, what do you think?

muescha commented 4 years ago

but if someone save his ".dotfiles" maybe he like to remember all the pinned files also. so i expect it there and not in a "magic" hidden folder 🤔

muescha commented 4 years ago

but i think thats can be done in a different PR and not for this change... sorry for highjacking this PR with the idea