asciidoctor / asciidoctor-cli.js

The Command Line Interface (CLI) for Asciidoctor.js
https://asciidoctor.org
MIT License
15 stars 9 forks source link

Allow multiple attributes to be specified #12

Closed mojavelinux closed 6 years ago

mojavelinux commented 7 years ago

It's possible to specify multiple attributes, but it's not consistent with how the asciidoctor commandline works. Right now, you have to separate the attributes by spaces:

asciidoctorjs -a 'icons=font linkcss' sample.adoc

Ideally, it should be possible to specify the -a flag multiple times:

asciidoctorjs -a icons=font -a linkcss sample.adoc

However, that depends on array support in the cli package (see https://github.com/node-js-libs/cli/issues/62).

As an alternative, we should allow attributes to be separated by commas so that quotes are not needed:

asciidoctorjs -a icons=font,linkcss sample.adoc

(this syntax used to be possible in Asciidoctor core, but was dropped).

If no change is made to the code, we should at least document in the README how to specify multiple attributes since it is different from the asciidoctor command.

ggrossetie commented 6 years ago

As suggested by @mojavelinux we should switch to https://www.npmjs.com/package/yargs

mojavelinux commented 6 years ago

:+1: