1 |
commit: c8561adb88c9ade4705ae4e56b3c50a83c9c7af4 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 1 22:03:43 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 1 22:05:18 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=c8561adb |
7 |
|
8 |
Add show action |
9 |
|
10 |
Closes: https://bugs.gentoo.org/704502 |
11 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
12 |
Closes: https://github.com/jauhien/eselect-rust/pull/5 |
13 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
14 |
|
15 |
rust.eselect.in | 20 ++++++++++++++++++++ |
16 |
1 file changed, 20 insertions(+) |
17 |
|
18 |
diff --git a/rust.eselect.in b/rust.eselect.in |
19 |
index 311d8c0..8e4ea3a 100644 |
20 |
--- a/rust.eselect.in |
21 |
+++ b/rust.eselect.in |
22 |
@@ -264,6 +264,26 @@ do_set() { |
23 |
set_version "$1" || die -q "Couldn't set new active version" |
24 |
} |
25 |
|
26 |
+### show action ### |
27 |
+ |
28 |
+describe_show() { |
29 |
+ echo "Show the current Rust implementation" |
30 |
+} |
31 |
+ |
32 |
+do_show() { |
33 |
+ [[ -z "${@}" ]] || die -q "Too many parameters" |
34 |
+ write_list_start "Current Rust implementation:" |
35 |
+ |
36 |
+ local targets=( $(find_targets) ) |
37 |
+ local target=$(get_current_target) |
38 |
+ |
39 |
+ if is_number "${target}"; then |
40 |
+ write_kv_list_entry "${targets[target]}" "" |
41 |
+ else |
42 |
+ write_kv_list_entry "(unset)" "" |
43 |
+ fi |
44 |
+} |
45 |
+ |
46 |
### update action ### |
47 |
|
48 |
describe_update() { |