diff --git a/README.md b/README.md index 5e3464c..96b1ff0 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,20 @@ Generate a directory structure tree Options: -V, --version output the version number - -i, --ignore ignore specific directory name + -i, --ignore ignore specific directory name, separated by comma or '|' -d, --depth specify the depth of output -f, --only-folder output folder only --icon output emoji icon, prefixing filename or directory - -o, --output export content into a file + -o, --output export content into a file, appending mode by default -h, --help display help for command ``` ## Examples +Ignore `.git` and `node_modules` directory + ```bash -$ treei -i '.git,node_modules' +$ treei -i '.git,node_modules' # or treei -i'git|node_modules' treei ├──.gitignore ├──package-lock.json @@ -41,6 +43,8 @@ treei | └──index.js ``` +Show emoji icon, prefixing filename or directory + ```bash $ treei -i '.git,node_modules' --icon treei @@ -52,6 +56,8 @@ treei | └──📄index.js ``` +Export output into result.md, and append mode by default. + ```bash $ treei -i '.git,node_modules' -o result.md treei @@ -61,6 +67,4 @@ treei ├──README.md └──src | └──index.js - -# The output has been saved into ./result.md ``` diff --git a/src/index.js b/src/index.js index df91e2a..c27d731 100644 --- a/src/index.js +++ b/src/index.js @@ -19,11 +19,11 @@ program .name('treei') .version(package.version) .description('Generate a directory structure tree') - .option('-i, --ignore ', 'ignore specific directory name') + .option('-i, --ignore ', 'ignore specific directory name, separated by comma or \'|\'') .option('-d, --depth ', 'specify the depth of output') .option('-f, --only-folder', 'output folder only') .option('--icon', 'output emoji icon, prefixing filename or directory') - .option('-o, --output ', 'export content into a file') + .option('-o, --output ', 'export content into a file, appending mode by default') .parse(process.argv) const options = program.opts()