aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2006-12-18 15:11:58 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2006-12-18 15:11:58 +0000
commit66f79706f9c0f71d89d8badb1253806264039af4 (patch)
treea050a07acc9dbb4947602e76ac4113b5c6fb87b9
parent5e76134e3d4ef0cb7ad82f3f66185e1902ab8480 (diff)
downloadpaludis-66f79706f9c0f71d89d8badb1253806264039af4.tar.gz
paludis-66f79706f9c0f71d89d8badb1253806264039af4.tar.xz
Fixup qualudis.rb
-rw-r--r--ruby/demos/qualudis.rb19
1 files changed, 13 insertions, 6 deletions
diff --git a/ruby/demos/qualudis.rb b/ruby/demos/qualudis.rb
index fc360f6..387f8f4 100644
--- a/ruby/demos/qualudis.rb
+++ b/ruby/demos/qualudis.rb
@@ -72,6 +72,10 @@ def do_check_kind(maker, ok, fatal, value)
checks.sort_by {|x| maker.find_check(x).is_important? ? 1 : 0 }
checks.each do |check_name|
begin
+ unless @checks.empty?
+ next unless @checks.include? check_name
+ end
+
r = maker.find_check(check_name).check(value)
if r.empty?
@@ -254,25 +258,28 @@ end
@quiet = false
@min_level = QALevel::Info
@write_cache_dir = '/var/empty'
-@one_check = nil
+@checks = []
describe = false
-Log.instance.log_level = LogLevel::Warning
+Log.instance.log_level = LogLevel::Qa
Log.instance.program_name = $0
opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--version', '-V', GetoptLong::NO_ARGUMENT ],
[ '--describe', '-d', GetoptLong::NO_ARGUMENT ],
- [ '--chcek', '-c', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--qa-check', '-c', GetoptLong::REQUIRED_ARGUMENT ],
[ '--log-level', '-L', GetoptLong::REQUIRED_ARGUMENT ],
[ '--message-level', '-M', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--verbose', '-v', GetoptLong::NO_ARGUMENT ],
+ [ '--quiet', '-q', GetoptLong::NO_ARGUMENT ],
[ '--write-cache-dir', GetoptLong::REQUIRED_ARGUMENT ])
opts.each do | opt, arg |
case opt
when '--help'
- puts "Usage: " + $0 + " [options] keyword1 keyword2 ...."
+ puts "Usage: " + $0 + " [options]"
+ puts "Usage: " + $0 + " [package/category ..]"
puts
puts "Actions:"
puts " --describe, -d Display program version"
@@ -310,10 +317,10 @@ opts.each do | opt, arg |
exit 0
when '--qa-check'
- @one_check = arg
+ @checks << arg
when '--verbose'
- @verose = true
+ @verbose = true
when '--quiet'
@quiet = true