Commit Graph

763 Commits

Author SHA1 Message Date
Janne Valkealahti
7768d46360 Test help command with e2e tests
- Backport #756
- Fixes #759
2023-06-02 06:19:49 +01:00
Janne Valkealahti
08b16d5290 Add hints for Availability targets
- Annotate ShellComponent with @Reflective and use custom
  AvailabilityReflectiveProcessor to find possible method
  targets returning Availability.
- Backport #747
- Fixes #758
2023-06-01 21:22:19 +01:00
Janne Valkealahti
8e98c183df Remove schedule from e2e 2023-06-01 08:44:40 +01:00
github-actions[bot]
515372019c Next development version 2023-05-25 15:43:43 +00:00
Janne Valkealahti
0b1ece8da6 Add input into ConfirmationInput
- Now displaying what user actually inputs
- Backport #740
- Fixes #746
2023-05-20 17:22:48 +01:00
Janne Valkealahti
94fa9edb73 Upgrade spring-boot 3.0.7
- Fixes #742
2023-05-19 08:30:13 +01:00
github-actions[bot]
8ab3da5471 Next development version 2023-05-08 08:17:28 +00:00
Janne Valkealahti
0be4cf06c1 Upgrade jline 3.23.0
- Backport #725
- Fixes #727
2023-04-28 17:48:49 +01:00
Janne Valkealahti
d4b26eea62 Migrate docs to spring-asciidoctor-backends
- Use io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.5
- As this relates to anon repo access, use ge conventions from
  public repos and fix some other used repos.
