C<<1 va_list based print and echo commands finaly work
[svn/Cll1h/.git] / demos / arguments1.c
index 6cd7bedb9c33136d31fe78218f05b2d76b9c5115..a892c3a24eddfadb7269c44550f448315c814ba0 100644 (file)
@@ -1,24 +1,30 @@
 #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... :-(");
 }
This page took 0.097104 seconds and 4 git commands to generate.