From b3e491f2005e278b4533b3d935e96722b3facaa7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 12 Jul 2018 11:35:22 -0400 Subject: doc abstraction run only when processing flags require --- org/sdp.org | 29 +++++++++++++++++++++++++++++ src/sdp/sdp.d | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/org/sdp.org b/org/sdp.org index 15fd5d4..ac80370 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -229,6 +229,7 @@ look into using getopt #+NAME: sdp_args #+BEGIN_SRC d bool[string] opts = [ + "abstraction" : false, "assertions" : false, "concordance" : false, "debug" : false, @@ -272,6 +273,7 @@ string[string] settings = [ ]; auto helpInfo = getopt(args, std.getopt.config.passThrough, + "abstraction", "--abstraction document abstraction ", &opts["abstraction"], "assert", "--assert set optional assertions on", &opts["assertions"], "concordance", "--concordance file for document", &opts["concordance"], "debug", "--debug", &opts["debug"], @@ -435,6 +437,32 @@ struct OptActions { auto output_dir_set() { return settings["output-dir"]; } + auto abstraction() { + bool _is; + if ( + opts["abstraction"] + || concordance + || docbook + || epub + || html + || html_seg + || html_scroll + || manifest + || odt + || pdf + || postgresql + || qrcode + || sisupod + || source + || sqlite_discrete + || sqlite_update + || text + || xhtml + ) { + _is = true; + } else { _is = false; } + return _is; + } } auto _opt_action = OptActions(); #+END_SRC @@ -457,6 +485,7 @@ foreach(arg; args[1..$]) { } else if ( !(arg.match(rgx.src_pth_sst_or_ssm)) && _manifest_start.pod_manifest_file_with_path + && _opt_action.abstraction ) { string contents_location_raw_; string contents_location_; diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d index 0093f74..8b8703f 100755 --- a/src/sdp/sdp.d +++ b/src/sdp/sdp.d @@ -57,6 +57,7 @@ void main(string[] args) { } } bool[string] opts = [ + "abstraction" : false, "assertions" : false, "concordance" : false, "debug" : false, @@ -100,6 +101,7 @@ void main(string[] args) { ]; auto helpInfo = getopt(args, std.getopt.config.passThrough, + "abstraction", "--abstraction document abstraction ", &opts["abstraction"], "assert", "--assert set optional assertions on", &opts["assertions"], "concordance", "--concordance file for document", &opts["concordance"], "debug", "--debug", &opts["debug"], @@ -257,6 +259,32 @@ void main(string[] args) { auto output_dir_set() { return settings["output-dir"]; } + auto abstraction() { + bool _is; + if ( + opts["abstraction"] + || concordance + || docbook + || epub + || html + || html_seg + || html_scroll + || manifest + || odt + || pdf + || postgresql + || qrcode + || sisupod + || source + || sqlite_discrete + || sqlite_update + || text + || xhtml + ) { + _is = true; + } else { _is = false; } + return _is; + } } auto _opt_action = OptActions(); auto _env = [ @@ -273,6 +301,7 @@ void main(string[] args) { } else if ( !(arg.match(rgx.src_pth_sst_or_ssm)) && _manifest_start.pod_manifest_file_with_path + && _opt_action.abstraction ) { string contents_location_raw_; string contents_location_; -- cgit v1.2.3