Factor out argument parser populating

Use a separate function populate a parser with argument according to the
arguments accepted by a function signature.