a:defaultReplacement should only be used when a:arguments is really empty, too. Introduce an optional options Dictionary and preset replacement / flags defaults of "~" and "&" resp. for when a:arguments is really empty, which makes sense for use with :substitute. Allow submatches for a:flagsExpr via a:options.flagsMatchCount, to avoid further parsing in the client.
ENH: Also parse lone {flags} (if a:flagsExpr is given) by default, and allow to turn this off via a:options.isAllowLoneFlags.
ENH: Allow to pass a:options.emptyPattern, too.
Only return a:defaultFlags when the passed a:arguments is really empty.
CHG: Redesign ingo#cmdargs#ParseSubstituteArgument() interface to the existing use cases. a:defaultReplacement should only be used when a:arguments is really empty, too. Introduce an optional options Dictionary and preset replacement / flags defaults of "~" and "&" resp. for when a:arguments is really empty, which makes sense for use with :substitute. Allow submatches for a:flagsExpr via a:options.flagsMatchCount, to avoid further parsing in the client.
ENH: Also parse lone {flags} (if a:flagsExpr is given) by default, and allow to turn this off via a:options.isAllowLoneFlags.
Move to ingo-library.