Watch
1
0
Fork
You've already forked cli-flag-collection
0
mirror of synced 2026-11-03 19:07:18 +00:00

Switched to make; Reworded README

This commit is contained in:
MysteryBirb 2026-09-11 12:13:29 +02:00
commit 9c08f3b2d9
5 changed files with 37 additions and 29 deletions

6
.gitignore vendored
View file

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

8
Makefile Normal file
View file

@ -0,0 +1,8 @@
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,45 +4,57 @@ A small flag printing program written in C++23!
---
## Installation:
For now my program is not in any repo so you have to download the binary directly or build it from source.
For now my program is not in any repo so you have to build it from source.
- Release + Static (Best performance and portability):
`cfc-cli-static-out`
`cfc-cli-static`
- Release (same as above just not static):
`cfc-cli-release-out`
`cfc-cli-release`
- Dev / Dynamic:
`cfc-cli-out`
`cfc-cli-dynamic`
### 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```
then run `compile-cfc.sh` for the static realse version:
To compile the dynamic version without any optimizations you just run `make`.
For the release and release static build you can run:
`./compile-cfc static`
```make static```
or for the non static release build
or
`./compile-cfc.sh release`
or for the dynamic / dev version:
`./compile-cfc.sh`
```make release```
---
## 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"

View file

@ -1,12 +0,0 @@
#!/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