diff --git a/Makefile b/Makefile index 77bf9be..81175b8 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ OBJS =\ base64\ hash/sha256\ -TOOLS =\ +TOOLS = ${LIB} TESTS =\ test-hex\ @@ -91,7 +91,7 @@ ${OBJDIR}/%${-g}-cov.o: ${SRCDIR}/%.cpp ${INCDIR}/${LIB}/%.hpp ${CC} -o $@ -c $< -I${INCDIR} ${-l} ${CFLAGS} --coverage ${BINDIR}/%${-g}-cov: ${TESTDIR}/%.cpp ${patsubst %, ${OBJDIR}/%${-g}-cov.o, ${OBJS}} - ${CC} -o $@ $^ -I${INCDIR} ${-l} -lgtest ${CFLAGS} --coverage + ${CC} -o $@ $^ -I${INCDIR} ${-l} -lgtest -lgcov ${CFLAGS} clean: rm -rf ${DIRS} diff --git a/src/basen.cpp b/src/basen.cpp new file mode 100644 index 0000000..08ace15 --- /dev/null +++ b/src/basen.cpp @@ -0,0 +1,29 @@ +#include + +#include + +#include + +int main(int argc, char *argv[]) +{ + argparse::ArgumentParser program("basen", "1.1.0"); + program.add_argument("-t", "--type") + .help("encoding type") + .metavar("STRING") + .choices("base58", "base64", "hex") + .default_value("hex"); + program.add_argument("-d", "--decode") + .help("is decode") + .flag(); + try + { + program.parse_args(argc, argv); + } + catch (const std::exception &err) + { + std::cerr << err.what() << '\n'; + std::cerr << program; + return 1; + } + return 0; +} \ No newline at end of file