Skip to content

Commit

Permalink
Fixed adamcooke#30
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Nov 23, 2024
1 parent 37606f4 commit b931cd6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/procodile.cr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ command = ARGV[0]? || "help"
options = {} of Symbol => String
cli = Procodile::CLI.new

OptionParser.parse do |parser|
opt = OptionParser.new do |parser|
parser.banner = "Usage: procodile #{command} [options]"

parser.on("-r", "--root PATH", "The path to the root of your application") do |root|
Expand All @@ -42,12 +42,16 @@ OptionParser.parse do |parser|
STDERR.puts parser
exit 1
end
end

if cli.class.commands[command]? && (option_block = cli.class.commands[command].options)
option_block.call(parser, cli)
end
if cli.class.commands[command]? && (option_block = cli.class.commands[command].options)
option_block.call(opt, cli)
end

opt.parse

command = ARGV[0]? || "help"

# Get the global configuration file data
global_config_path = ENV["PROCODILE_CONFIG"]? || "/etc/procodile"

Expand Down

0 comments on commit b931cd6

Please sign in to comment.