aboutsummaryrefslogtreecommitdiff
path: root/toys/example
diff options
context:
space:
mode:
Diffstat (limited to 'toys/example')
-rw-r--r--toys/example/skeleton.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toys/example/skeleton.c b/toys/example/skeleton.c
index b8dd102a..1796ba1b 100644
--- a/toys/example/skeleton.c
+++ b/toys/example/skeleton.c
@@ -72,9 +72,9 @@ void skeleton_main(void)
// Command line options parsing is done for you by lib/args.c called
// from main.c using the optstring in the NEWTOY macros. Display results.
if (toys.optflags) printf("flags=%llx\n", toys.optflags);
- if (toys.optflags & FLAG_a) printf("Saw a\n");
- if (toys.optflags & FLAG_b) printf("b=%s\n", TT.s.b);
- if (toys.optflags & FLAG_c) printf("c=%ld\n", TT.s.c);
+ if (FLAG(a)) printf("Saw a\n");
+ if (FLAG(b)) printf("b=%s\n", TT.s.b);
+ if (FLAG(c)) printf("c=%ld\n", TT.s.c);
while (TT.s.d) {
printf("d=%s\n", TT.s.d->arg);
TT.s.d = TT.s.d->next;
@@ -82,7 +82,7 @@ void skeleton_main(void)
if (TT.s.e) printf("e was seen %ld times\n", TT.s.e);
for (optargs = toys.optargs; *optargs; optargs++)
printf("optarg=%s\n", *optargs);
- if (toys.optflags & FLAG_walrus) printf("Saw --walrus\n");
+ if (FLAG(walrus)) printf("Saw --walrus\n");
if (TT.s.blubber) printf("--blubber=%s\n", TT.s.blubber);
printf("Other globals should start zeroed: %d\n", TT.more_globals);
@@ -100,5 +100,5 @@ void skeleton_alias_main(void)
// Note, this FLAG_b is a different bit position than the other FLAG_b,
// and fills out a different variable of a different type.
- if (toys.optflags & FLAG_b) printf("b=%ld", TT.a.b);
+ if (FLAG(b)) printf("b=%ld", TT.a.b);
}