Commit Graph

673 Commits

Author SHA1 Message Date
Janne Valkealahti
efe8d561fd Upgrade spring-boot 2.7.11
-Fixes #719
2023-04-27 20:52:58 +01:00
github-actions[bot]
8572eeef93 Next development version 2023-04-11 17:35:48 +00:00
cachescrubber
f3e3061580 Pass ShellContext to CommandCatalog.of in CommandCatalogAutoConfiguration (#693)
- Backport #702
- Fixes #703
2023-04-06 09:16:34 +01:00
Janne Valkealahti
78faeac86a Fix build with jdk8
- Remove non jdk8 code used in #694
2023-04-06 07:18:53 +01:00
Janne Valkealahti
041cb30eb0 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.
- Fixes #694
2023-04-02 14:37:08 +01:00
Janne Valkealahti
77b136f53f Upgrade spring-boot 2.7.10
- Fixes #696
2023-03-24 07:48:26 +00:00
Janne Valkealahti
5e0c79cb2a Update docs copyright year 2023-03-18 16:51:49 +00:00
Janne Valkealahti
de08935b92 Fix ConfirmationInput template message
- Fix confirmation-input-default.stg to use correct style
  names in format.
- Backport #690
- Fixes #692
2023-03-17 08:43:52 +00:00
Simon Verhoeven
3c090848bf Rename setMaskCharater to setMaskCharacter
- Backport #686
- Fixes #689
2023-03-12 16:12:28 +00:00
github-actions[bot]
b4f2598417 Next development version 2023-02-27 17:26:44 +00:00
Janne Valkealahti
d9641f6d1c Wrong arity for default boolean type
- Set boolean type arity zero or more as default.
- Backport #675
- Fixes #677
2023-02-27 15:44:35 +00:00
Janne Valkealahti
339b43b5e3 Upgrade spring-boot 2.7.9
- Fixes #660
2023-02-23 18:14:11 +00:00
Janne Valkealahti
d72627443c Rename command registration doc files 2023-02-23 09:57:33 +00:00
Janne Valkealahti
545a735dd9 Move command registration under same section 2023-02-23 09:28:48 +00:00
Janne Valkealahti
7ec5c194ff 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 #669
2023-02-18 14:21:08 +00:00
Janne Valkealahti
3c44c7c976 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 #653
2023-02-01 09:43:36 +00:00
Janne Valkealahti
ca76a63c30 CommandRegistration should return same options
- Cache created CommandOption(s) to return same instance.
- Backport #648
- Fixes #649
2023-01-28 17:50:45 +00:00
github-actions[bot]
61ab2de48c Next development version 2023-01-24 09:28:38 +00:00
Janne Valkealahti
9154c85762 Use nexus-sync v0 2023-01-23 10:51:57 +00:00
Janne Valkealahti
5c52fbe373 Polish 2023-01-20 16:11:42 +00:00
Janne Valkealahti
a7d31c1126 Upgrade spring-boot 2.7.8
- Fixes #620
2023-01-20 09:53:49 +00:00
Janne Valkealahti
21d695f68e Fix sample commands
- Fix mistake made in backport #631 which
  caused compile issues.
2023-01-19 18:01:27 +00:00
Janne Valkealahti
1bc26c7e17 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.
- Backport #630
- Fixes #631
2023-01-19 17:34:43 +00:00
Janne Valkealahti
78da071e86 Document String array option type
- Backport #558 as it brings missing option type docs
- Backport #628
- Fixes #629
2023-01-19 11:59:53 +00:00
Janne Valkealahti
b853112e0b 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.
- Backport #622
- Fixes #623
2023-01-16 21:03:47 +00:00
Janne Valkealahti
7c91782841 Revisit positional arguments
- Add better mapping logic
- Add better type conversion
- More docs for arity and positional option configuration
- Backport #616
- Fixes #617
2023-01-13 17:56:24 +00:00
Janne Valkealahti
4381c2423e Handle arity errors
- 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.
2023-01-13 17:53:54 +00:00
Janne Valkealahti
6e3d43c549 Fix sample
- Remove use of CommandRegistration.Builder supplier
- #618
2023-01-13 17:40:31 +00:00
github-actions[bot]
8179401268 Next development version 2023-01-10 14:47:40 +00:00
Janne Valkealahti
c1604021c6 Use nexus-sync 0.0.x 2023-01-10 13:01:58 +00:00
Janne Valkealahti
38acd79b83 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.
- Backport #601
- Backport #602
- Fixes #603
- Fixes #604
2023-01-07 09:08:15 +00:00
Janne Valkealahti
800e249b98 Fix NPE
- Backport #593
- Fixes #598
2023-01-01 15:12:48 +00:00
Janne Valkealahti
dd84beafcb Upgrade spring-boot 2.7.7
- Fixes #595
2022-12-27 15:56:31 +00:00
guang384
7a6d457e71 Wraps ExtendedArgumentList into CompletingParsedLine prevent WARNING during startup.
- Idea/hack copied from jline LineReaderImpl
- Backport #526
- Fixes #594
2022-12-27 15:34:41 +00:00
github-actions[bot]
14aa6f1703 Next development version 2022-12-01 16:10:00 +00:00
Janne Valkealahti
e70ea6b555 Register option without prefix
- While option should be defined i.e. using "--arg", discover
  prefix from ShellMethod#prefix and use that if just "arg"
  is defined.
- Backport #575
- Fixes #577
2022-11-26 15:09:25 +00:00
Janne Valkealahti
7e2c6c180a Upgrade spring-boot 2.7.5
- Fixes #571
2022-11-25 15:12:47 +00:00
Janne Valkealahti
df19da0dde Method execution should not error without value
- Do npe check when getting class type out from
  incoming value.
- Backport #572
- Fix #573
2022-11-22 07:53:48 +00:00
Janne Valkealahti
bc0b4a13df Re-quote whitespace
- 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
2022-11-18 07:28:07 +00:00
github-actions[bot]
3e5eac7008 Next development version 2022-10-24 06:52:51 +00:00
Janne Valkealahti
b220ea5656 Use nexus-sync main 2022-10-24 07:31:45 +01:00
Janne Valkealahti
a7d53d4226 Upgrade spring-boot 2.7.5
- Fixes #547
2022-10-21 13:52:53 +01:00
Janne Valkealahti
27f8802ebc Process given values is a parser
- 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
2022-10-14 06:44:35 +01:00
github-actions[bot]
685af2e3da Next development version 2022-10-04 13:54:37 +00:00
Janne Valkealahti
1b47df4b2e Fix correct snapshot version 2022-10-04 11:55:44 +01:00
Janne Valkealahti
e90929cadc Fix correct branch refs in workflows 2022-10-03 11:34:56 +01:00
Janne Valkealahti
d47d23f930 Upgrade spring-boot 2.7.4
- Fixes #538
2022-09-23 16:28:00 +01:00
Janne Valkealahti
2cf712328c Fix next handling in ComponentFlow
- This fixes a bug where returning null from a next()
  didn't stop a flow.
- Backport #510
- Fixes #513

(cherry picked from commit 7c4700b7b5)
2022-08-22 16:30:52 +01:00
Janne Valkealahti
9087692999 Next development version 2022-08-19 14:39:33 +01:00
Janne Valkealahti
43ad2d7059 Upgrade spring-boot 2.7.3
- Fixes #500
2022-08-18 10:33:29 +01:00