A command parser/dispatcher example from my CO2 laser engraver codebase, using a struct array containing the commands and associated pointer to functions. A lot cleaner (and easier to maintain) than switch/case statements or if/else constructs...
Functions get called with a pointer to the command tail for local parameter parsing.
The struct array data are all placed in flash.
typedef struct {
char const *const command;
bool (*const handler)(char *);
const bool report;
} command;
bool query (char* params);
bool start (char* params);
bool moveXrel (char* params);
bool moveYrel (char* pa