Skip to content

Commit

Permalink
Merge pull request #148 from aetherknight/output_for_ps1_prompt
Browse files Browse the repository at this point in the history
Adding show-toolchain for command line prompts.
  • Loading branch information
brson committed Apr 15, 2016
2 parents 3f5a98c + 443331a commit 0d98a59
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/multirust
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# update Install or update a given toolchain (for example, "stable", "beta", "nightly")
# show-override Show information about the current override
# show-default Show information about the current default
# show-toolchain Show the name of the current toolcain
# list-overrides List all overrides
# list-toolchains List all installed toolchains
# remove-override Remove an override, for current directory unless specified
Expand Down Expand Up @@ -160,6 +161,14 @@
#
# </help-show-override>

# <help-show-toolchain>
#
# Displays the name of the toolchain that would be used.
#
# Usage: multirust show-toolchain
#
# </help-show-toolchain>

# <help-list-overrides>
#
# Displays a list of all overrides.
Expand Down Expand Up @@ -463,6 +472,7 @@ handle_command_line_args() {
override
show-default
show-override
show-toolchain
list-overrides
list-toolchains
remove-override
Expand Down Expand Up @@ -546,6 +556,7 @@ handle_command_line_args() {

show-default) show_default;;
show-override) show_override;;
show-toolchain) show_toolchain;;
list-overrides) list_overrides;;
list-toolchains) list_toolchains;;
remove-override)
Expand Down Expand Up @@ -1341,6 +1352,18 @@ show_override() {
fi
}

show_toolchain() {
local _toolchain=
if find_override; then
_toolchain="$RETVAL_TOOLCHAIN"
elif find_default; then
_toolchain="$RETVAL_TOOLCHAIN"
else
_toolchain="No default"
fi
echo "$_toolchain"
}

show_tool_versions() {
local _toolchain="$1"

Expand Down

0 comments on commit 0d98a59

Please sign in to comment.