Watch
1
0
Fork
You've already forked cli-flag-collection
0
mirror of synced 2026-11-04 21:17:18 +00:00

Compare commits

..
5 changed files with 29 additions and 45 deletions

6
.gitignore vendored
View file

@ -1,3 +1,3 @@
cfc-cli-dynamic
cfc-cli-release
cfc-cli-static
cfc-cli-out
cfc-cli-release-out
cfc-cli-static-out

View file

@ -1,8 +0,0 @@
CC=g++
SRC=cli-flag-collection.cpp
dynamic-dev:
${CC} ${SRC} -Wall -march=native -std=c++23 -o cfc-cli-dynamic
static:
${CC} ${SRC} -Wall -Werror -march=native -O3 -flto -fomit-frame-pointer -static -std=c++23 -o cfc-cli-static
release:
${CC} ${SRC} -Wall -Werror -march=native -O3 -flto -fomit-frame-pointer -std=c++23 -o cfc-cli-release

View file

@ -4,65 +4,45 @@ A small flag printing program written in C++23!
---
## Installation:
For now my program is not in any repo so you have to build it from source.
For now my program is not in any repo so you have to download the binary directly or build it from source.
- Release + Static (Best performance and portability):
`cfc-cli-static`
`cfc-cli-static-out`
- Release (same as above just not static):
`cfc-cli-release`
`cfc-cli-release-out`
- Dev / Dynamic:
`cfc-cli-dynamic`
`cfc-cli-out`
### Building from source:
#### Dependencies:
- git
- gcc
- make
- C++23
- bash (for the compile script)
Firstly you pull this repo with:
```
git clone https://codeberg.org/MysteryBirb/cli-flag-collection.git
```
`git clone https://codeberg.org/MysteryBirb/cli-flag-collection.git`
then cd into it:
```
cd cli-flag-collection
```
`cd cli-flag-collection`
To compile the dynamic version without any optimizations you just run `make`.
For the release and release static build you can run:
then run `compile-cfc.sh` for the static realse version:
```
make static
```
`./compile-cfc static`
or
or for the non static release build
```
make release
```
`./compile-cfc.sh release`
or for the dynamic / dev version:
`./compile-cfc.sh`
---
## Usage:
```
Usage: ./cfc-cli [OPTION] [ARGUMENT] -f [FLAG]
All options:
-f, --flag [FLAG] Prints the chosen flag
-h, --height [Integer] Prints the flag with the chosen positive integer
-c, --character '[Char]' Print the chosen flag with the given character (Only supports ASCII for now)
--list List all available flags
--help Prints out the help screen
```
---
## License
All of my code is distributed under the terms of the GPLv3 License.

View file

@ -142,7 +142,7 @@ int main(int argc, char **argv) {
case HELP:
std::cout << "Usage: " << argv[0] << " [OPTION] [ARGUMENT] -f [FLAG]\n"
<< "All options:\n"
<< "\t-f, --flag [FLAG]\t\tPrints the chosen flag\n"
<< "\t-f, --flag [Flag]\t\tPrints the chosen flag\n"
<< "\t-h, --height [Integer]\t\tPrints the flag with the chosen positive integer\n"
<< "\t-c, --character \'[Char]\'\tPrint the chosen flag with the given character (Only supports ASCII for now)\n"
<< "\t--list\t\t\tList all available flags\n"

12
compile-cfc.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
if [ "${1,,}" == "static" ]; then
echo "Release + Static"
time g++ -Wall -Werror -O3 -flto -fomit-frame-pointer -static -std=c++23 cli-flag-collection.cpp -o cfc-cli-static-out
elif [ "${1,,}" == "release" ]; then
echo "Release"
time g++ -Wall -Werror -O3 -flto -fomit-frame-pointer -std=c++23 cli-flag-collection.cpp -o cfc-cli-release-out
else
echo "Dynamic-dev"
time g++ -Wall -std=c++23 cli-flag-collection.cpp -o cfc-cli-out
fi