Commit Graph

712 Commits

Author SHA1 Message Date
Janne Valkealahti
b98cb4926d Fix typo
- Relates #579
2022-12-08 10:02:46 +00:00
Janne Valkealahti
83e906d2e7 Document writing to console
- Relates #579
2022-12-08 09:51:59 +00:00
Janne Valkealahti
e5570ae62c Add search algo docs
- Relates #579
2022-12-06 09:00:24 +00:00
Janne Valkealahti
74c04a4964 Polish getting started
- Relates #579
2022-12-05 13:59:37 +00:00
Janne Valkealahti
f5d6bae117 Handle option void type
- 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
2022-12-05 09:30:06 +00:00
Janne Valkealahti
ef191e66f3 Add support for global help options
- 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
2022-12-04 17:23:25 +00:00
Janne Valkealahti
b555148ce9 Fix assert in flow e2e test
- Fix assert by checking plain ">" if env CI variable is not set.
- Fixes #576
2022-11-30 17:27:48 +00:00
Janne Valkealahti
0899d414de Build linux sample with musl
- 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
2022-11-30 15:39:10 +00:00
Janne Valkealahti
d3e897f6d9 Add base shell test system
- 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
2022-11-30 09:09:35 +00:00
Janne Valkealahti
2bfcf99e96 Make Terminal configurable
- Add TerminalCustomizer which can be used to customise
  TerminalBuilder before instance from it is build.
- Fixes #516
2022-11-29 12:21:24 +00:00
Janne Valkealahti
452145264a 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.
- Fixes #575
2022-11-26 15:08:07 +00:00
Janne Valkealahti
a900fa4977 Fix e2e tests
- Due to changes in #567 e2e tests started to fail as
  args where passed with spaces instead of args array.
- Fix all args use so that spawn underneath uses
  plain array with proper args.
2022-11-25 09:03:20 +00:00
Janne Valkealahti
a6b84372b2 Upgrade spring-boot 3.0.0
- Fixes #574
2022-11-24 17:56:30 +00:00
Janne Valkealahti
331df77ed8 More docs for option types
- Relates #558
2022-11-23 09:28:55 +00:00
Janne Valkealahti
61ae11bf94 Method execution should not error without value
- Do npe check when getting class type out from
  incoming value.
- Fix #572
2022-11-22 07:47:52 +00:00
Janne Valkealahti
ee7a9da4aa Fix warnings
- Fix some potential NPE cases.
- Fix warnings for missing @Nullable
2022-11-19 15:08:49 +00:00
Janne Valkealahti
83fb5f71fc 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.
- Fixes #567
2022-11-18 07:26:37 +00:00
Janne Valkealahti
57fac23bfc Upgrade graal 22.3 in workflows 2022-11-16 07:04:13 +00:00
Janne Valkealahti
217b9b7079 Use @AutoConfiguration
- Replace from @Configuration to @AutoConfiguration as that is now
  recommended by boot.
- Fixes #565
2022-11-15 08:30:17 +00:00
Janne Valkealahti
d39276908d Upgrade spring-boot 3.0.0-RC2
- Fixes #568
2022-11-15 08:14:07 +00:00
Janne Valkealahti
ef7d97f2e1 Move built-in commands from components to commands
- Relates #558
2022-11-01 05:11:33 +00:00
Janne Valkealahti
2427ec36a1 Docs about logging
- Relates #558
2022-11-01 05:00:41 +00:00
Janne Valkealahti
c6e84dcfa8 Docs about debugging
- Just linking to wiki
- Relates #558
2022-10-31 07:41:01 +00:00
Janne Valkealahti
ff41b504a7 Docs about shell runners
- Relates #558
2022-10-31 05:35:34 +00:00
Janne Valkealahti
2a3856c101 Polish appendix naming
- Relates #558
2022-10-30 06:44:50 +00:00
Janne Valkealahti
a518414015 Registration section
- Move bean/anno sections here
- Relates #558
2022-10-30 05:43:44 +00:00
Janne Valkealahti
bec85188aa Make assertj dependency optional
- Fixes #561
2022-10-23 12:12:08 +01:00
Janne Valkealahti
ea76e0d205 Change native build
- Align samples build with docs
- Relates #558
2022-10-22 06:45:02 +01:00
Janne Valkealahti
46505e8b72 Polish 2022-10-22 06:17:24 +01:00
Janne Valkealahti
092a169fce Polish 2022-10-21 12:29:47 +01:00
Janne Valkealahti
3e0ca620ea Upgrade spring-boot 3.0.0-RC1
- Fixes #557
2022-10-21 12:16:40 +01:00
Janne Valkealahti
b215705d49 Fix line split logic
- Fix issues where shows patsh were not correctly truncated
- Relates #556
2022-10-21 11:59:23 +01:00
Janne Valkealahti
7866c9666d Base docs for PathSearch
- Relates #555
2022-10-19 08:12:12 +01:00
Janne Valkealahti
4bab975ecf Add PathSearch component
- 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
2022-10-19 06:44:11 +01:00
Janne Valkealahti
267c0e6fa4 Update labels 2022-10-18 15:00:52 +01:00
Janne Valkealahti
3021704c29 Support hidden commands
- 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
2022-10-18 14:51:44 +01:00
Janne Valkealahti
feba345f00 Component text can be truncated
- 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
2022-10-14 17:16:51 +01:00
Janne Valkealahti
4c48017a97 Implement more flexible error handling
- 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
2022-10-14 10:55:05 +01:00
Janne Valkealahti
3fe26025cd 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.
- Fixes #548
2022-10-14 06:33:44 +01:00
Janne Valkealahti
df45b625c7 Update labels 2022-10-06 13:07:46 +01:00
Janne Valkealahti
226b081c1c Upgrade native-build-tools 0.9.14
- Update docs
- Fixes #540
2022-10-03 09:20:49 +01:00
Janne Valkealahti
e02503ef3f Update milestone workflow
- Relates #535
2022-09-28 17:52:48 +01:00
Janne Valkealahti
3660d61609 Upgrade spring-boot 3.0.0-M5
- Fixes #523
2022-09-23 09:22:24 +01:00
Janne Valkealahti
23df374660 Migrate auto-configuration registration
- Move auto-configs from spring.factories to imports file.
- Relates #523
2022-09-22 16:17:25 +01:00
Janne Valkealahti
a1bd979548 Link to logging section
- Relates #527
2022-09-15 09:41:19 +01:00
Janne Valkealahti
f9de69347b Add graal build instructions
- Relates #527
2022-09-15 09:37:06 +01:00
Janne Valkealahti
0ef394c47e Add notes about logging
- Relates #527
2022-09-14 15:30:54 +01:00
Janne Valkealahti
6f220e2ea4 Fix deprecation in aot hints 2022-09-14 15:11:01 +01:00
Janne Valkealahti
15f03b358f Rework getting started section
- With build add feature to resolve dep versions which
  can be used in docs.
- More polished maven/gradle example.
- Relates #527
2022-09-14 09:09:25 +01:00
Janne Valkealahti
754e00d0ae Add Automatic-Module-Name to jar manifest
- Basically doing same what framework/boot does for jar manifests.
- Copied gradle settings from boot which gives us dot format like
  Automatic-Module-Name: spring.shell.core
- Fixes #529
2022-09-13 09:26:42 +01:00