Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --safe option to set safe mode level to safe #47

Open
ggrossetie opened this issue Mar 29, 2019 · 0 comments
Open

Add --safe option to set safe mode level to safe #47

ggrossetie opened this issue Mar 29, 2019 · 0 comments

Comments

@ggrossetie
Copy link
Member

ggrossetie commented Mar 29, 2019

Asciidoctor Ruby is using the rule "last one wins" when both --safe-mode and --safe options are present:

$ echo '{safe-mode-name}' | asciidoctor -d inline --safe --safe-mode server -
server
$ echo '{safe-mode-name}' | asciidoctor -d inline --safe-mode server --safe -
safe

Or when the options are present multiple times:

$ echo '{safe-mode-name}' | asciidoctor -d inline --safe-mode server --safe --safe-mode unsafe -
unsafe

yargs also allows to use a value when an option is declared as a boolean, so the following commands are valid:

$ asciidoctor --safe=false doc.adoc
$ asciidoctor --safe=true doc.adoc
$ asciidoctor --safe value doc.adoc

I've opened two feature requests on yargs to be able to define flags (ie. boolean without argument) and shortcuts:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant