summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDavid Gamba <david.gamba@calgaryscientific.com>2014-08-14 17:05:47 -0600
committerDavid Gamba <david.gamba@calgaryscientific.com>2014-08-14 17:07:08 -0600
commite4ea50fe72fd84370a1288ab5a1481bb6b0e9008 (patch)
tree0efe482c486e6dd1e4f28a5ce135781e20c09f40 /bin
parent6e16ba5a91f6b7b580e039801008df985282e48e (diff)
resolves #18 Add base_dir command line option
Diffstat (limited to 'bin')
-rwxr-xr-xbin/asciidoctor-pdf8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/asciidoctor-pdf b/bin/asciidoctor-pdf
index d7037b07..b52e9281 100755
--- a/bin/asciidoctor-pdf
+++ b/bin/asciidoctor-pdf
@@ -21,6 +21,11 @@ to_dir = if ARGV[0] == '-D'
ARGV.shift
end
+base_dir = if ARGV[0] == '-B'
+ ARGV.shift
+ ARGV.shift
+end
+
asciidoc_file = ARGV[0] || %(README.adoc)
unless (File.exist? asciidoc_file) && (File.readable? asciidoc_file)
warn %(ERROR: The specified file does not exist or cannot be read: #{asciidoc_file})
@@ -53,7 +58,8 @@ options = {
safe: :safe,
template_dir: TemplatesDir,
header_footer: true,
- attributes: attributes
+ attributes: attributes,
+ base_dir: base_dir
}
options[:extensions_registry] = Asciidoctor::Extensions.build_registry :pdf do