Sha256: 85b8b640c18901722b29432c31fd284f647c9b049d0216fecee90ef24271a8db

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2016 sawa

require "manager"

command_options = {debug: false}
ARGV.map!(&:+@)
while ARGV.first.sub!(/\A--?/, "")
	k, v = ARGV.shift.split("=")
	k, v = k.tr("-", "_").to_sym, v || true
	case k
	when :theme_list
		Dir.glob("#{__dir__}/../theme/*").each do
			|f|
			File.new(f).each.first[%r[/\*\s*(.+?)\s*\*/]]
			puts "#{File.basename(f)}#{" [#$1]" if $1}"
		end
		exit
	when :highlight_list
		puts CodeRay::Scanners.list
		exit
	when :spell_check_list
		puts Manager::Spellcheck.list
		exit
	when :spell_check_filter
		language = ARGV.shift
		begin
			a = Manager::Spellcheck.filter(language, ARGV)
			puts "The following words are not in the dictionary `#{language}`: "
			a.each{|w| puts w}
		rescue => e
			puts e.message
		end
		exit
	when :bdir, :odir, :user, :dev, :theme, :highlight, :debug, :spell_check, :case_sensitive, :case_insensitive, :timeout, :title, :coverage
		command_options.store(k, v)
	else abort "Invalid option #{k}"
	end
end
abort "Spec file not given" if ARGV.empty?
Manager.new(File.expand_path(ARGV.shift), **command_options)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
manager-0.1.1 bin/manager
manager-0.1.0 bin/manager