lib/cli.rb in inqlude-0.0.7 vs lib/cli.rb in inqlude-0.0.8

- old
+ new

@@ -95,33 +95,38 @@ desc "show <library_name>", "Show library details" def show name Upstream.get_involved "Add command for showing library details", 1 end - desc "verify", "Verify manifests" - def verify + desc "verify [filename]", "Verify all manifests or specific file if filename is given" + def verify filename=nil process_global_options options v = Verifier.new @@settings - handler = ManifestHandler.new @@settings - handler.read_remote - count_ok = 0 - count_error = 0 - handler.libraries.each do |library| - library.manifests.each do |manifest| - result = v.verify manifest - result.print_result - if result.valid? - count_ok += 1 - else - count_error += 1 + if filename + result = v.verify_file filename + result.print_result + else + handler = ManifestHandler.new @@settings + handler.read_remote + count_ok = 0 + count_error = 0 + handler.libraries.each do |library| + library.manifests.each do |manifest| + result = v.verify manifest + result.print_result + if result.valid? + count_ok += 1 + else + count_error += 1 + end end end + puts "#{handler.manifests.count} manifests checked. #{count_ok} ok, " + + "#{count_error} with error." end - puts "#{handler.manifests.count} manifests checked. #{count_ok} ok, " + - "#{count_error} with error." end desc "system_scan", "Scan system for installed Qt libraries and create manifests" method_option :dry_run, :type => :boolean, :desc => "Dry run. Don't write files." @@ -143,14 +148,24 @@ m.process_all_rpms end desc "create <manifest_name> <version> <release_date>", "Create new or updated manifest" + method_option :kf5, :type => :boolean, + :desc => "Create KDE Framworks 5 template", :required => false def create name, version, release_date @@settings.manifest_path = "." creator = Creator.new @@settings, name - creator.validate_directory - creator.create version, release_date + if creator.is_new? + creator.validate_directory + creator.update version, release_date + else + if options[:kf5] + creator.create_kf5 version, release_date + else + creator.create version, release_date + end + end end desc "get_involved", "Information about how to get involved" def get_involved Upstream.print_info