mirror of https://github.com/Calamitous/iris.git
Clean up unused Config code
This commit is contained in:
parent
9d7c9f20ec
commit
2383c93396
28
iris.rb
28
iris.rb
|
@ -17,26 +17,6 @@ class Config
|
||||||
USER = ENV['USER'] || ENV['LOGNAME'] || ENV['USERNAME']
|
USER = ENV['USER'] || ENV['LOGNAME'] || ENV['USERNAME']
|
||||||
HOSTNAME = `hostname -d`.chomp
|
HOSTNAME = `hostname -d`.chomp
|
||||||
AUTHOR = "#{USER}@#{HOSTNAME}"
|
AUTHOR = "#{USER}@#{HOSTNAME}"
|
||||||
OPTIONS = %w[
|
|
||||||
--debug
|
|
||||||
--dump
|
|
||||||
--help
|
|
||||||
--interactive
|
|
||||||
--mark-all-read
|
|
||||||
--stats
|
|
||||||
--test-file
|
|
||||||
--version
|
|
||||||
-d
|
|
||||||
-f
|
|
||||||
-h
|
|
||||||
-i
|
|
||||||
-p
|
|
||||||
-s
|
|
||||||
-v
|
|
||||||
]
|
|
||||||
INTERACTIVE_OPTIONS = %w[-i --interactive]
|
|
||||||
NONINTERACTIVE_OPTIONS = %w[-d --dump -h --help -v --version -s --stats --mark-all-read]
|
|
||||||
NONFILE_OPTIONS = %w[-h --help -v --version]
|
|
||||||
|
|
||||||
@@debug_mode = false
|
@@debug_mode = false
|
||||||
|
|
||||||
|
@ -1063,12 +1043,16 @@ class CLI
|
||||||
end
|
end
|
||||||
|
|
||||||
class Startupper
|
class Startupper
|
||||||
|
INTERACTIVE_OPTIONS = %w[-i --interactive]
|
||||||
|
NONINTERACTIVE_OPTIONS = %w[-d --dump -h --help -v --version -s --stats --mark-all-read]
|
||||||
|
NONFILE_OPTIONS = %w[-h --help -v --version]
|
||||||
|
|
||||||
def initialize(args)
|
def initialize(args)
|
||||||
perform_file_checks unless Config::NONFILE_OPTIONS.include?(args)
|
perform_file_checks unless NONFILE_OPTIONS.include?(args)
|
||||||
|
|
||||||
load_corpus(args)
|
load_corpus(args)
|
||||||
|
|
||||||
is_interactive = (args & Config::NONINTERACTIVE_OPTIONS).none? || (args & Config::INTERACTIVE_OPTIONS).any?
|
is_interactive = (args & NONINTERACTIVE_OPTIONS).none? || (args & INTERACTIVE_OPTIONS).any?
|
||||||
|
|
||||||
Config.enable_debug_mode if (args & %w{--debug}).any?
|
Config.enable_debug_mode if (args & %w{--debug}).any?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue