From 6dc69228f20b3566320b52966b3782d633171e71 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 27 Nov 2017 20:35:14 -0500 Subject: 0.20.2 paths, config & manifest files --- src/sdp/sdp.d | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/sdp/sdp.d') diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d index ac022ba..a9f63e2 100755 --- a/src/sdp/sdp.d +++ b/src/sdp/sdp.d @@ -300,21 +300,19 @@ void main(string[] args) { } auto _opt_action = OptActions(); foreach(arg; args[1..$]) { + auto _manifest = ManifestFile!()(arg); if (arg.match(rgx.flag_action)) { flag_action ~= " " ~ arg; // flags not taken by getopt } else if (arg.match(rgx.src_pth)) { fns_src ~= arg; // gather input markup source file names for processing - } else if (arg.match(rgx.src_pth_contents) - || ((arg.isDir) && ((arg.chainPath("sisudoc.txt").array).isFile)) - ) { + } else if (_manifest.manifest_file_and_path) { string contents_location_; - string sisudoc_txt_; - if ((arg.chainPath("sisudoc.txt").array).isFile) { - sisudoc_txt_ = arg.chainPath("sisudoc.txt").array; - } else if (arg.match(rgx.src_pth_contents)) { - sisudoc_txt_ = arg; - } else { - } + string sisudoc_txt_ = _manifest.manifest_file_and_path; + enforce( + exists(sisudoc_txt_)!=0, + "file not found: «" ~ + sisudoc_txt_ ~ "»" + ); try { if (exists(sisudoc_txt_)) { contents_location_ = sisudoc_txt_.readText; -- cgit v1.2.3