bungeemonkee / Configgy

A simple, powerful, extensible, testable .NET configuration library.
MIT License
41 stars 4 forks source link

Attribute and extension method to generate command-line help #13

Closed bungeemonkee closed 8 years ago

bungeemonkee commented 8 years ago

Create an attribute (something like [Help(string)]) that can be used to get documentation about each config option.

Then add an extension method (GetCommandLineHelp() perhaps) which enumerates these values and generates each in the command line format of the option ('--XXXXX') with it's help text.

If the option is excluded from the command line source (see https://github.com/bungeemonkee/Configgy/issues/12) it should be excluded.

If the option has no help text it should be included by default but there should be an option to exclude these.

Ideally the method would be able to intelligently wrap the output to a given width (perhaps as a parameter). If the app is running in a user mode (Environment.UserInteractive is true) it should default to the current console width (Console.WindowWidth). If the app is not running in a user interactive mode it should default to a predetermined number (probably 80).

bungeemonkee commented 8 years ago

Added in 9cef23c2c15fdcce11f0986e488b877f33bf5c7c