- Backport #722
- Fixes #724
2023-04-28 13:56:03 +01:00
Janne Valkealahti
4d9ba5b4a4 Upgrade spring-boot 3.0.6
- Fixes #718
2023-04-27 20:50:38 +01:00
github-actions[bot]
7980561e21 Next development version 2023-04-11 18:51:17 +00:00
cachescrubber
5ff6c40c45 Pass ShellContext to CommandCatalog.of in CommandCatalogAutoConfiguration (#693)
- Backport #702
- Fixes #704
2023-04-06 09:13:59 +01:00
Janne Valkealahti
cd9651eea8 Fix option type parsing
- 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
- Fixes #699
2023-04-02 14:43:18 +01:00
Janne Valkealahti
8ce7a11aa0 Upgrade spring-boot 3.0.5
- Fixes #695
2023-03-24 07:49:27 +00:00
Janne Valkealahti
40d6a8bdd9 Update docs copyright year 2023-03-18 16:51:19 +00:00
Janne Valkealahti
4416509a90 Fix ConfirmationInput template message
- Fix confirmation-input-default.stg to use correct style
  names in format.
- Backport #690
- Fixes #691
2023-03-17 08:42:51 +00:00
Simon Verhoeven
04c936223a Rename setMaskCharater to setMaskCharacter
- Backport #686
- Fixes #688
2023-03-12 16:10:38 +00:00
Janne Valkealahti
278039fe95 Upgrade spring-boot 3.0.4
- Fixes #684
2023-03-05 16:48:27 +00:00
github-actions[bot]
f0409c7254 Next development version 2023-02-27 17:37:12 +00:00
Janne Valkealahti
b0e9a13be0 Wrong arity for default boolean type
- Set boolean type arity zero or more as default.
- Backport #675
- Fixes #678
2023-02-27 15:41:08 +00:00
Janne Valkealahti
c91db3547d Upgrade spring-boot 3.0.3
- Fixes #661
2023-02-24 08:53:29 +00:00
Janne Valkealahti
3eeccd33be Rename command registration doc files 2023-02-23 09:57:40 +00:00
Janne Valkealahti
e469c148df Use correct type with set
- 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 #670
2023-02-18 14:20:41 +00:00
Janne Valkealahti
8c7b70b21e Better e2e tests coverage
- Add integration tests for e2e samples.
- Add some missing commands for new annotation system.
- Backport #654
- Fixes #655
2023-02-06 09:04:24 +00:00
Janne Valkealahti
edfe67c00d Test terminal can set dimensions
- ShellTest now has fields which can be used to
  change terminal default widht/height.
- Backed by properties so can be used with
  `spring.shell.test.terminal-width` and
  `spring.shell.test.terminal-height`.
- Backport #656
- Fixes #659
2023-02-05 15:25:54 +00:00
Janne Valkealahti
3ed49d1bd6 Handle arg looking options better
- 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 #652
2023-02-01 09:43:12 +00:00
Janne Valkealahti
88df6cc7b4 CommandRegistration should return same options
- Cache created CommandOption(s) to return same instance.
- Backport #648
- Fixes #650
2023-01-28 17:14:07 +00:00
Janne Valkealahti
1c4608fb89 OptionArity NONE value
- Backport #644
- Fixes #645
2023-01-27 09:42:16 +00:00
Janne Valkealahti
1a1ddaadc7 Reorganise e2e samples
- Backport #642
- Fixes #643
2023-01-26 14:19:50 +00:00
Janne Valkealahti
32fc72329b Define CommandExceptionResolver bean order
- CommandParserExceptionResolver uses default bean
  order -100.
- Backport #634
- Fixes #635
2023-01-25 17:59:49 +00:00
Janne Valkealahti
d7f0459874 Change workflows for new branch 2023-01-24 12:34:26 +00:00
github-actions[bot]
bd7f5b882c Next development version 2023-01-24 10:23:23 +00:00
Janne Valkealahti
d44d0c3016 Update next version workflow 2023-01-23 11:32:14 +00:00
Janne Valkealahti
ae3af74b20 Update release workflow 2023-01-23 11:04:07 +00:00
Janne Valkealahti
fb1616e0c6 Polish 2023-01-20 16:09:21 +00:00
Janne Valkealahti
df9c5b5483 Upgrade spring-boot 3.0.2
- Fixes #619
2023-01-20 09:54:24 +00:00
Janne Valkealahti
624343ace2 Handle collection types in a parser
- Handle any option collection type so that list is generated for
  values, this then works well when actual type conversions happen.
- Fixes #630
2023-01-19 17:33:18 +00:00
Janne Valkealahti
56b9cb20ef Document String array option type
- Fixes #628
2023-01-19 11:32:37 +00:00
Janne Valkealahti
25d249c28d Exclude ExitRequest from error handling
- Don't try to handle ExitRequest exception with error handling
  so that we're able to break out from a run loop with
  interactive shell.
- Fixes #624
2023-01-18 09:03:03 +00:00
Janne Valkealahti
90010a94ea Fix e2e tests
- As one command name was changed
2023-01-16 21:12:17 +00:00
Janne Valkealahti
6e1ca089d7 Replace parser string joining with list
- 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.
- Fixes #622
2023-01-16 17:47:21 +00:00
Janne Valkealahti
a04091c08f Support modify option names
- 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
2023-01-15 10:02:55 +00:00
Christian Niessner
448c507ce9 Allow Shell.input() to be overridden in subclasses
- the ssh-shell-spring-boot extensions needs to extend to override the Shell.input()
  method to handle the input provided via the SSH session properly
2023-01-13 18:05:35 +00:00
Janne Valkealahti
95e2829dc3 Revisit positional arguments
- Add better mapping logic
- Add better type conversion
- More docs for arity and positional option configuration
- Fixes #616
2023-01-13 15:11:38 +00:00
Janne Valkealahti
b10786814a Handle arity errors
- 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
2023-01-12 11:26:20 +00:00
Janne Valkealahti
6461a755d5 Add issue handler workflow
- Handle triage for new issues
- Handle backport issues
2023-01-12 10:43:10 +00:00
Janne Valkealahti
f91b255bda Create BuilderSupplier interface
- Fixes #607
2023-01-08 13:38:33 +00:00
Janne Valkealahti
9b4e347633 Add unrecognised option support
- 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
2023-01-07 08:58:40 +00:00
Janne Valkealahti
c7c7e42b8b Fix NPE
- Fixes #593
2023-01-01 15:11:07 +00:00
Janne Valkealahti
bf2692c70c Support exception handling with annotated methods
- New annotations ExceptionResolver and ExitCode
- New needed functionality is in classes ExceptionResolverMethodResolver
  and MethodCommandExceptionResolver.
- Hook these annotations with StandardMethodTargetRegistrar and Shell classes
- Fixes #597
2023-01-01 14:51:05 +00:00