This commit adds a new parser for the internal time duration flag value
(TimeDurationValue). Previously this used the parser from the time
package from the standard library but this was limited to parsing units
of time up to hours.
The new parser allows users to specify duration in days, hours, minutes,
seconds and a combination of the above. It is quite flexible in the way
users format their string input.
Additonal changes:
- Added unit tests for the command-line parsing of the
TimeDurationValue type.
- Updated the unit tests for the BoolPtrValue type.
- Updated documentation.
PR: #55
- Fixed the BoolPtrValue type in the internal flag package by adding the
IsBoolFlag() bool method to indicate to the command-line parser that
the flag is a boolean flag.
- Added unit tests for the BoolPtrValue type.
PR: #56
Summary:
- Created a custom CLI schema for Enbas which will act as the Source
of Truth for code and document generation.
- Created a code generator which uses the schema to generate the
executor definitions and code in the internal usage package.
Changes:
- Created the Enbas CLI schema as the Source of Truth for Enbas.
- Created the code generator that generates the executor
definitions and code in the usage package.
- Regenerated the executor definitions using the code generator.
- Moved the custom flag value types to the new internal flag
package.
- Created a new flag value type for the bool pointer to replace the
flag.BoolFunc() used for the sensitive and no-color flags.
- Moved the version and build variables to the new internal version
package to simplify the version executor.
- Created a new usage package and moved the usage functions there.
- Changed the type of the account-name flag from string to the
internal StringSliceValue type.