Releases: dotmake-build/command-line
Releases · dotmake-build/command-line
DotMake.CommandLine v1.5.7
-
Made required behaviour for
CliArgument
andCliOption
more sensible:
If the decorated property has a default value (set via a property initializer), the argument/option is detected as "not required".
If the decorated property does not have a default value, the argument/option is detected as "required".If you want to force an argument/option to be required, set this property to
true
. In that case,
the default value for the decorated property will be ignored (if exists).
If you want to force an argument/option to be not required, set this property tofalse
.
DotMake.CommandLine v1.5.6
- Fixed net472 and netstandard2.0 support. ModuleInitializerAttribute will be generated for legacy projects (missing before net5.0).
DotMake.CommandLine v1.5.5
- Optimized enumerable/collection type parsing for CLI options/arguments. It's now fully compatible (stable) with AOT compilation !
Arrays, lists, collections - any type that implementsIEnumerable<T>
and has a public constructor with aIEnumerable<T>
orIList<T>
parameter (other parameters, if any, should be optional).
If type is genericIEnumerable<T>
,IList<T>
,ICollection<T>
interfaces itself, arrayT[]
will be used.
If type is non-genericIEnumerable
,IList
,ICollection
interfaces itself, arrayobject[]
will be used.
DotMake.CommandLine v1.5.4
- Optimized custom type parsing for CLI options/arguments feature added in v1.5.0. It's now fully compatible (stable) with AOT compilation !
DotMake.CommandLine v1.5.2
- Changed behaviour: Added Required property to CliArgumentAttribute, default is true for arguments.
Default is false for options (already had Required property). Whether you specify a default value for a property will
no longer effect the requirement of the argument or option. By contrast, when you set Required to true, the default value
of the property will be ignored. - Beautified help output: Moved [required] label to description (second column), prevented display of empty [] default values.
For wrong inputs, only errors will be shown and not the complete help output below.
DotMake.CommandLine v1.5.0
- Added: For a CLI option or argument, any type with a public constructor or a static
Parse
method with a string parameter
can be now be used. These types can be bound/parsed automatically even if they are wrapped withEnumerable
orNullable
type (note that as of current version, custom class support when using AOT compilation is not stable but trimming works)
DotMake.CommandLine v1.4.0
- Added CliHelpBuilder which allows overriding HelpBuilder easier and adds color support (argument and option names
in first column will be white for more readability).
Additional info will be printed when the app is run:
The first line will be product name (from AssemblyProductAttribute or AssemblyName)
and version (from AssemblyInformationalVersionAttribute, AssemblyFileVersionAttribute or AssemblyVersionAttribute).
Second line will be copyright (from AssemblyCopyrightAttribute).
Removed "Description" heading, description will be directly printed for root commands and name in white, semi-colon
and then description will be printed for sub-commands. - Added OutputEncoding middleware for the console (by default Encoding.UTF8 is used, this is especially required to
print the copyright symbol). - Cli.Parse methods will now return an instance of the definition class whose properties were bound/populated from
the parse result. Optional signatures will allow access to parseResult with an out parameter.
DotMake.CommandLine v1.2.1
- Source generator should produce files with space indents and not tab indents (indent size is 4)
DotMake.CommandLine v1.2.0
- Dropped
DotMake
prefix from all classes to follow the .NET naming conventions.
Namespace should be sufficient to prevent future conflicts.
So the attribute names are nowCliCommandAttribute
,CliOptionAttribute
,CliArgumentAttribute
and main parse/run class name is nowCli
.
DotMake.CommandLine v1.0.0
Initial release.