-
Notifications
You must be signed in to change notification settings - Fork 0
/
cards
executable file
·60 lines (47 loc) · 1.15 KB
/
cards
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env ruby
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
puts "Segmentation fault"
exit
end
require "pp"
require "yaml"
require 'optparse'
@@options = {:config => "~/.cardsrc"}
OptionParser.new do |opts|
opts.on( '-h', '--help', 'Display this screen' ) do
puts opts
exit
end
opts.on( '-c', '--config FILE', "Config file" ) do |f|
@@options[:config] = f
end
end.parse!
require "lib/hash.rb"
require "cards_helper.rb"
require "dir_mode.rb"
require "file_mode.rb"
require "fileutils.rb"
require "lib/def.rb"
require "lib/bind.rb"
Dir.glob(File.dirname(__FILE__) + '/commands/*', &method(:require))
user_commands_file = File.expand_path "~/.bu_commands.rb"
require user_commands_file if File.exist? user_commands_file
require "rubygems"
require "backports"
require 'colored'
require "natural_sort_kernel"
require "highline/system_extensions"
include HighLine::SystemExtensions
def main
trap("INT") do
exit
end
dir = if have_args?
ex_pth ARGV[0]
else
ex_pth(rc("default_dir"))
end
goto_dir_mode dir
end
main