-
-e:--execute的简写,用于实际执行删除操作。-o:--organize的简写,用于指定整理文件的目标目录。-r:--remove-empty-dirs的简写,用于删除空文件夹。-v:--version的简写,用于显示版本信息。
- 使用
argparse.RawTextHelpFormatter格式化帮助信息,使其更易读。 - 添加了详细的示例说明,方便用户快速上手。
python dedup.py -hpython dedup.py /path/to/directory -o /path/to/target -rpython dedup.py /path/to/directory -o /path/to/target -r -epython dedup.py /path/to/directory -r -epython dedup.py -v
运行
python dedup.py -h将显示以下内容:usage: dedup.py [-h] [-e] [-o TARGET_DIR] [-r] [-v] directory 渗透测试字典文件去重整理工具 positional arguments: directory 要处理的根目录 optional arguments: -h, --help show this help message and exit -e, --execute 实际执行删除操作(默认模拟运行) -o TARGET_DIR, --organize TARGET_DIR 整理文件到指定目录(按扩展名分类) -r, --remove-empty-dirs 删除空文件夹 -v, --version 显示版本信息 示例: 1. 模拟运行(仅显示操作日志): python dedup.py /path/to/directory -o /path/to/target -r 2. 实际执行(删除重复文件并整理): python dedup.py /path/to/directory -o /path/to/target -r -e 3. 删除空文件夹: python dedup.py /path/to/directory -r -e
- 添加了简写模式,提升命令行操作的便捷性。
- 完善了帮助信息,包括参数说明和使用示例。
- 保持了脚本的模块化设计,便于后续扩展和 GUI 开发。
-
Notifications
You must be signed in to change notification settings - Fork 0
Yn8rt/dedup_file
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
文件去重整理工具v1.0
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published