#include "cll1.h"
-//try$ make arguments1
-//try$ ./arguments1 -x xxx yyyy -c cccc
+//try to run: ./arguments1 -x xxx yyyy -c cccc
program
{
- char *ptr;
+ Define_str(ptr);
- arguments
+ if_args then
{
- thisargument(ptr);
- if(*ptr=='-') then
+ for_args
{
- printf("Command line switch: -%c ",ptr[1]);
- nextargument(ptr);
- printf("followed by: %s\n",ptr);
+ ptr=this_arg;
+ if (ptr[0]=='-') then
+ {
+ printf("Command line switch: -%c ",ptr[1]);
+ if (next_arg) then
+ {
+ echo("followed by: ",next_arg);
+ skip_one;
+ }
+ print("");
+ }
+ else
+ print("Standalone argument: ",ptr);
}
- else
- printf("Simple argument: %s \n",ptr);
}
else
- puts("Bleeeeh, no arguments supplied... :-(");
+ print("Bleeeeh, no arguments supplied... :-(");
}