bin/sculd in sculd-0.0.3 vs bin/sculd in sculd-0.1.0
- old
+ new
@@ -3,11 +3,12 @@
# Command 'sculd' can show events and tasks.
# Events include schedule and deadline(start and end).
# Tasks include deadline, reminder and todo.
-SCULD_DAT = "#{ENV['HOME']}/.sculd.dat"
+#SCULD_DAT = "#{ENV['HOME']}/.sculd.dat"
+SCULD_DIR = "#{ENV['HOME']}/.sculd"
require "pp"
require "optparse"
require "rubygems"
gem "sculd"
@@ -16,11 +17,11 @@
# option analysis
OPTS = {}
op = OptionParser.new
op.on("-e day", "--event days", "Show events."){|v| OPTS[:event] = v.to_i}
op.on("-t num", "--task num" , "Show tasks." ){|v| OPTS[:task ] = v.to_i}
-op.on("-f file", "--file datafile", "Indicate file."){|v| OPTS[:file] = v}
+#op.on("-f file", "--file datafile", "Indicate file."){|v| OPTS[:file] = v}
op.parse!(ARGV)
#num_day = ARGV.shift.to_i
#num_task = ARGV.shift.to_i
OPTS[:event] ||= 0
@@ -29,21 +30,21 @@
if (( OPTS[:event] == 0) &&( OPTS[:task ] == 0))
puts "USAGE: sculd -e 7 -t 10"
exit
end
-file = OPTS[:file]
-file ||= SCULD_DAT
+#file = OPTS[:file]
+#file ||= SCULD_DAT
-unless FileTest.exist? file
+unless FileTest.exist? SCULD_DIR
# lines = File.open(file, "r").readlines
#rescue
- puts "Not found #{file}. Exit."
+ puts "Not found #{SCULD_DIR}. Exit."
exit
end
begin
- sm = Sculd::Manager.new(file)
+ sm = Sculd::Manager.new(SCULD_DIR)
rescue Sculd::Manager::LoadError
puts "Exit."
exit
end
io = $stdout