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

Mimic rustup override behavior #97

Open
pickfire opened this issue Sep 27, 2018 · 2 comments
Open

Mimic rustup override behavior #97

pickfire opened this issue Sep 27, 2018 · 2 comments
Labels

Comments

@pickfire
Copy link

Provide friendly experience for people using rustup override.

  • set to modify
  • unset to remove from config
  • list to list existing config

Personal expected behavior.

  • if the item set-ed is the default, remove the config rather than showing Default features true
  • some deprecated crate like clippy should be removed from config, alternative to rustup override unset --nonexistant would be useful
  • list all overrides (took me some time to figure out the configuration in ~/.cargo/.install_config.toml by reading the source code)

If this feature is useful though it might introduce breaking change, I can propose solution for it.

@nabijaczleweli
Copy link
Owner

Either I'm having a stroke or I'm deeply not getting this. Can you provide some background as to how anything is related here, because I'm actually losing my mind? (You probably have some good points (there's six, at least one is bound to be good, but I actually have no idea what I'm reading.)

@pickfire
Copy link
Author

pickfire commented Sep 29, 2018

@nabijaczleweli Nice, thanks for the comment, I will try my best to make it simpler. Let me start with rustup override. Here, we can:

  • rustup override list which list all the overrides (also marks nonexistent directory where the overriden directory is not there anymore)
  • rustup override set <toolchain> to set the toolchain for the current directory
  • rustup override unset to reset to the default toolchain (can also specify the path to unset with --path)
  • rustup override unset --nonexistent to reset the default behavior for all nonexistent behavior

(Nice, just noticed that rustup override set does not have path, I probably send a patch for them to make it consistent)

Currently, cargo install-update-config can only do the set part above, it would be nice to have.

  • cargo install-update-config list to show a list of items that are overridden and if possible their values as well
  • cargo install-update-config set same as above, just to avoid confusion with the following
  • cargo install-update-config unset to reset the behavior for the crate (remove the entire block from config)
  • cargo install-update-config unset -x to reset the behavior for just a part of the crate (in this case only -x)

Another possible implementation but without the cargo install-update-config unset -x feature which would be easier to implement as of the current case but the behavior will be slightly different from rustup override. Drawback: too many flags and might be confusing when flags combined.

  • cargo install-update-config -l to list items similar to above
  • cargo install-update-config -? I don't know what is most likely to put here to reset (remove the entire block from config)
  • in this case, the other commands can be kept

As well, it would be nice to specify the config files in the man pages that is used by cargo install-update-config just in case would like to edit it manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants