Commit Graph

17 Commits

Author SHA1 Message Date
Janne Valkealahti
4e625feb03 Drop jcommander
- Fixes #395
2022-04-29 15:55:21 +01:00
Janne Valkealahti
412053d414 Change bean name
- To not clash with exchangeStrategiesCustomizer bean name from boot
  change it to shellCommonComponentFlowCustomizer.
- This was a typical copy/pasting mistake.
2022-03-09 08:41:42 +00:00
Janne Valkealahti
30e7c4d370 Add auto-config for ComponentFlow
- ComponentFlowAutoConfiguration which creates a builder bean
  and configures ComponentFlowCustomizer to set needed
  defaults for terminal, resource loader and template executor.
- Fixes #387
2022-03-05 09:37:27 +00:00
onobc
5f447aa831 Add support for multiple non-interactive commmands
Also:
* Rename ThemeResolver bean to avoid clash w/ Spring Boot registered ThemeResolver
* Move shell runner precedence to public static field to allow extension/access
2022-02-21 08:47:07 +00:00
Janne Valkealahti
9ec5ffa9e0 Make grouping configurable in build-in help
- New option spring.shell.command.help.grouping-mode which can be either flat/group.
- Build-in help command can now choose if to group command or just show flat list.
- Fixes #347
2022-02-01 14:42:46 +00:00
Chris Bono
0efd71aea2 Add non-interactive shell runner customizer
- Add non-interactive shell runner customizer
- Update javadoc for DefaultApplicationRunner
- Rename DefaultApplicationRunner
- Formatting
2022-02-01 14:40:57 +00:00
Janne Valkealahti
9d7a345fff Add missing boot configuration processor 2022-01-28 16:17:37 +00:00
Janne Valkealahti
3197c94be7 Switch main from 3.0.0-SNAPSHOT to 2.1.0-SNAPSHOT
- Relates #356
2022-01-28 09:27:06 +00:00
Janne Valkealahti
52ff4a2d85 Add version command
- Add new styling system which works around concept that
  you use tags to request jline styles where tags comes
  from an activated theme.
- There is a default theme with options to add custom
  ones and change it via property.
- Add templating system which uses antlr stringtemplate which
  allows to write output with a template instead of manually
  crafting code.
- Add version command which integrates to Boot's BuildProperties
  and GitProperties. Only version field is visible on default
  and others can be enabled/disable via properties.
- Fixes #352
- Fixes #353
2022-01-23 09:23:16 +00:00
Janne Valkealahti
dbe8a8b408 Separate interactive and non-interactive commands
- Add new ShellContext concept which now is just a way
  to stash info about interaction mode where ShellRunner
  can update supported mode.
- ShellMethod has a new field interactionMode which user
  can use to define commands between interactive/non-interactive
  modes which then prevents CommandRegistry to show
  commands at runtime.
- Fixes #345
2022-01-09 14:15:47 +00:00
Janne Valkealahti
3cb3309d68 Rename ShellRunner classes 2022-01-08 09:34:59 +00:00
Janne Valkealahti
668ddb458e Completion command for bash
- Add basic support of defining a command `completion bash` which
  outputs a generic bash script which can be used in a user environment.
- Idea for completion is copied from go's cobra library what comes for
  a bash dance itself.
- Goes through command registry, builds a model for command structure
  and uses antlr st4 for templating bash.
- Should give foundation to create other completions just like in cobra.
- Currently as we don't know a root-command in a generic way, option
  `spring.shell.command.completion.root-command` is required user to set.
- Fixes #343
2022-01-07 10:02:51 +00:00
Janne Valkealahti
7298b2ce78 Support for non-interactive shell commands
- Add support for running shell commands as a non-interactive mode.
- This works by adding new ShellApplicationRunner interface which is
  an extension to ApplicationRunner forcing to have exactly one main
  ApplicationRunner and then DefaultApplicationRunner dispatches to
  new interface ShellRunner which allows to pick between script,
  interactive and non-interactive, etc.
- It is sort of a breaking change but works much better not having
  a need to have previous hooks between application runners to disable
  things at runtime.
- All this makes it closer for a user to have a choice between
  using shell commands as is without entering interactive mode.
- Also add SpringShellProperties for better config props support
  for boot users.
- Fixes #342
2021-12-31 15:30:52 +00:00
Janne Valkealahti
7042d1f83b Rework shellConversionService
- Replace old ConversionService impl with something more aligned
  with current boot code with partially shameless copy as
  shell is most likely working outside of web or webflux env
  by creating FormattingConversionService and hooking convertes
  from DefaultConversionService.
- This should work on most cases and giving user a hook
  to define their own service.
2021-12-24 15:04:40 +00:00
Janne Valkealahti
f6394a4531 Rework bean handling
- Lot of rework to move better model to work around bean cycles
- Remove use of @Lazy
- Move StandardAPIAutoConfiguration to autoconfig package
- Remove some of a direct ObjectProvider use in constructors
- Adds spring-native support with most of a things working out of a box
- Relates #324
- Relates #329
- Relates #323
2021-12-24 08:50:40 +00:00
Janne Valkealahti
d883e0e660 Introduce ResultHandlerService
- Replace main use of ResultHandler with ResultHandlerService which is
  a framework type of impl for handlers found from conversion service.
  This handles types better and easier to handle with bean cycles, etc.
- Removed IterableResultHandler to think about these use cases later
  when further refactoring is done.
- TypeHierarchyResultHandler is removed and better functionality now
  via ResultHandlerService.
- Relates #336
2021-12-21 18:11:13 +00:00
Janne Valkealahti
5dcdc4c185 Extract autoconfig
- Create separate spring-shell-autoconfigure and keep
  all autoconfig features there.
- Fixes #329
2021-12-19 12:38:41 +00:00