42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/Wiki2Go/Server.rb', line 42
def initialize(args)
puts "Args = #{args.inspect}"
opts = OptionParser.new
dir = Dir.pwd
port = 8081
wiki = 'Wiki2Go'
single = false
allow_dynamic = false
modulename = ''
cvsroot = ''
blogstyle = false
opts.on("-d",'--dir <directory>','(default is current directory)',String) { |val| dir = File.expand_path(val) }
opts.on("-p",'--port <nb>',"(default is port 8081)",String) { |val| port = val }
opts.on("-w",'--wiki <wikiname>',"(default is 'Wiki2Go')",String) { |val| wiki = val }
opts.on("-s","--single","Single or multi-wiki (default)") { |val| single = true }
opts.on('-r','--rublets','Allow dynamic pages') { |val| allow_dynamic = true }
opts.on('-m','--module name','CVS module') { |val| modulename = val }
opts.on('-c','--cvsroot root','CVS root') { |val| cvsroot = val }
opts.on('-b','--blogstyle','RSS contains creation date') { |val| blogstyle = true }
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
opts.parse(args)
@config = LocalConfig.new(dir)
@config.port = port
@config.default_web = wiki
@config.generate_html = false
@config.multi_wiki = !single
@config.allow_dynamic_pages = allow_dynamic
@config.blog_style = blogstyle
if !cvsroot.empty? && !modulename.empty? then
@config.use_repository(cvsroot,modulename)
end
end
|