Skip to content

Commit

Permalink
Merge pull request #91 from aaparella/explicit-remove
Browse files Browse the repository at this point in the history
Allow for explicit naming of overrides to remove
  • Loading branch information
brson committed Aug 19, 2015
2 parents 93aa9fa ca5250f commit e5480cf
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/multirust
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 13,7 @@
# show-default Show information about the current default
# list-overrides List all overrides
# list-toolchains List all installed toolchains
# remove-override Remove the current override
# remove-override Remove an override, for current directory unless specified
# remove-toolchain Uninstall a toolchain
# run Run a command in an environment configured for a toolchain
# delete-data Delete all user metadata, including installed toolchains
Expand Down Expand Up @@ -175,9 175,10 @@

# <help-remove-override>
#
# Removes the override for the current directory.
# Removes the override for the current directory, or the named override
# if one is provided.
#
# Usage: multirust remove-override
# Usage: multirust remove-override [override]
#
# </help-remove-override>

Expand Down Expand Up @@ -467,7 468,13 @@ handle_command_line_args() {
show-override) show_override;;
list-overrides) list_overrides;;
list-toolchains) list_toolchains;;
remove-override) remove_override;;
remove-override)
if [ -z "${2-}" ]; then
remove_override "$(pwd -P)"
else
remove_override $2
fi
;;

remove-toolchain)
if [ -z "${2-}" ]; then
Expand Down Expand Up @@ -1113,7 1120,7 @@ set_override() {
}

remove_override() {
local _override_dir="$(pwd -P)"
local _override_dir="$1"
assert_nz "$_override_dir" "empty pwd?"

# Escape forward-slashes
Expand All @@ -1133,7 1140,7 @@ remove_override() {
fi
fi
if [ $_have_override = false ]; then
say "no override for current directory '$_override_dir'"
say "no override for directory '$_override_dir'"
return
fi

Expand Down

0 comments on commit e5480cf

Please sign in to comment.