Skip to content

Commit a4963f1

Browse files
update(README.md) update README and Chinese translate
update README
1 parent fa6604a commit a4963f1

File tree

2 files changed

+172
-36
lines changed

2 files changed

+172
-36
lines changed

README.md

Lines changed: 87 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,98 @@
1-
# Description
1+
# **gcc_strict-flags**
22

3-
> This is a single file compile script which enables the **STRICTEST compiler flags** for OIers.
3+
> This is a single file compile script which enables the **STRICTEST compiler flags** for competitive programming.
44
5-
# How to use
5+
<div style="text-align:center;">
6+
<a href="README_zh-CN.md"
7+
style="
8+
display: inline-block;
9+
padding: 2px 8px;
10+
font-size: 14px;
11+
color: white;
12+
background-color: #b3243e;
13+
border: none;
14+
border-radius: 4px;
15+
text-decoration: none;
16+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
17+
transition: background-color 0.3s, transform 0.2s;
18+
"
19+
onmouseover="this.style.backgroundColor='#0056b3'; this.style.transform='scale(1.05)';"
20+
onmouseout="this.style.backgroundColor='#007BFF'; this.style.transform='scale(1)';">
21+
简体中文
22+
</a>
23+
</div>
624

7-
```bash
8-
sh make.sh demo/foo.cpp
9-
```
25+
---
1026

11-
The executable program `foo.out` is in the same directory as your source code file.
27+
## **Features**
1228

13-
# News
29+
- Compiles C++ files with strictest flags ever and some assist debugging flags.
30+
- Detects test case files (`*.in`) and automatically redirects output to `*.ans`.
1431

15-
- User-friendly and colorful prompts.
32+
---
1633

17-
- If test case `foo.in` was found, you can pass it as `stdin` to your program. \
18-
Your answer will be output, and be saved as `foo.ans` by default.
34+
## **Usage**
1935

20-
# Tips
36+
1. **Download `make.sh` from release:**
2137

22-
1. You can name your test case `foo.in` and put it in the same directory as `foo.cpp` and enjoy easy input!
38+
> You may clone this repo and try the demos first.
2339
24-
2. Don't want to type choices? \
25-
Just keep it **_empty_** and press `Enter` to use default choice.
40+
2. **Installation**
2641

27-
3. `sh make.sh foo.cpp` is too loooooong? \
28-
Rename `make.sh` as your favourite name `fkccf`, and copy it to `/usr/bin/`. \
29-
Once you restart your terminal, you can enjoy `fkccf foo.cpp` in any directory you want!
42+
```bash
43+
chmod +x ./make.sh
44+
sudo cp ./make.sh /usr/bin/fkccf
45+
```
46+
47+
3. **Run the script with your C++ file:**
48+
49+
```bash
50+
fkccf <your_file.cpp>
51+
```
52+
53+
4. **Key functionalities:**
54+
- **Compilation:** The script compiles the provided C++ file and generates an executable (`*.out`).
55+
- **Automatical test:** If `<filename>.in` exists, you will be prompted to use it as `stdin`. Output is saved as `<filename>.ans`.
56+
57+
---
58+
59+
## **Requirements**
60+
61+
- **g++:** Ensure `g++` is installed with support for C++14 or later.
62+
- **Bash:** The script is written for Bash environments (Linux, macOS, WSL, etc.).
63+
64+
---
65+
66+
## **Example Workflow**
67+
68+
Given a file `example.cpp`:
69+
70+
1. Run the script:
71+
```bash
72+
fkccf example.cpp
73+
```
74+
75+
2. If `example.in` exists, the script prompts:
76+
```text
77+
[Info]: Test case example.in detected.
78+
------> Use this test case as stdin? [Y/n]
79+
```
80+
81+
3. If confirmed, output is saved in `example.ans` and displayed in the terminal.
82+
83+
---
84+
85+
## **License**
86+
87+
This repo is licensed under the [GPLv3 License](./LICENCE).
88+
89+
90+
# Star History
91+
92+
<a href="https://star-history.com/#estrella-explore/gcc_strict-flags&Date">
93+
<picture>
94+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=estrella-explore/gcc_strict-flags&type=Date&theme=dark" />
95+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=estrella-explore/gcc_strict-flags&type=Date" />
96+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=estrella-explore/gcc_strict-flags&type=Date" />
97+
</picture>
98+
</a>

README_zh-CN.md

Lines changed: 85 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,96 @@
1-
# 描述
1+
# **gcc_strict-flags**
22

