diff --git a/scripts/build.sh b/scripts/build.sh index 720f544..b606780 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -72,7 +72,7 @@ echo "Building tools..." mkdir -pv bin/tools # add compile commands to this array COMPILE_COMMANDS=( - "$CXX_WITH_FLAGS src/tools/dumpnbt.cpp -Lbin/lib -l:nbt.so -o bin/tools/dumpnbt", + "$CXX_WITH_FLAGS src/tools/dumpnbt.cpp -Lbin/lib -l:nbt.so -o bin/tools/dumpnbt" "$CXX_WITH_FLAGS src/tools/hexnet.cpp -Ldependencies/sockpp-0.7.1/build -l:libsockpp.so -Idependencies/sockpp-0.7.1/include -o bin/tools/hexnet" ) for command in ${!COMPILE_COMMANDS[@]}; do diff --git a/src/lib/cli.cpp b/src/lib/cli.cpp index 238b512..c3b001c 100644 --- a/src/lib/cli.cpp +++ b/src/lib/cli.cpp @@ -46,7 +46,7 @@ namespace CLI { PositionalArgument::PositionalArgument() { this->present = false; } - PositionalArgument::PositionalArgument(std::string description, std::string placeholder) { + PositionalArgument::PositionalArgument(std::string placeholder, std::string description) { this->description = description; this->placeholder = placeholder; this->present = false; diff --git a/src/lib/cli.h++ b/src/lib/cli.h++ index 01e44ec..7dc5ff1 100644 --- a/src/lib/cli.h++ +++ b/src/lib/cli.h++ @@ -58,32 +58,34 @@ namespace CLI { std::string value; PositionalArgument(); - PositionalArgument(std::string description, std::string placeholder); + PositionalArgument(std::string placeholder, std::string description); }; class ArgumentsParser { - bool wrongUsage; - std::vector wrongUsageMessages; + private: + std::string programName; + std::map flagsByShortName; + std::map flagsByLongName; + std::map argumentsByShortName; + std::map argumentsByLongName; + std::vector positionalArguments; - std::string programName; - std::map flagsByShortName; - std::map flagsByLongName; - std::map argumentsByShortName; - std::map argumentsByLongName; - std::vector positionalArguments; + public: + bool wrongUsage; + std::vector wrongUsageMessages; - // using int here bc that's how main() is defined - ArgumentsParser(int argc, char* argv[], std::vector flags, std::vector unpositionalArguments, std::vector positionalArguments); - ~ArgumentsParser(); + // using int here bc that's how main() is defined + ArgumentsParser(int argc, char* argv[], std::vector flags, std::vector unpositionalArguments, std::vector positionalArguments); + ~ArgumentsParser(); - ErrorOr getProgramName(); - ErrorOr getFlag(int argc, char* argv[], char shortName); - ErrorOr getFlag(int argc, char* argv[], std::string longName); - ErrorOr getPositionalArgument(int argc, char* argv[], std::vector::size_type position); - ErrorOr getUnpositionalArgument(int argc, char* argv[], char shortName); - ErrorOr getUnpositionalArgument(int argc, char* argv[], std::string longName); + ErrorOr getProgramName(); + ErrorOr getFlag(int argc, char* argv[], char shortName); + ErrorOr getFlag(int argc, char* argv[], std::string longName); + ErrorOr getPositionalArgument(int argc, char* argv[], std::vector::size_type position); + ErrorOr getUnpositionalArgument(int argc, char* argv[], char shortName); + ErrorOr getUnpositionalArgument(int argc, char* argv[], std::string longName); - std::string getUsage(); + std::string getUsage(); }; } diff --git a/src/test/nbt_helpers.cpp b/src/test/nbt_helpers.cpp index d77f8b1..b9733af 100644 --- a/src/test/nbt_helpers.cpp +++ b/src/test/nbt_helpers.cpp @@ -23,6 +23,9 @@ #include "../lib/error.h++" int main(){ + std::cout << "################################################################################" << std::endl; + std::cout << "NBT helper tests" << std::endl; + std::cout << "################################################################################" << std::endl; // used for all integer tests uint8_t dataForIntTest[] = {30, 31, 32, 33, 34, 35, 36, 37, 38, 39};