@@ -24,9 +24,9 @@ public class AsciidoctorCliOptions {
24
24
public static final String TEMPLATE_DIR = "-T" ;
25
25
public static final String TEMPLATE_ENGINE = "-E" ;
26
26
public static final String COMPACT = "-C" ;
27
- public static final String ERUBY = "-e" ;
28
- public static final String SECTION_NUMBERS = "-n" ;
27
+ public static final String EMBEDDED = "-e" ;
29
28
public static final String NO_HEADER_FOOTER = "-s" ;
29
+ public static final String SECTION_NUMBERS = "-n" ;
30
30
public static final String SAFE = "-S" ;
31
31
public static final String OUTFILE = "-o" ;
32
32
public static final String DOCTYPE = "-d" ;
@@ -37,16 +37,16 @@ public class AsciidoctorCliOptions {
37
37
public static final char ATTRIBUTE_SEPARATOR = '=' ;
38
38
public static final String TIMINGS_OPTION_NAME = "timings" ;
39
39
40
- @ Parameter (names = {VERBOSE , "--verbose" }, description = "enable verbose mode (default: false) " )
40
+ @ Parameter (names = {VERBOSE , "--verbose" }, description = "enable verbose mode" )
41
41
private boolean verbose = false ;
42
42
43
- @ Parameter (names = {TIMINGS , "--timings" }, description = "enable timings mode (default: false) " )
43
+ @ Parameter (names = {TIMINGS , "--timings" }, description = "enable timings mode" )
44
44
private boolean timings = false ;
45
45
46
46
@ Parameter (names = {VERSION , "--version" }, description = "display the version and runtime environment" )
47
47
private boolean version = false ;
48
48
49
- @ Parameter (names = {BACKEND , "--backend" }, description = "set output format backend (default: html5) " )
49
+ @ Parameter (names = {BACKEND , "--backend" }, description = "set output format backend" )
50
50
private String backend = "html5" ;
51
51
52
52
@ Parameter (names = {DOCTYPE , "--doctype" }, description = "document type to use when rendering output: [article, book, inline] (default: article)" )
@@ -61,16 +61,19 @@ public class AsciidoctorCliOptions {
61
61
@ Parameter (names = {SAFE , "--safe-mode" }, converter = SafeModeConverter .class , description = "set safe mode level explicitly: [unsafe, safe, server, secure] (default: unsafe)" )
62
62
private SafeMode safeMode = SafeMode .UNSAFE ;
63
63
64
- @ Parameter (names = {NO_HEADER_FOOTER , "--no-header-footer" }, description = "suppress output of header and footer (default: false) " )
64
+ @ Parameter (names = {NO_HEADER_FOOTER , "--no-header-footer" }, description = "suppress output of header and footer" )
65
65
private boolean noHeaderFooter = false ;
66
66
67
+ @ Parameter (names = {EMBEDDED , "--embedded" }, description = "suppress enclosing document structure and output an embedded document" )
68
+ private boolean embedded = false ;
69
+
67
70
@ Parameter (names = {SECTION_NUMBERS , "--section-numbers" }, description = "auto-number section titles; disabled by default" )
68
71
private boolean sectionNumbers = false ;
69
72
70
- @ Parameter (names = {ERUBY , "--eruby" }, description = "specify eRuby implementation to render built-in templates: [erb, erubis] (default: erb) " )
73
+ @ Parameter (names = {"--eruby" }, description = "specify eRuby implementation to render built-in templates: [erb, erubis]" )
71
74
private String eruby = "erb" ;
72
75
73
- @ Parameter (names = {COMPACT , "--compact" }, description = "compact the output by removing blank lines (default: false) " )
76
+ @ Parameter (names = {COMPACT , "--compact" }, description = "compact the output by removing blank lines" )
74
77
private boolean compact = false ;
75
78
76
79
@ Parameter (names = {TEMPLATE_ENGINE , "--template-engine" }, description = "template engine to use for the custom render templates (loads gem on demand)" )
@@ -88,7 +91,7 @@ public class AsciidoctorCliOptions {
88
91
@ Parameter (names = {SOURCE_DIR , "--source-dir" }, description = "source directory (requires destination directory)" )
89
92
private String sourceDir ;
90
93
91
- @ Parameter (names = {"--trace" }, description = "include backtrace information on errors (default: false) " )
94
+ @ Parameter (names = {"--trace" }, description = "include backtrace information on errors" )
92
95
private boolean trace = false ;
93
96
94
97
@ Parameter (names = {HELP , "--help" }, help = true , description = "show this message" )
@@ -97,10 +100,10 @@ public class AsciidoctorCliOptions {
97
100
@ Parameter (names = {ATTRIBUTE , "--attribute" }, description = "a list of attributes, in the form key or key=value pair, to set on the document" )
98
101
private List <String > attributes = new ArrayList <>();
99
102
100
- @ Parameter (names = {QUIET , "--quiet" }, description = "suppress warnings (default: false) " )
103
+ @ Parameter (names = {QUIET , "--quiet" }, description = "suppress warnings" )
101
104
private boolean quiet = false ;
102
105
103
- @ Parameter (names = {"--failure-level" }, converter = SeverityConverter .class , description = "set minimum log level that yields a non-zero exit code: [info, warning, error, fatal] (default: fatal) " )
106
+ @ Parameter (names = {"--failure-level" }, converter = SeverityConverter .class , description = "set minimum log level that yields a non-zero exit code. " )
104
107
private Severity failureLevel = Severity .FATAL ;
105
108
106
109
@ Parameter (names = {REQUIRE , "--require" }, description = "require the specified library before executing the processor (using require)" )
@@ -293,6 +296,10 @@ public Options parse() throws IOException {
293
296
optionsBuilder .safe (SafeMode .SAFE );
294
297
}
295
298
299
+ if (this .embedded ) {
300
+ optionsBuilder .option (Options .STANDALONE , false );
301
+ }
302
+
296
303
if (this .noHeaderFooter ) {
297
304
optionsBuilder .option (Options .STANDALONE , false );
298
305
}
@@ -368,7 +375,7 @@ private List<String> splitByPathSeparator(String path) {
368
375
}
369
376
370
377
private static boolean isEmpty (String path ) {
371
- return path == null || path .trim ().length () == 0 ;
378
+ return path == null || path .trim ().isEmpty () ;
372
379
}
373
380
374
381
}
0 commit comments