|
1 | | -# Description |
| 1 | +# **gcc_strict-flags** |
2 | 2 |
|
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. |
4 | 4 |
|
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> |
6 | 24 |
|
7 | | -```bash |
8 | | -sh make.sh demo/foo.cpp |
9 | | -``` |
| 25 | +--- |
10 | 26 |
|
11 | | -The executable program `foo.out` is in the same directory as your source code file. |
| 27 | +## **Features** |
12 | 28 |
|
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`. |
14 | 31 |
|
15 | | -- User-friendly and colorful prompts. |
| 32 | +--- |
16 | 33 |
|
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** |
19 | 35 |
|
20 | | -# Tips |
| 36 | +1. **Download `make.sh` from release:** |
21 | 37 |
|
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. |
23 | 39 |
|
24 | | -2. Don't want to type choices? \ |
25 | | - Just keep it **_empty_** and press `Enter` to use default choice. |
| 40 | +2. **Installation** |
26 | 41 |
|
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> |
0 commit comments