jessevdk/go-flags

Ability to parse multiple flags in sequence

Closed this issue · 1 comments

Is there a good way to track the order in which options were provided across multiple flags? e.g. a way of implementing rsync style --exclude '*' --include '*.something' where args need to be processed in the order provided and we can't just stack all the excludes and includes as separate string slices

You can either use function types or a custom type that implements the Marshaler/Unmarshaler interfaces to process the provided arguments as you want (in order).