• spiiroin's avatar
    Add module for command line option parsing · 4ca9e1cd
    spiiroin authored
    Especially mcetool has already a lot of options and there are multiple
    places that need to be edited when new options are added. This easily
    leads into situations where something is forgotten or wrong - like usage
    information that is either completely missing or does not match the
    actual command line parsing logic.
    The basic idea is to make command line parsing as data driven as possible
    by defining a structure to hold
    - long option name and short option character
    - option and parameter description texts
    - callback functions for actual processing
    Arrays of these can then be used to construct data needed by normal
    getopt_long() and provide --help output in consistent manner.
mce-command-line.c 8.5 KB