Changeset 33662 for trunk/Ohana/src/opihi/cmd.basic/list.c
- Timestamp:
- Apr 1, 2012, 3:24:39 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.basic/list.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/list.c
r31667 r33662 19 19 remove_argument (N, &argc, argv); 20 20 RunCommand = TRUE; 21 } 22 23 if ((N = get_argument (argc, argv, "-vectors"))) { 24 remove_argument (N, &argc, argv); 25 if (argc != 2) { 26 gprint (GP_ERR, "USAGE: list (root) -vectors\n"); 27 return (FALSE); 28 } 29 ListVectorsToList (argv[1]); 30 return TRUE; 31 } 32 33 if ((N = get_argument (argc, argv, "-buffers"))) { 34 remove_argument (N, &argc, argv); 35 if (argc != 2) { 36 gprint (GP_ERR, "USAGE: list (root) -buffers\n"); 37 return (FALSE); 38 } 39 ListBuffersToList (argv[1]); 40 return TRUE; 21 41 } 22 42 … … 85 105 } 86 106 107 // old list must exist, or give an error 87 108 sprintf (line, "%s:n", argv[3]); 88 109 N = get_int_variable (line, &found); 110 if (!found) { 111 gprint (GP_ERR, "USAGE: list (newlist) -copy (oldlist) ...\n"); 112 gprint (GP_ERR, "ERROR: missing input list\n"); 113 return (FALSE); 114 } 115 116 89 117 sprintf (line, "%s:n", argv[1]); 90 118 set_int_variable (line, N); … … 118 146 119 147 // remove the single named entry from the list (finds entry with given name, reduces list length by one) 120 // return an error if -add is given with no other args121 148 if ((argc > 2) && (!strcmp (argv[2], "-del"))) { 122 149 if (argc != 4) { … … 155 182 156 183 if (argc != 2) { 157 gprint (GP_ERR, "USAGE: list (root) : supply list data, terminate with 'END'\n"); 158 gprint (GP_ERR, "USAGE: list (root) -x (command) : create list from shell output\n"); 159 gprint (GP_ERR, "USAGE: list (root) -split (words) : create list from words\n"); 160 gprint (GP_ERR, "USAGE: list (root) -add (words) : extend a list\n"); 184 gprint (GP_ERR, "USAGE: list (root) : supply list data, terminate with 'END'\n"); 185 gprint (GP_ERR, "USAGE: list (root) -x (command) : create list from shell output\n"); 186 gprint (GP_ERR, "USAGE: list (root) -vectors : create list from vector names\n"); 187 gprint (GP_ERR, "USAGE: list (root) -buffers : create list from buffer names\n"); 188 gprint (GP_ERR, "USAGE: list (root) -split (words) : create list from words\n"); 189 gprint (GP_ERR, "USAGE: list (root) -splitbychar (char) (word) [(words)..] : create list from words\n"); 190 gprint (GP_ERR, "USAGE: list (root) -add (words) : extend a list\n"); 191 gprint (GP_ERR, "USAGE: list (root) -copy (list) : copy a list to a new name\n"); 192 gprint (GP_ERR, "USAGE: list (root) -del (word) : delete the entry by value\n"); 161 193 return (FALSE); 162 194 }
Note:
See TracChangeset
for help on using the changeset viewer.
