Add TODOs for current switches

This commit is contained in:
Tom Bell 2012-12-19 16:34:03 +00:00
parent 053c2eb0a7
commit 4578c15a24
1 changed files with 25 additions and 1 deletions

View File

@ -25,88 +25,108 @@ options = {}
opts = OptionParser.new do |opts| opts = OptionParser.new do |opts|
opts.banner = help opts.banner = help
# TODO: delete, migrator related
opts.on("--file [PATH]", "File to import from") do |import_file| opts.on("--file [PATH]", "File to import from") do |import_file|
options['file'] = import_file options['file'] = import_file
end end
# TODO: delete, migrator related
opts.on("--dbname [TEXT]", "DB to import from") do |import_dbname| opts.on("--dbname [TEXT]", "DB to import from") do |import_dbname|
options['dbname'] = import_dbname options['dbname'] = import_dbname
end end
# TODO: delete, migrator related
opts.on("--user [TEXT]", "Username to use when importing") do |import_user| opts.on("--user [TEXT]", "Username to use when importing") do |import_user|
options['user'] = import_user options['user'] = import_user
end end
# TODO: delete, migrator related
opts.on("--pass [TEXT]", "Password to use when importing") do |import_pass| opts.on("--pass [TEXT]", "Password to use when importing") do |import_pass|
options['pass'] = import_pass options['pass'] = import_pass
end end
# TODO: delete, migrator related
opts.on("--host [HOST ADDRESS]", "Host to import from") do |import_host| opts.on("--host [HOST ADDRESS]", "Host to import from") do |import_host|
options['host'] = import_host options['host'] = import_host
end end
# TODO: delete, migrator related
opts.on("--site [SITE NAME]", "Site to import from") do |import_site| opts.on("--site [SITE NAME]", "Site to import from") do |import_site|
options['site'] = import_site options['site'] = import_site
end end
# TODO: global option
opts.on("--[no-]safe", "Safe mode (default unsafe)") do |safe| opts.on("--[no-]safe", "Safe mode (default unsafe)") do |safe|
options['safe'] = safe options['safe'] = safe
end end
# TODO: option for build and serve command
opts.on("--[no-]auto", "Auto-regenerate") do |auto| opts.on("--[no-]auto", "Auto-regenerate") do |auto|
options['auto'] = auto options['auto'] = auto
end end
# TODO: new serve command
opts.on("--server [PORT]", "Start web server (default port 4000)") do |port| opts.on("--server [PORT]", "Start web server (default port 4000)") do |port|
options['server'] = true options['server'] = true
options['server_port'] = port unless port.nil? options['server_port'] = port unless port.nil?
end end
# TODO: remove
opts.on("--no-server", "Do not start a web server") do |part| opts.on("--no-server", "Do not start a web server") do |part|
options['server'] = false options['server'] = false
end end
# TODO: option for serve command
opts.on("--base-url [BASE_URL]", "Serve website from a given base URL (default '/'") do |baseurl| opts.on("--base-url [BASE_URL]", "Serve website from a given base URL (default '/'") do |baseurl|
options['baseurl'] = baseurl options['baseurl'] = baseurl
end end
# TODO: does anyone actually use this?
opts.on("--default-mimetype [MT]", "Mimetype to use when no file extension (if --server)") do |mt| opts.on("--default-mimetype [MT]", "Mimetype to use when no file extension (if --server)") do |mt|
options['default-mimetype'] = mt options['default-mimetype'] = mt
end end
# TODO: option for build and serve command
opts.on("--[no-]lsi", "Use LSI for better related posts") do |lsi| opts.on("--[no-]lsi", "Use LSI for better related posts") do |lsi|
options['lsi'] = lsi options['lsi'] = lsi
end end
# TODO: remove and just enable all the time?
opts.on("--[no-]pygments", "Use pygments to highlight code") do |pygments| opts.on("--[no-]pygments", "Use pygments to highlight code") do |pygments|
options['pygments'] = pygments options['pygments'] = pygments
end end
# TODO: read from config
opts.on("--rdiscount", "Use rdiscount gem for Markdown") do opts.on("--rdiscount", "Use rdiscount gem for Markdown") do
options['markdown'] = 'rdiscount' options['markdown'] = 'rdiscount'
end end
# TODO: read from config
opts.on("--redcarpet", "Use redcarpet gem for Markdown") do opts.on("--redcarpet", "Use redcarpet gem for Markdown") do
options['markdown'] = 'redcarpet' options['markdown'] = 'redcarpet'
end end
# TODO: read from config
opts.on("--kramdown", "Use kramdown gem for Markdown") do opts.on("--kramdown", "Use kramdown gem for Markdown") do
options['markdown'] = 'kramdown' options['markdown'] = 'kramdown'
end end
# TODO: remove and just generate the site as is?
opts.on("--time [TIME]", "Time to generate the site for") do |time| opts.on("--time [TIME]", "Time to generate the site for") do |time|
options['time'] = Time.parse(time) options['time'] = Time.parse(time)
end end
# TODO: remove and just render all posts which aren't 'unpublished'?
opts.on("--[no-]future", "Render future dated posts") do |future| opts.on("--[no-]future", "Render future dated posts") do |future|
options['future'] = future options['future'] = future
end end
# TODO: read from config
opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style| opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
options['permalink'] = style unless style.nil? options['permalink'] = style unless style.nil?
end end
# TODO: read from config
opts.on("--paginate [POSTS_PER_PAGE]", "Paginate a blog's posts") do |per_page| opts.on("--paginate [POSTS_PER_PAGE]", "Paginate a blog's posts") do |per_page|
begin begin
options['paginate'] = per_page.to_i options['paginate'] = per_page.to_i
@ -117,6 +137,7 @@ opts = OptionParser.new do |opts|
end end
end end
# TODO: read from config
opts.on("--paginate_path [PAGINATED_URL_FORMAT]", "Leave blank for /page<num>") do |paginate_path| opts.on("--paginate_path [PAGINATED_URL_FORMAT]", "Leave blank for /page<num>") do |paginate_path|
begin begin
options['paginate_path'] = paginate_path options['paginate_path'] = paginate_path
@ -127,6 +148,7 @@ opts = OptionParser.new do |opts|
end end
end end
# TODO: read from config
opts.on("--limit_posts [MAX_POSTS]", "Limit the number of posts to publish") do |limit_posts| opts.on("--limit_posts [MAX_POSTS]", "Limit the number of posts to publish") do |limit_posts|
begin begin
options['limit_posts'] = limit_posts.to_i options['limit_posts'] = limit_posts.to_i
@ -137,6 +159,7 @@ opts = OptionParser.new do |opts|
end end
end end
# TODO: read from config
opts.on("--url [URL]", "Set custom site.url") do |url| opts.on("--url [URL]", "Set custom site.url") do |url|
options['url'] = url options['url'] = url
end end
@ -206,6 +229,7 @@ end
# Get source and destination from command line # Get source and destination from command line
# TODO: source and destination are now global options
case ARGV.size case ARGV.size
when 0 when 0
when 1 when 1