From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 01338138334 for ; Wed, 1 Jan 2020 22:06:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4713AE0C0C; Wed, 1 Jan 2020 22:06:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 03663E0C0C for ; Wed, 1 Jan 2020 22:06:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 091E034DDB1 for ; Wed, 1 Jan 2020 22:06:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AB6A374 for ; Wed, 1 Jan 2020 22:05:58 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1577916318.c8561adb88c9ade4705ae4e56b3c50a83c9c7af4.whissi@gentoo> Subject: [gentoo-commits] proj/eselect-rust:master commit in: / X-VCS-Repository: proj/eselect-rust X-VCS-Files: rust.eselect.in X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: c8561adb88c9ade4705ae4e56b3c50a83c9c7af4 X-VCS-Branch: master Date: Wed, 1 Jan 2020 22:05:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b445097c-61d4-4941-bfd8-fdea041dc23a X-Archives-Hash: 7cb8b6d2bf88214caffd0bbca186b4cb commit: c8561adb88c9ade4705ae4e56b3c50a83c9c7af4 Author: Robin H. Johnson gentoo org> AuthorDate: Wed Jan 1 22:03:43 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Wed Jan 1 22:05:18 2020 +0000 URL: https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=c8561adb Add show action Closes: https://bugs.gentoo.org/704502 Signed-off-by: Robin H. Johnson gentoo.org> Closes: https://github.com/jauhien/eselect-rust/pull/5 Signed-off-by: Thomas Deutschmann gentoo.org> rust.eselect.in | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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() {