XXX Just an example command showing how to parse arguments (more complex than generally needed)
| 101 | |
| 102 | // XXX Just an example command showing how to parse arguments (more complex than generally needed) |
| 103 | void cliFunc_echo( char* args ) |
| 104 | { |
| 105 | char* curArgs; |
| 106 | char* arg1Ptr; |
| 107 | char* arg2Ptr = args; |
| 108 | |
| 109 | // Parse args until a \0 is found |
| 110 | while ( 1 ) |
| 111 | { |
| 112 | print( NL ); // No \r\n by default after the command is entered |
| 113 | |
| 114 | curArgs = arg2Ptr; // Use the previous 2nd arg pointer to separate the next arg from the list |
| 115 | CLI_argumentIsolation( curArgs, &arg1Ptr, &arg2Ptr ); |
| 116 | |
| 117 | // Stop processing args if no more are found |
| 118 | if ( *arg1Ptr == '\0' ) |
| 119 | break; |
| 120 | |
| 121 | // Print out the arg |
| 122 | dPrint( arg1Ptr ); |
| 123 | } |
| 124 | } |
| 125 |
nothing calls this directly
no test coverage detected
searching dependent graphs…