jessevdk/go-flags — pull request #73 by zimmski (2014-05-10 23:21:28+00:00)
Title: Rework default value handling

Option.defaultValue does now always hold the real defaultValue which is set during Group.scanStruct.

The store/restore hack with defaultValue in Parser.ParseArgs is now done via its own map:
1. store current values for slice and map options in the map and clear these options
2. parsed arguments overwrite stored values -> remove option from map if there is an argument for it
3. restore leftover values

There is no need to do the same store/restore for Ini since the IniParser sets slices/maps in one assignment.

Eager to hear your feedback! :bowtie:

(btw I think I see a bug in the short option handling. Parser.parseShort should do a delete(s.lookup.required, option) if shorts are concatenated. I will do some research on this)