-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from elorest/master
Fixed error with newer versions of crystal where OptionParser now requires - before options
- Loading branch information
Showing
3 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/libs/ | ||
/.crystal/ | ||
/.shards/ | ||
guardian | ||
|
||
|
||
# Libraries don't need dependency lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
require "./guardian/*" | ||
require "option_parser" | ||
|
||
options_parser = OptionParser.new do |options| | ||
options.on "init", "Generates the .guardian.yml file" do | ||
Guardian::Generator.new.generate | ||
exit | ||
end | ||
case ARGV[0]? | ||
when "init" | ||
puts "\"init\" has been deprecated please use: -i or --init" | ||
Guardian::Generator.new.generate | ||
exit | ||
else | ||
OptionParser.parse! do |options| | ||
options.on "-i", "--init", "Generates the .guardian.yml file" do | ||
Guardian::Generator.new.generate | ||
exit | ||
end | ||
|
||
options.on "-v", "--version", "Shows the version" do | ||
puts "Guardian (#{Guardian::VERSION})" | ||
exit | ||
options.on "-v", "--version", "Shows the version" do | ||
puts "Guardian (#{Guardian::VERSION})" | ||
exit | ||
end | ||
end | ||
end | ||
|
||
options_parser.parse(ARGV.clone) | ||
|
||
Guardian::Watcher.new |