3 ms·
I like to use this technique for CLI command and help tables. It eliminates having a single giant table in a file, instead you have a C macro which makes the s
by jhallenworld 7y ago
I like to use this technique for CLI command and help tables. It eliminates having a single giant table in a file, instead you have a C macro which makes the system aware of your command right next to your command definition.
int my_command(..) { ... }
COMMAND(my_command, "command_name", "example command")
HELP("use --foo argument for this...")
HELP("use --bar argument for that...")
Also used this all the time back when I programmed assembly language.
It's definitely a problem that this is not standardized. For example, TI has their own C compiler for their ARM CPUs, not everybody uses gcc..