aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-01-01 23:03:43 +0100
committerThomas Deutschmann <whissi@gentoo.org>2020-01-01 23:05:18 +0100
commitc8561adb88c9ade4705ae4e56b3c50a83c9c7af4 (patch)
treef434b73dd78eba3c20986214ac184948315a4390
parentbump version to 20190311 (diff)
downloadeselect-rust-c8561adb88c9ade4705ae4e56b3c50a83c9c7af4.tar.gz
eselect-rust-c8561adb88c9ade4705ae4e56b3c50a83c9c7af4.tar.bz2
eselect-rust-c8561adb88c9ade4705ae4e56b3c50a83c9c7af4.zip
Add show action
Closes: https://bugs.gentoo.org/704502 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Closes: https://github.com/jauhien/eselect-rust/pull/5 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--rust.eselect.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/rust.eselect.in b/rust.eselect.in
index 311d8c0..8e4ea3a 100644
--- a/rust.eselect.in
+++ b/rust.eselect.in
@@ -264,6 +264,26 @@ do_set() {
set_version "$1" || die -q "Couldn't set new active version"
}
+### show action ###
+
+describe_show() {
+ echo "Show the current Rust implementation"
+}
+
+do_show() {
+ [[ -z "${@}" ]] || die -q "Too many parameters"
+ write_list_start "Current Rust implementation:"
+
+ local targets=( $(find_targets) )
+ local target=$(get_current_target)
+
+ if is_number "${target}"; then
+ write_kv_list_entry "${targets[target]}" ""
+ else
+ write_kv_list_entry "(unset)" ""
+ fi
+}
+
### update action ###
describe_update() {