From 443331a8243ba440b43ca387b099cf0c206c51e1 Mon Sep 17 00:00:00 2001 From: "William (B.J.) Snow Orvis" Date: Sat, 19 Mar 2016 17:03:00 -0700 Subject: [PATCH] Adding show-toolchain for command line prompts. --- src/multirust | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/multirust b/src/multirust index ebfd087..17c696e 100755 --- a/src/multirust +++ b/src/multirust @@ -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 @@ -160,6 +161,14 @@ # # +# +# +# Displays the name of the toolchain that would be used. +# +# Usage: multirust show-toolchain +# +# + # # # Displays a list of all overrides. @@ -463,6 +472,7 @@ handle_command_line_args() { override show-default show-override + show-toolchain list-overrides list-toolchains remove-override @@ -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) @@ -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"