@globefish/utils
v0.0.7
Published
Collection of utilities
Downloads
4
Readme
Table of Contents
utils
Collection of utilities
cli
traverseDir
Traverse an directory to get a file/directory list or apply a shell command to each file/directory.
Usage
@globefish/utils 0.0.2
Usage: traverseDir [--cmd, -c] [CMD] [--mode, -m] [MODE]
[--depth, -d] [DEPTH] [DIR1] [DIR2] ... [DIRn]
positional arguments:
DIRn The base directories. If none is present, use current directory.
optional parameters:
-h, --help Show this help message and exit.
-v, --version Show the program version
-c, --cmd CMD CMD is the shell command that is used to applied to the file/directory list.
Use "%%DIR%%" as a variable macro for each file/directory.
If CMD is absent, the prog will only list the files/directories.
-m, --mode MODE MODE is the filter of target file/directory list.
Valid values: "file", "dir"(default) and "all".
-d, --depth DEPTH Traversal depth (default: 1).
-t, --top Indicate whether to include top directory (default: false).