From 2e0fc77bc80d7c6805eaa5917f61feba82207fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Arias=20de=20Reyna?= Date: Mon, 21 Jun 2021 10:14:22 +0200 Subject: [PATCH] feature(cli): Adding new parameter extensions Extensions define the files to process when adding a folder as path. Right now it defaults to [ '.js', '.leafdoc' ] always. --- src/cli.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cli.mjs b/src/cli.mjs index 91ba8ea..85ba773 100755 --- a/src/cli.mjs +++ b/src/cli.mjs @@ -39,7 +39,10 @@ const argv = minimist(process.argv.slice(2), { j: 'json', // 🍂option empty: Boolean=false; Akin to [Leafdoc.showInheritancesWhenEmpty](#leafdoc.showinheritanceswhenempty) // 🍂option e; Alias of `empty` - e: 'empty' + e: 'empty', + // 🍂option extensions: String='.js,.leafdoc'; Defines the extensions of the files to process. Optional. + // 🍂option e; Alias of `extensions` + x: 'extensions' }, boolean: ['v', 'verbose', 'j', 'json'], string: ['t', 'template', 'c', 'character'], @@ -62,7 +65,11 @@ argv._.forEach((filepath) => { } if (stats.isDirectory()) { - doc.addDir(filepath); + if(argv.extensions) { + doc.addDir(filepath, argv.extensions.split(',')); + } else { + doc.addDir(filepath); + } } } catch (e) { throw e;