Compare commits
1 Commits
v1.1.0
...
085f182357
| Author | SHA1 | Date | |
|---|---|---|---|
| 085f182357 |
4
Makefile
4
Makefile
@ -15,7 +15,7 @@ OBJS =\
|
|||||||
base64\
|
base64\
|
||||||
hash/sha256\
|
hash/sha256\
|
||||||
|
|
||||||
TOOLS =\
|
TOOLS = ${LIB}
|
||||||
|
|
||||||
TESTS =\
|
TESTS =\
|
||||||
test-hex\
|
test-hex\
|
||||||
@ -91,7 +91,7 @@ ${OBJDIR}/%${-g}-cov.o: ${SRCDIR}/%.cpp ${INCDIR}/${LIB}/%.hpp
|
|||||||
${CC} -o $@ -c $< -I${INCDIR} ${-l} ${CFLAGS} --coverage
|
${CC} -o $@ -c $< -I${INCDIR} ${-l} ${CFLAGS} --coverage
|
||||||
|
|
||||||
${BINDIR}/%${-g}-cov: ${TESTDIR}/%.cpp ${patsubst %, ${OBJDIR}/%${-g}-cov.o, ${OBJS}}
|
${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:
|
clean:
|
||||||
rm -rf ${DIRS}
|
rm -rf ${DIRS}
|
||||||
|
|||||||
29
src/basen.cpp
Normal file
29
src/basen.cpp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <argparse/argparse.hpp>
|
||||||
|
|
||||||
|
#include <basen.hpp>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user