- In `CommandRegistration` add `ResolvableType` for `OptionSpec` giving
more spesific handling of a type.
- In `CommandParser` handle source and target types so that we
have generics with `List`, `Set` and arrays working better.
- In `HandlerMethodArgumentResolver` add better handling for
`ConversionService` for generic types.
- In `StandardMethodTargetRegistrar` add better types via `ResolvableType`
now that `CommandRegistration` support it.
- In `OptionConversionCommands` remove converter from `String` to `Set` as
now things should work as is if generic in a `Set` has a converter.
- Fixes#694
- When target is set and only one option argument is given,
we should not convert to list as user expects string to xxx
Converter to work.
- This is how it used to work and previous changes caused
regression.
- Bug is actually in an old parser and new parser works fine.
- Backport #667
- Fixes#669
- Now lexing better with valid options
- Only report unrecognised option with double dash
as current parser don't have structure to do
deeper analysis.
- Backport #651
- Fixes#653
- Handle any option collection type so that list is generated for
values, this then works well when actual type conversions happen.
- Backport #630
- Fixes#631
- Issue in #622 is that its command type is `String` and internally
some incoming arguments(it's List) were converted to String by
joining with space. This caused one case with help command to get
conversion via spring's ConversionService(CollectionToStringConverter)
which joins by commas. That was we saw in failed example.
- Remove needed joins in CommandParser and let it just pass List which
then works better with ConversionService.
- This then needs a `command` option type change from String to String[]
which it really is as you should be able to give whole command as
an argument.
- Backport #622
- Fixes#623
- Introduce new error TooManyArgumentsOptionException
and NotEnoughArgumentsOptionException.
- Parser not tracks arity min/max and imposes
if num of option arguments.
- Backport #614
- Fixes#615
- Original commit this sources had some additional changes
which is not possible to merge.
- This commit modifies CommandParser to better track positional parameters
which previously used to go there for non-recognised options. Now using
relatively dump logic of just checking if first positional parameter starts
with '-' which indicates it's a candidate for a new `UnrecognisedOptionException`
which then would give user an error "Unrecognised option '--xxx'" for example.
- Backport #601
- Backport #602
- Fixes#603
- Fixes#604
- NonInteractiveShellRunner has a trouble where incoming
argument loses info about "quoted" string which is handled
by OS terminal.
- Add re-quoting in presense of a whitespace so that
jline parser can detect it correctly.
- Backport #567
- Fixes#570
- Modify CommandParser to convert given option value if its type is defined
- This change makes option default value to behave same as given value
what comes for the actual value in a CommandContext.
- Backport #548
- Fixes#549
- This commit fixes two issues.
- Firstly complete with correct option as existing bug was
to wrongly always complete with first option which used
wrong provider.
- Secondly filter out duplicate option proposals giving better
result when options is already in place.
- Backport #495
- Fixes#498
(cherry picked from commit a143d25ffc)
- For title styling change from bold,fg:bright-white
to bold which should work better with different
terminal color settings as forcing it into bright white
is a bad idea.
- Fixes#476
- For annotated methods with arguments, change default arity
to zero with booleans and one everything else regardless
if @ShellOption is defined or not.
- OptionArity.ZERO_OR_ONE had wrong upperbound value, change
from MAX to 1.
- These modification should take us a bit closer to old
shell functionality and what ShellOption documents for arity.
- For old functionality I'm referring to method
`add(int a, int b)` and/or having @ShellOption and/or without
arity setting.
- Fixes#446
- Use same interface type in a generic interactive completions
in a method level and option value level.
- Change CompletionResolver to have same function signature
as with options and use CompletionContext to keep
relevant information.
- Fixes#449
- This is a re-implementation of a interactive completion
with breaking changes as it moves away from a direct use
of a MethodParameter in favour of a CommandRegistration
and its option definitions.
- Fixes#449
- Adding a concept of no-tty which in this commit simply
tracks DumbTerminal as jline creates that if there nothing
better.
- For components without tty don't go to interaction loop.
- For new sample show that we can at least manually handle
required option with a flow while command option is not
required.
- Fixes#444
- Bring back some missing functionality which got missing
during the rework to new command model.
- Polish some classes.
- Restore origin sample.
- Add availability things into help templates and its
representation model.
- Fixes#423
- Add theme settings for figures.
- Settings for styles are now in it own class and
ThemeSettings are wrapping those.
- Prefixed formatting string to have `style-` prefix.
- Templates can now use added `figures` dictionary which
is resolved per activated theme.
- Create `dump` theme.
- New `ThemeActive` interface where default impl uses dump
theme if `CI` or `NO_COLOR` env is set.
- Rework existing templates.
- Fixes#442
- Add ShellConversionServiceSupplier interface to define
shell spesific ConversionService so that we don't
get trouble with other services in boot.
- Fixes#435
- New configurations to CommandRegistration
- Re-using exit code concepts from boot
- Handling exit codes only in non-interactive mode
- Adding e2e commands and tests for better coverage
- Fixes#431
- Change how errors are printed for interactive
vs non-interactive mode.
- This now changes behaviour so that stacktrace is printed
if non-interactive mode is active so that user has a change
to see the full error.
- Fixes#427
- Change help command output to get templated using
model classes.
- Remove things around ParameterDescription as those are
replaced with template classes.
- Fixes for native configs.
- For now availability and aliases are removed from
help to get back in better form.
- Aliases has been partly introduced to structure.
- Fixes#422