C<<1 va_list based print and echo commands finaly work
[svn/Cll1h/.git] / demos / arguments2.c
index 3982e16fe7ba7879c478d50d6babb0e2effb4d5a..63276cf49b97efa2a6b73aa2918716feba484376 100644 (file)
@@ -1,18 +1,27 @@
 #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... :-(");
 }
This page took 0.124125 seconds and 4 git commands to generate.