diff options
author | hut <hut@lavabit.com> | 2009-07-20 05:07:13 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-07-20 05:07:13 +0200 |
commit | 168e1a1ee9f697aac699bf52ac779d9a30ca1bf0 (patch) | |
tree | 8428b7c71f90f753a085df75b78e8363da401ac2 | |
parent | 95f91fc6338438a33dbe7596d445ecb12a12912b (diff) | |
download | ranger-168e1a1ee9f697aac699bf52ac779d9a30ca1bf0.tar.gz |
added comments
-rwxr-xr-x | ranger | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/ranger b/ranger index cc95c619..645ea114 100755 --- a/ranger +++ b/ranger @@ -1,6 +1,6 @@ #!/usr/bin/ruby -Ku ##-------------------------------------------------- -# Ignore the following lines +# just ignore the following lines if false; then =begin @@ -8,11 +8,17 @@ fi; cd "`ranger --cd $@ 3>&1 1>&2`"; return =end end +##-------------------------------------------------- +# Ranger + version = '0.2.4' require 'pathname' $: << MYDIR = File.dirname(Pathname(__FILE__).realpath) +##-------------------------------------------------- +# parse arguments + ARGV.delete('--cd') if cd = ARGV.include?('--cd') if ARGV.size > 0 case ARGV.first @@ -32,11 +38,16 @@ else pwd = nil end +##-------------------------------------------------- +# require files + for file in Dir.glob "#{MYDIR}/code/**/*.rb" require file [MYDIR.size + 1 ... -3] end -## default options +##-------------------------------------------------- +# default options + opt = { :show_hidden => false, :sort => :name, @@ -58,6 +69,9 @@ opt = { :evil => false } +##-------------------------------------------------- +# initialization + class OptionClass < Struct.new(*opt.keys) def confirm_string; confirm ? super : "" end end @@ -91,6 +105,9 @@ end CLI.init_mouse( Option.mouse_interval ) +##-------------------------------------------------- +# run the shit & clean up afterwards + begin Fm.initialize( pwd ) Fm.main_loop |