mitchellh / cli

A Go library for implementing command-line interfaces.
Mozilla Public License 2.0
1.73k stars 123 forks source link

Add flags dynamically #99

Closed theprobugmaker closed 2 years ago

theprobugmaker commented 2 years ago

I want to dynamically add more flags to the application.

Imagine that I have a flag that is --extra-features. I want to add more flags dynamically if this one is present. How can I do something like that?

Thank you.

mitchellh commented 2 years ago

This library doesn’t do any flag parsing. It passes the args in as a []string and lets you handle it so you’re free to do anything you want in your command implementations.