一个简单的命令行实用程序,将目录中的文件组织到子目录中。
cleanup的Python项目详细描述
清理
一个简单的命令行实用程序,根据文件的扩展名将目录中的文件组织到子目录中。
用法
在没有任何选项的情况下运行时,它会根据文件的扩展名将指定目录中的文件组织到子目录中。
选项
-d
,--dry-run
只显示将要进行的更改,而不实际执行任何操作。
cleanup -d path/to/dir # dry run the cleanup cleanup -dr path/to/dir # dry run the reverting a cleanup
-s
,--silent
防止在执行操作时显示任何信息。但是,无论是否启用此选项,都会显示错误。
cleanup -s path/to/dir # silently cleanup cleanup -sr path/to/dir # silently revert a cleanup
-r
,--revert
还原目录的清理。请注意,要使其正常工作,指定的目录应该在之前已被清除。
cleanup -r path/to/dir # revert the cleanup of a directory
-h
,--help
显示帮助文本。
cleanup -h
开发
设置
克隆repo并
cd
到其中。使用pipenv:
pipenv --three # create Python 3 virtual environment pipenv install --dev # install all dependencies pipenv shell # activate virtual environment shell
清理脚本现在可以从项目的根目录运行:
python3 -m cleanup.cleanup -h
测试
确保您位于项目的根目录中。然后您可以使用:
python3 -m tests.test
许可证
这个项目是根据MIT license的条款授权的。