https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #4 from KOLANICH kolan_n@mail.ru --- 3. Manually writing a spec of program CLI is an option too, but not a good one: it have to be updated.
The solution may be creating a geteric spec: specifying common conventions in the CLI like (-a a and --arg=a) vs -arg a vs -arga for most args, using arg-specific ones only if strictly necessary.
A spec may be a JSON file like
{ "binary":"/usr/bin/git", "import":["./common.json"], "types":{ "gitArgType": here is a (G)LR grammar for an arg with something marking which piece is path }, "spec": here is a (G)LR grammar for args, using the types from types and imported specs }
The rewriter processes imports and constructs the spec, then it finds the positions of the stuff which is a path and replaces them with the rewritten paths
All the three methods should he used in combination.