3-
> 这是为 OIer 启用**最严格的**编译选项的单文件编译脚本
3+
> 这是一个适用于竞争性编程的启用 **最严格的编译器标志** 单文件编译脚本
44
5-
# 使用方法
5+
<div style="text-align:center;">
6+
<a href="README.md"
7+
style="
8+
display: inline-block;
9+
padding: 2px 8px;
10+
font-size: 14px;
11+
color: white;
12+
background-color: #1d6ea3;
13+
border: none;
14+
border-radius: 4px;
15+
text-decoration: none;
16+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
17+
transition: background-color 0.3s, transform 0.2s;
18+
"
19+
onmouseover="this.style.backgroundColor='#0056b3'; this.style.transform='scale(1.05)';"
20+
onmouseout="this.style.backgroundColor='#007BFF'; this.style.transform='scale(1)';">
21+
English
22+
</a>
23+
</div>
624

7-
```bash
8-
sh ./make.sh ./demo/foo.cpp
9-
```
25+
---
1026

11-
可执行文件 `foo.out` 与你的源代码文件在同一目录下。
27+
## **功能特点**
1228

13-
# 新功能
29+
- 使用最严格的编译器标志编译 C++ 文件,并附加一些辅助调试标志。
30+
- 自动检测测试样例文件(`*.in`),并将输出重定向到 `*.ans`
1431

15-
- 用户友好的状态提示
32+
---
1633

17-
- 如果测试用例 `foo.in` 存在,你可以把它作为默认输入流传输给你的程序。\
18-
你的答案会被输出,并且被默认地保存为 `foo.ans`
34+
## **使用方法**
1935

20-
# 提示
36+
1. **从发布页面下载 `make.sh` 文件:**
37+
> 您可以先把该仓库 clone 到本地,并尝试 `./demo` 文件夹下的各种示例文件。
2138
22-
1. 你可以把你的测试用例命名为 `foo.in`,并把它放在与 `foo.cpp` 相同的目录下,以便便捷输入!
39+
2. **安装方法**
2340

24-
2. 不想键入选项? \
25-
只需要留空并按下回车键来使用默认选项。
41+
```bash
42+
chmod +x ./make.sh
43+
sudo cp ./make.sh /usr/bin/fkccf
44+
```
2645

27-
3. `sh make.sh foo.cpp` 太长了? \
28-
`make.sh` 重命名为你最喜欢的名字 `fkccf.sh`,并把它复制到 `/usr/bin`\
29-
只要重启终端,你就可以在任何目录下使用 `fkccf foo.cpp`
46+
3. **使用 C++ 文件运行脚本:**
47+
48+
```bash
49+
fkccf <your_file.cpp>
50+
```
51+
52+
4. **功能:**
53+
- **编译:** 脚本将编译提供的 C++ 文件并生成可执行文件(`*.out`)。
54+
- **自动化测试:** 如果存在 `<filename>.in` 文件,脚本会提示是否将其作为 `stdin` 使用,输出将保存为 `<filename>.ans`
55+
56+
---
57+
58+
## **运行环境要求**
59+
60+
- **g++:** 确保已安装支持 C++14 或更高版本的 `g++`(推荐使用 `g++` 的最新版本,目前为 `g++ 14.2.1`)。
61+
- **Bash:** 该脚本适用于 Bash 环境(MinGW、WSL、Linux、macOS 等)。
62+
63+
---
64+
65+
## **示例用法**
66+
67+
假设有一个文件 `example.cpp`
68+
69+
1. 运行脚本:
70+
```bash
71+
fkccf example.cpp
72+
```
73+
74+
2. 如果存在 `example.in` 文件,脚本会提示:
75+
```text
76+
[Info]: Test case example.in detected.
77+
------> Use this test case as stdin? [Y/n]
78+
```
79+
80+
3. 如果输入 `y` 或者直接按下 `Enter`,程序会把 `example.in` 作为输入文件,而输出将保存到 `example.ans` 并显示在终端中。
81+
82+
---
83+
84+
## **许可证**
85+
86+
该项目基于 [GPLv3 许可证](./LICENCE) 进行授权。
87+
88+
# Star History
89+
90+
<a href="https://star-history.com/#estrella-explore/gcc_strict-flags&Date">
91+
<picture>
92+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=estrella-explore/gcc_strict-flags&type=Date&theme=dark" />
93+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=estrella-explore/gcc_strict-flags&type=Date" />
94+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=estrella-explore/gcc_strict-flags&type=Date" />
95+
</picture>
96+
</a>

0 commit comments

Comments
 (0)