XXX Just an example command showing how to parse arguments (more complex than generally needed)
| 118 | |
| 119 | // XXX Just an example command showing how to parse arguments (more complex than generally needed) |
| 120 | void cliFunc_echo( char* args ) |
| 121 | { |
| 122 | char* curArgs; |
| 123 | char* arg1Ptr; |
| 124 | char* arg2Ptr = args; |
| 125 | |
| 126 | // Parse args until a \0 is found |
| 127 | while ( 1 ) |
| 128 | { |
| 129 | print( NL ); // No \r\n by default after the command is entered |
| 130 | |
| 131 | curArgs = arg2Ptr; // Use the previous 2nd arg pointer to separate the next arg from the list |
| 132 | CLI_argumentIsolation( curArgs, &arg1Ptr, &arg2Ptr ); |
| 133 | |
| 134 | // Stop processing args if no more are found |
| 135 | if ( *arg1Ptr == '\0' ) |
| 136 | break; |
| 137 | |
| 138 | // Print out the arg |
| 139 | dPrint( arg1Ptr ); |
| 140 | } |
| 141 | } |
| 142 |
nothing calls this directly
no test coverage detected
searching dependent graphs…