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