#include "cll1.h"
-//try$ make arguments2
-//try$ ./arguments2 -f xxx yyyy -?
+//try to run: ./arguments2 -f reload yyyy -?
program
{
- char *ptr;
-
- arguments
+ if_args then
{
- argument("-?") printf("This is just help!\n");
- else argument("-f") { nextargument(ptr) printf("Forced argument: %s\n",ptr); }
- else { thisargument(ptr); printf("Simple argument: %s \n",ptr); }
+ for_args
+ {
+ if_arg ("-?") then
+ print("This is just help!");
+ else if_arg ("-f") then
+ {
+ if (next_arg) then
+ {
+ print("Forced argument: ",next_arg);
+ skip_one;
+ }
+ }
+ else
+ print("Normal argument: ",this_arg);
+ }
}
else
- puts("Bleeeeh, no arguments supplied... :-(");
+ print("Bleeeeh, no arguments supplied... :-(");
}