summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2018-06-03 12:33:36 +0100
committerFreeArtMan <dos21h@gmail.com>2018-06-03 12:33:36 +0100
commitbdf536e69839edd86fbd3a4be31a5f1c0debe82e (patch)
tree61dc81bad31792e464ea0f880b115dfc8035f927 /test
parent587dd24b5970aa3605cc2bc2826f7e35344b4317 (diff)
downloadlibarg++-bdf536e69839edd86fbd3a4be31a5f1c0debe82e.tar.gz
libarg++-bdf536e69839edd86fbd3a4be31a5f1c0debe82e.zip
Flag type works
Diffstat (limited to 'test')
-rw-r--r--test/test1.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/test1.c b/test/test1.c
index d87443f..b340db1 100644
--- a/test/test1.c
+++ b/test/test1.c
@@ -102,7 +102,7 @@ void* operator new[](long unsigned int len) __attribute__((alias("emulate_cc_new
void operator delete(void* p, unsigned long len) __attribute__((alias("emulate_cc_delete")));
void operator delete[](void* p, unsigned long len) __attribute__((alias("emulate_cc_delete")));
void* __cxa_pure_virtual = 0;
-__gxx_personality_v0
+void *__gxx_personality_v0=0;
#include "../arg.h"
@@ -157,15 +157,25 @@ exit_error:
CmdArgFlag *enable = new CmdArgFlag();
CmdArgFlagConf enableConf = CmdArgFlagConf();
- //CmdArgDefault enableDefault = CmdArgDefault((char *)"-a", &enableConf, (char *)"enable A", &enable);
+ CmdArgDefault enableDefault = CmdArgDefault((char *)"-a", &enableConf, (char *)"enable A", enable);
- CmdArgFlag enableText = CmdArgFlag();
+ CmdArgFlag *enableText = new CmdArgFlag();
CmdArgFlagConf enableTextConf = CmdArgFlagConf();
- CmdArgDefault enableTextDefault = CmdArgDefault((char *)"-t", &enableTextConf, (char *)"enable text", &enableText);
+ CmdArgDefault enableTextDefault = CmdArgDefault((char *)"-t", &enableTextConf, (char *)"enable text", enableText);
CmdArg arguments = CmdArg();
+ arguments.add(&enableTextDefault);
+ arguments.add(&enableDefault);
- //enableConf();
+ arguments.load(argc, argv);
+
+ if (enable->getValue()) {
+ printf("enable is set\n");
+ }
+
+ if (enableText->getValue()) {
+ printf("enable text is set\n");
+ }
}