Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to improve CLI parsing #8

Closed
wants to merge 21 commits into from
Closed

Try to improve CLI parsing #8

wants to merge 21 commits into from

Commits on Apr 12, 2017

  1. COMMON: Add a new CLI class

    The goal of this new class is to simplifie the arguments parsing,
    I've take inspiration from glib Commandline option parser:
    https://developer.gnome.org/glib/stable/glib-Commandline-option-parser.html,
    exept that with glib you need to specifie with a flag the type of each options,
    here options type are automatically determine when adding an option
    with parser.addOption.
    
    Basically most of the job is made in the parser contructor, here you can
    set the name of the program, summary, and arguments that are not options.
    
    Option like "--nwm" are set with addOption function.
    "--help" is automatically generated with arguments you've use in
    addOption and in the contructor, "--version" is generated too, and
    call Version::printVersion.
    Matthias Gatto authored and cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    0be0d92 View commit details
    Browse the repository at this point in the history
  2. TLK2XML: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    362d83d View commit details
    Browse the repository at this point in the history
  3. GFF2XML: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    ed5e7b1 View commit details
    Browse the repository at this point in the history
  4. CBGT2TGA: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    2f72d72 View commit details
    Browse the repository at this point in the history
  5. CDPTH2TGA: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    a3d3740 View commit details
    Browse the repository at this point in the history
  6. CONVERT2DA: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    df17c5e View commit details
    Browse the repository at this point in the history
  7. DESMALL: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    24e55e6 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    8393bb3 View commit details
    Browse the repository at this point in the history
  9. NBFS2TGA: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    3bfea1f View commit details
    Browse the repository at this point in the history
  10. NCGR2TGA: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    0ba50ba View commit details
    Browse the repository at this point in the history
  11. SSF2XML: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    56c1aff View commit details
    Browse the repository at this point in the history
  12. NCSDIS: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    d3b7e72 View commit details
    Browse the repository at this point in the history
  13. UNRIM: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    177f738 View commit details
    Browse the repository at this point in the history
  14. UNHERF: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    9fb72b5 View commit details
    Browse the repository at this point in the history
  15. UNERF: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    3c2a2b5 View commit details
    Browse the repository at this point in the history
  16. UNKEYBIF: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    888f8aa View commit details
    Browse the repository at this point in the history
  17. UNNDS: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    f33bffa View commit details
    Browse the repository at this point in the history
  18. UNNSBTX: Use CLI class

    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    423d1c3 View commit details
    Browse the repository at this point in the history
  19. XML2SSF: Use CLI class

    In this file, "Usage: xml2ssf [<options>] [<input file>] <output file>"
    change to
    "Usage: ./bin/xml2ssf [<options>] <[input file] <output file>>".
    
    I had to use an array of stings to get input file and output file,
    this is because input file is the optinal argument and is before ouput file,
    I would be harder to handle this case automatically in cli.h, as I would need to
    check if there is non optinal argument after the optinal one.
    
    I could do that, but as this file is the only one that need that, I don't think
    it worth the effort so I just get all arguments in a vector,
    and let some bytes of the old parser do what's left of the job
    cosmo-ray committed Apr 12, 2017
    Copy the full SHA
    fb30147 View commit details
    Browse the repository at this point in the history
  20. Copy the full SHA
    effc78e View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2017

  1. XML2TLK: Use CLI class

    Signed-off-by: Matthias Gatto <uso.cosmo.ray@gmail.com>
    cosmo-ray committed Apr 13, 2017
    Copy the full SHA
    ef12281 View commit details
    Browse the repository at this point in the history