start:开始。
This commit is contained in:
parent
8c4a676dc5
commit
6341b1984f
38
.clang-format
Normal file
38
.clang-format
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# .clang-format
|
||||||
|
|
||||||
|
# 风格格式化
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
# 4 空格缩进
|
||||||
|
IndentWidth: 4
|
||||||
|
# 连续对齐变量的声明
|
||||||
|
AlignConsecutiveDeclarations: true
|
||||||
|
# 指针左侧对齐
|
||||||
|
PointerAlignment: Left
|
||||||
|
# 访问说明符(public、private等)的偏移
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
# 大括号
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
# 函数定义后面大括号在新行
|
||||||
|
AfterFunction: true
|
||||||
|
# class定义后面
|
||||||
|
AfterClass: true
|
||||||
|
|
||||||
|
# 去除C++11的列表初始化的大括号{后和}前的空格
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
# 允许重新排版注释
|
||||||
|
ReflowComments: true
|
||||||
|
# 允许排序#include
|
||||||
|
SortIncludes: true
|
||||||
|
# 在尾随的评论前添加的空格数(只适用于//)
|
||||||
|
SpacesBeforeTrailingComments: 3
|
||||||
|
# tab宽度
|
||||||
|
TabWidth: 4
|
||||||
|
# 构造函数的初始化列表要么都在同一行,要么都各自一行
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
# 每行字符的限制,0表示没有限制
|
||||||
|
ColumnLimit: 150
|
||||||
|
# 允许短的块放在同一行
|
||||||
|
AllowShortBlocksOnASingleLine: false
|
||||||
|
# 是否允许短函数在一行
|
||||||
|
AllowShortFunctionsOnASingleLine: InlineOnly
|
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
build
|
||||||
|
.cache
|
||||||
|
.vs
|
||||||
|
vs*
|
34
.vscode/settings.json
vendored
Normal file
34
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"files.autoSave": "onFocusChange",
|
||||||
|
"editor.fontSize": 15,
|
||||||
|
"editor.fontFamily": "'Mononoki Nerd Font Mono', 'Mononoki Nerd Font Mono', 'Mononoki Nerd Font Mono'",
|
||||||
|
"cmake.configureOnOpen": true,
|
||||||
|
"cmake.debugConfig": {
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "-gdb-set charset utf-8",
|
||||||
|
"text": "-gdb-set charset UTF-8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enable gdb pretty-printing",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"cmake.options.statusBarVisibility": "visible",
|
||||||
|
"cmake.generator": "Ninja",
|
||||||
|
"C_Cpp.default.compileCommands": "${workspaceRoot}/build/compile_commands.json",
|
||||||
|
"C_Cpp.default.cppStandard": "c++17",
|
||||||
|
"editor.inlayHints.enabled": "off",
|
||||||
|
"editor.unicodeHighlight.allowedLocales": {
|
||||||
|
"ja": true,
|
||||||
|
"zh-hant": true,
|
||||||
|
"zh-hans": true
|
||||||
|
},
|
||||||
|
"files.associations": {
|
||||||
|
"fstream": "cpp",
|
||||||
|
"filesystem": "cpp"
|
||||||
|
}
|
||||||
|
}
|
10998
3rd/CLI11.hpp
Normal file
10998
3rd/CLI11.hpp
Normal file
File diff suppressed because it is too large
Load Diff
29
CMakeLists.txt
Normal file
29
CMakeLists.txt
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
project(codecreate LANGUAGES CXX)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
add_compile_options(/source-charset:utf-8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
MESSAGE(STATUS "Add MinGW Param.")
|
||||||
|
add_compile_options(-finput-charset=utf-8)
|
||||||
|
add_compile_options(-fexec-charset=gbk)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
|
||||||
|
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")
|
||||||
|
|
||||||
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|
||||||
|
include_directories(3rd)
|
||||||
|
|
||||||
|
set(PROJECT_SOURCES
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(codecreate ${PROJECT_SOURCES})
|
36
README.en.md
36
README.en.md
@ -1,36 +0,0 @@
|
|||||||
# codecreate
|
|
||||||
|
|
||||||
#### Description
|
|
||||||
创建code工程。
|
|
||||||
|
|
||||||
#### Software Architecture
|
|
||||||
Software architecture description
|
|
||||||
|
|
||||||
#### Installation
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### Instructions
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### Contribution
|
|
||||||
|
|
||||||
1. Fork the repository
|
|
||||||
2. Create Feat_xxx branch
|
|
||||||
3. Commit your code
|
|
||||||
4. Create Pull Request
|
|
||||||
|
|
||||||
|
|
||||||
#### Gitee Feature
|
|
||||||
|
|
||||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
|
||||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
|
||||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
|
||||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
|
||||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
|
||||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
35
README.md
35
README.md
@ -1,37 +1,4 @@
|
|||||||
# codecreate
|
# codecreate
|
||||||
|
|
||||||
#### 介绍
|
#### 介绍
|
||||||
创建code工程。
|
创建code工程。
|
||||||
|
|
||||||
#### 软件架构
|
|
||||||
软件架构说明
|
|
||||||
|
|
||||||
|
|
||||||
#### 安装教程
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 使用说明
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 参与贡献
|
|
||||||
|
|
||||||
1. Fork 本仓库
|
|
||||||
2. 新建 Feat_xxx 分支
|
|
||||||
3. 提交代码
|
|
||||||
4. 新建 Pull Request
|
|
||||||
|
|
||||||
|
|
||||||
#### 特技
|
|
||||||
|
|
||||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
|
||||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
|
||||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
|
||||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
|
||||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
|
||||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
40
main.cpp
Normal file
40
main.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#include <CLI11.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
|
#define CODECREATE_VERSION "1.0.0"
|
||||||
|
|
||||||
|
struct MParam {
|
||||||
|
std::string des_path{};
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
bool parse_cmd(int argc, char** argv, MParam& param)
|
||||||
|
{
|
||||||
|
std::string intro("");
|
||||||
|
intro.append(CODECREATE_VERSION);
|
||||||
|
CLI::App app(intro);
|
||||||
|
|
||||||
|
app.add_option("-p,--path", param.des_path, "创建工程的位置");
|
||||||
|
|
||||||
|
try {
|
||||||
|
CLI11_PARSE(app, argc, argv);
|
||||||
|
return true;
|
||||||
|
} catch (const CLI::ParseError& e) {
|
||||||
|
std::cerr << "Error parsing command line: " << e.what() << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
|
||||||
|
MParam param;
|
||||||
|
if (!parse_cmd(argc, argv, param)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user