Skip to content
  • David Johnson's avatar
    Add a simple argp-like thing for MUL apps (but it uses getopt). · 41b379f6
    David Johnson authored
    MUL's application skeleton that they like us to use (and that saves
    us work) sucks down all the command-line opts via getopt and doesn't
    expose it to the application.  It also parses options before it
    initializes the application "modules", so we can't supply a new app
    callback to handle the opts.
    
    Thus, we add what is basically a secondary initcall-like thing,
    except this one is a struct of callbacks (including the per-app
    getopt parsing function) and data (like the opts and longopts).  So
    the macros define a section of per-module getopt parsing info
    struct pointers, and before calling getopt, the skeleton main
    expands its opts, longopts, and usage with info from these per-app
    getopt helper info structs.
    
    So it really is like a (very) poor man's argp.
    41b379f6