Difficult to test, indent and build.
Perhaps switch from erb to some sort of builder class.
Perhaps a separate gem that can be used for other CLI frameworks also, perhaps sparking interest and PR's from more people than the rather small userbase of clamp.
Something like
builder = CompletionBuilder.new
sc = builder.subcommand 'foo', 'foo related functionality'
sc.flag %w(-d --debug), "enable debug"
sc.option %w(-c --config), "configuration file", glob: '*.yml'
builder.to_bash
Difficult to test, indent and build.
Perhaps switch from erb to some sort of builder class.
Perhaps a separate gem that can be used for other CLI frameworks also, perhaps sparking interest and PR's from more people than the rather small userbase of clamp.
Something like