Skip to content
This repository was archived by the owner on Aug 4, 2026. It is now read-only.
This repository was archived by the owner on Aug 4, 2026. It is now read-only.

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

Description

@ggrossetie

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:

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions