diff --git a/.gitignore b/.gitignore index ab45203..ef918e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -cfc-cli-dynamic -cfc-cli-release -cfc-cli-static +cfc-cli-out +cfc-cli-release-out +cfc-cli-static-out diff --git a/Makefile b/Makefile deleted file mode 100644 index 43e516a..0000000 --- a/Makefile +++ /dev/null @@ -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 diff --git a/README.md b/README.md index 0e2d90d..5990e8d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/cli-flag-collection.cpp b/cli-flag-collection.cpp index 130c7c0..3f0df61 100644 --- a/cli-flag-collection.cpp +++ b/cli-flag-collection.cpp @@ -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" diff --git a/compile-cfc.sh b/compile-cfc.sh new file mode 100755 index 0000000..225a5f7 --- /dev/null +++ b/compile-cfc.sh @@ -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