A tool to merge source code files for software copyright application
Project description
代码合并工具
简介
该工具用于合并源代码文件,主要用于软件著作权申请。它支持多种编程语言,包括 JavaScript、Python、PHP 等,并且可以根据指定的文件扩展名进行过滤。
使用说明
命令行参数
-d或--directory: 工作目录(默认为当前目录)-s或--start-file: 指定开始文件名(会在目录树中递归搜索)-p或--pages: 指定要提取的页面数(默认为 60)-i或--include: 指定要包含的文件扩展名(逗号分隔)-e或--exclude: 指定要排除的文件扩展名(逗号分隔)-o或--output: 指定输出文件名(默认为out.txt)
默认行为
- 如果不指定开始文件名,工具会在目录树中递归搜索以下文件名:
login.vue、app.py、index.js、index.php、index.html - 如果不指定要包含的文件扩展名,工具会包含所有文件
- 如果不指定要排除的文件扩展名,工具会排除以下文件扩展名:
.lock、.out、.yaml、.txt、.md、.csv、.gitignore、.sh、.bat、.xml、.yml、.json、.png、.jpg、.jpeg、.gif、.bmp、.ico、.db、.sqlite、.bin、.exe、.dll、.so、.dylib
工作流程
- 根据指定的目录和开始文件名,工具会在目录树中递归搜索开始文件
- 根据指定的文件扩展名,工具会过滤出要包含的文件
- 工具会合并过滤出的文件,并根据指定的页面数进行截取
- 工具会将合并后的代码保存到指定的输出文件中
注意事项
- 请确保指定的目录和开始文件名正确
- 请确保指定的文件扩展名正确
- 请确保指定的页面数合理
- 请确保输出文件名正确
安装方法
用pip 安装
python -m pip install merge_code
源码安装
git clone https://github.com/songyi1999/merge_code.git
cd merge_code
python -m pip install -e .
使用示例
merge_code -d /path/to/directory
或
cd /path/to/directory
merge_code
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
merge_code-0.1.1.tar.gz
(5.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file merge_code-0.1.1.tar.gz.
File metadata
- Download URL: merge_code-0.1.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e65f3839cc36d2f66a47ae14fe485650a43c63e51d037d8937cfa9266607d05
|
|
| MD5 |
e3bd81d95989ed3e99357b9bf51970ff
|
|
| BLAKE2b-256 |
04e63cf63bc26c75b848e92830cbbdea5574f229ccc0699d2f2356eea981d768
|
File details
Details for the file merge_code-0.1.1-py3-none-any.whl.
File metadata
- Download URL: merge_code-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
326b9ca253413c2880741f7115cdc7d200d747bb36b63b8ab8717d735e370a77
|
|
| MD5 |
3ffef9ecadf3b5ebc5b288804a996c4f
|
|
| BLAKE2b-256 |
7b454398654f4303609dcc120bf4917099c3349a78e45d7a1c33c2554e3a63ba
|