From eb83766eec2b7d00be4730fe529e6cfd2df2abf7 Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Mon, 20 Apr 2020 23:13:54 +0800 Subject: [PATCH] settings: enable and disable multiple keys at once Like ls/rm/cp/cat, users expect these things to be able to take multiple arguments and work on each of them. It's a pain in the ass when it doesn't. --- lib/iStats/settings.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/iStats/settings.rb b/lib/iStats/settings.rb index f13da95..90088ff 100644 --- a/lib/iStats/settings.rb +++ b/lib/iStats/settings.rb @@ -12,13 +12,13 @@ def delegate(stat) if (stat[1] == 'all') toggleAll("1") else - set(stat[1], "1") + stat[1..-1].each { |x| set(x, "1") } end when 'disable' if (stat[1] == 'all') toggleAll("0") else - set(stat[1], "0") + stat[1..-1].each { |x| set(x, "0") } end else puts "Unknown command"