Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e3b76ec6ea
Fetching contributors…

Cannot retrieve contributors at this time

executable file 28 lines (23 sloc) 0.573 kb
#! /usr/bin/env ruby
$: << File.expand_path(File.dirname( File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__ ))
require 'lib/todo'
list_name = ARGV.length > 0 ? ARGV.shift : 'all'
# Ensure base_dir exists
`mkdir -p #{Todo.base_dir}`
if list_name == 'all'
Todo::List.all.each do |l|
puts l
puts
end
else
list = Todo::List.find(list_name)
if ARGV.length == 0
puts list
elsif ARGV.length == 1 && ARGV[0].to_i > 0
i = ARGV[0].to_i
puts "#{list.name} #{list.items[i-1]}"
else
task = ARGV.join(' ')
list.add(task)
end
end
Jump to Line
Something went wrong with that request. Please try again.