From 4e16bfb72bb0656b5df0181b808c36a8e2165b7d Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Sat, 18 Jan 2020 13:28:41 -0500 Subject: [PATCH] Ruby CLI now prints this project's version info in addition to upstream --- bin/asciidoctor-revealjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/asciidoctor-revealjs b/bin/asciidoctor-revealjs index b43eac22..efdf5ac7 100755 --- a/bin/asciidoctor-revealjs +++ b/bin/asciidoctor-revealjs @@ -9,6 +9,13 @@ require 'asciidoctor/cli' options = Asciidoctor::Cli::Options.new backend: 'revealjs' +# FIXME (from asciidoctor-pdf) provide an API in Asciidoctor for sub-components to print version information +unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty? + $stdout.write %(Asciidoctor reveal.js #{Asciidoctor::Revealjs::VERSION} using ) + options.print_version + exit 0 +end + # FIXME (from bespoke) This is a really bizarre API. Please make me simpler. if Integer === (result = options.parse! ARGV) exit result