- With annotation(@Command) model it's now possible to just
add CommandContext and it will get resolved and doesn't
cause it to appear as an option.
- Backport #779
- Fixes#990
- Revisit how alias commands are added using
@Command annotation when using if/or on class
and/or method level.
- With this change alias handling is more logical
and there's better tests and docs.
- Backport #945
- Fixes#973
- Fix alias command extraction from existing @Command
annotations so that we actually get multiple aliases
defined if more than one defined on a method level.
- Fix rendering issue in a help stg template when
multiple aliases exists.
- Backport #796
- Fixes#798
- Change to have better support for args like:
"--arg1 a --arg2 b"
"--arg1 a --arg2 b c"
"--arg1 a c --arg2 b c"
"c --arg1 a --arg2 b"
where option can have default values and position of
positional args doesn't matter that much.
- Make parser to be aware of if it's handling last option
so that we can differentiate if error can be given i.e.
with too many args, etc.
- Backport #795
- Fixes#797
- New OptionMethodArgumentResolver which is similar
than ShellOptionMethodArgumentResolver for @ShellOption.
- Add missing annotation commands for e2e test command.
- Fixes#767
- 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.
- Backport #694#699
- Fixes#700
- Better alignment for use of positional args without using
an option.
- Should work similarly with old parsing framework.
- Change position where missing options are checked.
- Fixes#701
- 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.
- Fixes#667
- Previously CommandParser contained parser which was
scannerless type of brute force parsing of command
line args.
- Contract in that old parser wasn't super clear what
is its role with caller as it was given options
and registration was parsed in a Shell class.
- Add completely new parser package which has better
model and which will be much easier to modify for
future needs.
- Change some interfaces around parsing so that we do
as much in this new parsing model instead of pre-parsing
something in a Shell class.
- We also try to move away from using exceptions as
a message delivery which had its own problems. Instead
introducing parser messages which gives better info
when errors are detected.
- Add ParserConfig class which allows to expose settings
to change some parser features. Later this will be
exposed to user so that some features can be turned on/off
for an actual shell needs.
- Fixes#646
- This is a first commit to add new annotation model
which eventually will replace old legacy annotations
like ShellComponent, ShellMethod, @ShellOption, etc.
- Adds subset of features needed for parity with manual
use of CommandRegistration.
- Relates #637
- Relates #638
- Relates #639
- Relates #640
- Relates #641
- New OptionNameModifier which is just a Function<String,String> to
modify a name.
- Can be defined per option in CommandRegistration.
- Can be defined as global default as bean.
- Default implementation for common case types is enabled via boot's
config props under spring.shell.option.naming.case-type
- Support facilities for camel, kebab, snake and pascal conversions.
- Fixes#621
- Introduce new error TooManyArgumentsOptionException
and NotEnoughArgumentsOptionException.
- Parser not tracks arity min/max and imposes
if num of option arguments.
- CommandParserExceptionResolver contains better error
message handling for these containing more context
for a user.
- Fixes#614
- 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.
- Fixes#601
- Fixes#602
- New annotations ExceptionResolver and ExitCode
- New needed functionality is in classes ExceptionResolverMethodResolver
and MethodCommandExceptionResolver.
- Hook these annotations with StandardMethodTargetRegistrar and Shell classes
- Fixes#597
- There's been no explicit support having argument void type
as you would not be able to use with annotation model but
surely can be wrapped as Type with CommandRegistration.
- For now change CommandInfoModel so that it uses empty string
which is i.e. expected in help options which are just
used as flags.
- It's outside of this commit to change parser to fail if
user gives an argument value for this type of options.
- Fixes#586
- Essentially this commit registeres on default `--help` and
`-h` options to every command and execution short circuits
in presense of help options to help command.
- Add Supplier<CommandRegistration.Builder> as a bean which
can be autowired registration beans.
- Make this common bean customisable via CommandRegistrationCustomizer.
- Change StandardMethodTargetRegistrar to use supplier so that
annotated commands gets common customizations.
- Change sample commands to use supplier.
- Add new group, spring.shell.help to config props.
- Docs changes
- Fixes#582
- Fixes#585
- Change sample build to use musl on linux
- Optionally remove version from jar so that
e2e tests don't need to use version in path.
- Add better matrix to e2e so that we're able to
build on one OS and then test with others.
- Fixes#576
- NOTE: very much wip and unstable
- This commit is a first step to provide boot style
@ShellTest annotation
- New modules spring-shell-test and spring-shell-test-autoconfigure
- Focus is to autoconfigure context without shell runners so that
we can create "sessions" and hook to configures jline terminal
with custom in/out streams.
- Skeleton fork from jediterm to provide basic terminal emulation
to part of a control amd escape characters working.
- ShellTestClient is a concept user can use to interact with a shell
in a same way user would use a "real" shell.
- Fixes#489
- New PatchSearch component
- Allow user to define base directory for search
- Show (using single select list) search results
- Allow user to define search string
- Implement algorithms(start with exact-match and fuzzy-match) from fuzzy search tool (fzf)
- Sample "component path search" and change "component path" to "component path input"
- Fixes#556
- CommandRegistration now has a structure to define
it beind hidden
- Modify relevant parts to filter out hidden commands
- Essentially command is hidden from all other than
command execution
- Sample in e2e tests
- Fixes#416
- BaseComponentContext has new field terminalWidth.
- StringToStyleExpressionRenderer contains new format
for "truncate-" prefixes and this is something
what template can use to instruct max length based
on terminal width.
- Change single/multi selectors to use this feature.
- Fixes#543
- Add exception handling around new interface CommandExceptionResolver
which allows to define a chain of resolvers to process errors before
exception is bubbled up to result handlers.
- Will be foundation to add more sophisticated error handling features
compared to what spring itself have for rest layer.
- Resolver returns CommandHandlingResult holder which further can be
used to make a choice what to print into console and if spesific exit
code should be used in non-interactive mode.
- Exception handling can be defined globally and per command giving
a change for user to customise i.e. error thrown by parser.
- CommandParserExceptionResolver replaces CommandParserExceptionsExceptionResultHandler
and provides more meaninful message for missing options.
- Fixes#503
- 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.
- Fixes#548