about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xranger21
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