diff --git a/bin/dep b/bin/dep index 9be029d..dcf81c0 100755 --- a/bin/dep +++ b/bin/dep @@ -146,43 +146,41 @@ private end end -if __FILE__ == $0 - Dep::CLI.file = File.join(Dir.pwd, ".gems") - Dep::CLI.prerelease = false +Dep::CLI.file = File.join(Dir.pwd, ".gems") +Dep::CLI.prerelease = false - on("-f") do |file| - Dep::CLI.file = file - end - - on("--pre") do - Dep::CLI.prerelease = true - end +on("-f") do |file| + Dep::CLI.file = file +end - on("--help") do - IO.popen("less", "w") { |f| f.write(DATA.read) } - exit - end +on("--pre") do + Dep::CLI.prerelease = true +end - Dep::CLI.list = Dep::List.new(Dep::CLI.file) - - FileUtils.touch(Dep::CLI.list.path) unless File.exist?(Dep::CLI.list.path) - - case ARGV[0] - when "add" - Dep::CLI.add(ARGV[1]) - when "rm" - Dep::CLI.rm(ARGV[1]) - when "install", "i" - Dep::CLI.install - when nil - Dep::CLI.check - else - Dep::CLI.abort - end +on("--help") do + IO.popen("less", "w") { |f| f.write(DATA.read) } + exit +end +Dep::CLI.list = Dep::List.new(Dep::CLI.file) + +FileUtils.touch(Dep::CLI.list.path) unless File.exist?(Dep::CLI.list.path) + +case ARGV[0] +when "add" + Dep::CLI.add(ARGV[1]) +when "rm" + Dep::CLI.rm(ARGV[1]) +when "install", "i" + Dep::CLI.install +when nil, "check" + Dep::CLI.check +else + Dep::CLI.abort end + __END__ DEP(1) @@ -191,13 +189,13 @@ NAME dep -- Basic dependency tracking SYNOPSIS - dep + dep [check] dep add libname [--pre] dep rm libname dep install DESCRIPTION - dep + dep [check] Checks that all dependencies are met. dep add [gemname]