#directory #directory-structure #copy #cp #command-line-tool

app cpdir

在两个位置之间复制目录结构的命令行工具

1 个不稳定版本

0.1.0 2023年4月7日

#cp 中的第 14

MIT 许可证

11KB
154

cpdir

在两个位置之间复制目录结构的实用工具。

信息

这将只复制目录,不会移动或创建文件。

阻止单个目录移动的错误仅意味着该单个目录将不会移动。默认情况下,这也意味着运行此应用程序的退出代码(除了嵌套实例)始终为零。如果您希望应用程序报告非零退出代码,请使用 -E 标志。

用法

Command-line utility for copying directory structure between two locations.

Usage: cpdir [OPTIONS] <SOURCE> <DEST>

Arguments:
  <SOURCE>  The directory to walk to determine the structure to be copied to the
            destination
  <DEST>    The directory to copy walked paths into

Options:
  -d, --depth <DEPTH>      Controls the recursion depth of the directory walking
                           process. The allowed range is 0-255. Setting this to
                           0 will effectively not walk the source directory
                           [default: 255]
  -x, --execute            Controls whether folders should actually be created
                           at the destination. This defaults to false, so this
                           program will run in a "dry-run" mode unless this
                           argument is specified
      --allow-nesting      Whether or not the destination directory is allowed
                           to be a subdirectory of the source. This can have
                           undesired behaviour, as directories within the
                           subdirectory then get copied deeper into the same
                           subdirectory
  -E, --exit-code-failure  Whether or not a non-zero exit code should be used in
                           the case that any directory is not able to be moved
  -h, --help               Print help
  -V, --version            Print version

依赖关系

~3–12MB
~143K SLoC