diff options
author | Karl Berry <karl@freefriends.org> | 2006-11-16 01:02:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-11-16 01:02:47 +0000 |
commit | 3c85b55e2f245fb7edac7e445f107e6d0bb423ae (patch) | |
tree | c62b7f80edafe0455310d08e09f4218127bf9e87 /Master/texmf-dist/scripts/context/ruby/fcd_start.rb | |
parent | e5ecff27a26ef59e1dbe9702677687fd7107be3a (diff) |
context update
git-svn-id: svn://tug.org/texlive/trunk@2444 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/context/ruby/fcd_start.rb')
-rw-r--r-- | Master/texmf-dist/scripts/context/ruby/fcd_start.rb | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/Master/texmf-dist/scripts/context/ruby/fcd_start.rb b/Master/texmf-dist/scripts/context/ruby/fcd_start.rb index 8ac48f79e8c..348ac75ba83 100644 --- a/Master/texmf-dist/scripts/context/ruby/fcd_start.rb +++ b/Master/texmf-dist/scripts/context/ruby/fcd_start.rb @@ -256,6 +256,8 @@ class FastCD @result = @list.grep(/\/#{@pattern}[^\/]*$/i) end end + else + puts(Dir.pwd.gsub(/\\/o, '/')) end rescue end @@ -403,31 +405,37 @@ class FastCD end +$stdout.sync = true + verbose, action, args = false, :find, Array.new -usage = "fcd [--make|add|show|find] [--verbose] [pattern]" +usage = "fcd [--add|clear|find|list|make|show|stub] [--verbose] [pattern]" +version = "1.0.2" + +def quit(message) + puts(message) + exit +end ARGV.each do |a| case a - when '-v', '--verbose' then verbose = true - when '-m', '--make' then action = :make - when '-c', '--clear' then action = :clear when '-a', '--add' then action = :add - when '-s', '--show' then action = :show - when '-l', '--list' then action = :show + when '-c', '--clear' then action = :clear when '-f', '--find' then action = :find + when '-l', '--list' then action = :show + when '-m', '--make' then action = :make + when '-s', '--show' then action = :show when '--stub' then action = :stub - when '-h', '--help' then puts "usage: #{usage}" ; exit - when /^\-\-.*/ then puts "unknown switch: #{a}" + "\n" + "usage: #{usage}" ; exit + when '-v', '--verbose' then verbose = true + when '--version' then quit("version: #{version}") + when '-h', '--help' then quit("usage: #{usage}") + when /^\-\-.*/ then quit("error: unknown switch #{a}, try --help") else args << a end end -$stdout.sync = true - fcd = FastCD.new(verbose) - -fcd.report("Fast Change Dir / version 1.0") +fcd.report("Fast Change Dir / version #{version}") case action when :make then |