r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.35k stars 160 forks source link

Allow adding flags to any command #799

Closed xeruf closed 2 years ago

xeruf commented 2 years ago

I want to suggest some general feature

I think there should be a generic way for adding flags to any command executed by topgrade or wholly overriding the command. For example, I would like to add --yes to doom upgrade. I do not see why there should be predefined config keys for every single supported tool.

r-darwish commented 2 years ago

I think making that happen is way too difficult. The only solution that I can offer is that you disable the original step in the configuration and instead configure a custom.

As for doom, since many package managers have a “yes flag”, Topgrade’s own -y flag passes itself to all supported package managers, so I’ll make sure the doom step supports that as well

r-darwish commented 2 years ago

https://github.com/r-darwish/topgrade/blob/539b267eefbdb7b89a0b17566fdf5aa82fee61f6/src/steps/emacs.rs#L61

It seems that Topgrade already passes -y to doom. Is there something I'm missing here?

xeruf commented 2 years ago

But I don't want to pass -y to everything, only to doom. If some weird upgrade conflict in yay is about to hose my computer, I surely wanna intervene.

r-darwish commented 2 years ago

Topgrade passes -y to doom regardless the use of the --yes flag of Topgrade itself.

xeruf commented 2 years ago

Hm well then that flag is not enough, because I keep getting these annoying questions when an upstream URL changes. Seems we need to add --force when passing --yes to topgrade.