Commit Graph

84 Commits

Author SHA1 Message Date
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
Janne Valkealahti
85976cff48 Native support for JCommander
- Fixes #340
2022-03-05 08:18:28 +00:00
Janne Valkealahti
c532dc227e Flow system for UI components
- Implement basic flow system with builder patterns
  to easily use components and hook those together
  as a flow.
- Fixes #364
2022-03-03 15:45:02 +00:00
Janne Valkealahti
7b547e53a8 Add dynamic command registration
- Extend CommandRegistry for add/remove methods.
- For rest of shell classes move to use registry
  directly instead of caching commands as registry
  is not immutable anymore.
- Add new sample
- Fixes #379
2022-02-26 09:26:23 +00:00
Janne Valkealahti
114dbeccaa Fix NonInteractiveShellRunner for empty args
- Fix issue when empty args resulted runner to
  think it should handle this scenario effectively
  hijacking interactive mode.
- This bug were added by previous rework on #372
2022-02-22 09:47:20 +00:00
Janne Valkealahti
0a074b37e4 Polish 2022-02-22 08:07:52 +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
f1a93f7476 Polish stringinput when no default value 2022-02-20 08:47:45 +00:00
Janne Valkealahti
240cf2d96d Add new highlight style tag 2022-02-19 13:49:02 +00:00
Janne Valkealahti
544e4aee1d Fix version command attributes
- Now passing version command attributes
  even if those are nulls(not set) as ST
  logs those in a listener as errors while
  it doesn't cause any failures.
- Change all LoggingSTErrorListener methods
  into debug level to limit more noise.
- Fixes #363
2022-02-11 13:47:15 +00:00
Janne Valkealahti
785a9268e3 Add confirmation component
- New ConfirmationInput component
- Add missing native resource config for templates.
- Add sample "component confirmation", use flag --no
  to switch default from yes to no.
- Fixes #366
2022-02-11 10:06:33 +00:00
Janne Valkealahti
2f4209785e StringInput masking
- Add a feature to define a mask character for StringInput
  which help when there's a need to as something sensitive.
- This masks both input and result value.
2022-02-08 10:26:17 +00:00
Janne Valkealahti
e3604a5bc5 Basic UI components
- Add first preliminary model of building and working with
  higher level components.
- Components for text input, path input, single selector and
  multi selector.
- Components renderings are based on ANTLR ST templates while
  there is support for building rendering output manually.
- Add these into sample.
- This is a base of additional work what goes to these components
  and concepts around it.
- Relates #360
2022-02-04 12:58:53 +00:00
Janne Valkealahti
7e2a44f1ce Render group templates with new styles
- Can now render ST group with hardcoded
  main template name
- Add additional style tags
- Add sample to list various styles
2022-02-02 09:28:33 +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
3197c94be7 Switch main from 3.0.0-SNAPSHOT to 2.1.0-SNAPSHOT
- Relates #356
2022-01-28 09:27:06 +00:00
nicolas
91d355cb26 expose words for end users to take some default action
- Fixes #293
- Polished PR #294
2022-01-23 10:06:39 +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
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
d578f28662 Polish 2021-12-24 13:54:41 +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
Janne Valkealahti
f20b71a8c2 Remove unused Parser usage 2021-12-18 16:17:10 +00:00
Janne Valkealahti
ffbd88b860 Update jline 3.21.0
- Fixes #331
2021-12-18 13:38:45 +00:00
汪吉
763fef8e1b remove not use import and add Override and add a miss @Component 2021-12-18 12:46:52 +00:00
Janne Valkealahti
e14f4a3f32 Remove bean cycles
- Shuffle things around into different auto-config and configuration
  classes and use other tricks like ObjectProvider to work around
  boot 2.6.x imposing bean cycle checks.
- This is first set of changes to work around this issue, not
  to make things perfect. Further refactoring work is needed
  making code base more boot 2.x friendly as things are based
  on boot 1.5.x times.
- Fixes #324
2021-12-17 15:32:52 +00:00
Janne Valkealahti
90216bdc32 Switch from BUILD-SNAPSHOT to SNAPSHOT 2021-12-17 14:25:52 +00:00
Janne Valkealahti
5e61ff1315 Polish unused imports 2021-12-11 13:09:00 +00:00
Janne Valkealahti
e30edf2446 Update boot 2.6.1
- Migrate tests to junit5 and assertj as those
  are on a classpath automatically.
- Temporarily use spring.main.allow-circular-references=true
  to allow time for fixes to remove cycles.
2021-12-11 12:57:34 +00:00
Spring Operator
23d99f45eb URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://jcommander.org/apidocs/ (200) with 1 occurrences could not be migrated:
   ([https](https://jcommander.org/apidocs/) result SSLHandshakeException).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://docs.spring.io/spring-framework/docs/current/javadoc-api/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-framework/docs/current/javadoc-api/ ([https](https://docs.spring.io/spring-framework/docs/current/javadoc-api/) result 200).
* http://maven.apache.org/xsd/assembly-2.0.0.xsd with 1 occurrences migrated to:
  https://maven.apache.org/xsd/assembly-2.0.0.xsd ([https](https://maven.apache.org/xsd/assembly-2.0.0.xsd) result 200).
* http://maven.apache.org/xsd/maven-4.0.0.xsd with 12 occurrences migrated to:
  https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200).
* http://repo.spring.io/libs-milestone-local with 2 occurrences migrated to:
  https://repo.spring.io/libs-milestone-local ([https](https://repo.spring.io/libs-milestone-local) result 302).
* http://repo.spring.io/libs-snapshot-local with 2 occurrences migrated to:
  https://repo.spring.io/libs-snapshot-local ([https](https://repo.spring.io/libs-snapshot-local) result 302).
* http://repo.spring.io/release with 1 occurrences migrated to:
  https://repo.spring.io/release ([https](https://repo.spring.io/release) result 302).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/ASSEMBLY/2.0.0 with 2 occurrences
* http://maven.apache.org/POM/4.0.0 with 24 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 13 occurrences
2019-03-26 11:55:46 +01:00
Spring Operator
2ccab80189 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 125 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-26 11:48:12 +01:00
Janne Valkealahti
4f0dc203af Change to next major development version 3.0.0 2018-11-14 09:11:34 +00:00
Bharath Prakash
3f8e8334ba This is an Obvious fix to correct the constant value 2018-05-21 04:29:19 -04:00
Spring Buildmaster
75b9c2c846 [artifactory-release] Next development version 2018-04-25 08:29:26 +00:00
Spring Buildmaster
f39c391342 [artifactory-release] Release version 2.0.1.RELEASE 2018-04-25 08:29:21 +00:00
Eric Bottard
d813888dc7 Allow TAB completion on an empty buffer
Fixes #210
2018-03-26 11:38:26 +02:00
Eric Bottard
a0b2eb005d Implement command interruption via CTRL-C
Fixes #209
2018-03-14 23:25:06 +01:00
Eric Bottard
ea71c3821b Fix capturing CTRL-C to exit the shell.
Fixes #195
2018-01-18 09:40:32 +01:00
Spring Buildmaster
ded7b756b1 [artifactory-release] Next development version 2018-01-16 09:01:03 +00:00
Spring Buildmaster
a6ecde1406 [artifactory-release] Release version 2.0.0.RELEASE 2018-01-16 09:00:58 +00:00
Eric Bottard
f90edd42c4 Make ResultHandlers configuration more explicit
Handle exit as a dedicated case (prevents eg 'exit' commands in scripts to make script quit)
Add an example of custom ApplicationRunner

Fixes #187
Fixes #183

Decouple ApplicationRunners

Make ThrowableResultHandler behave differently in non-interactive mode
2018-01-15 15:59:01 +01:00
Eric Bottard
6e6154a80a Rename conversionService to something else to avoid
initialization cycle issue (Converters were not being wired, etc).

Fixes #180
2017-11-27 16:42:17 +01:00
Eric Bottard
e2c8be2b23 Use getMessage() by default when printing exceptions.
Fixes #176
2017-11-06 15:03:05 +01:00
Eric Bottard
7d50c0813f Qualify the Spring Shell provided ConversionService
Fixes #173
2017-11-06 14:52:50 +01:00
Spring Buildmaster
e917d876e3 [artifactory-release] Next development version 2017-10-04 09:29:34 +00:00
Spring Buildmaster
1bea66cdb1 [artifactory-release] Release version 2.0.0.M2 2017-10-04 09:29:29 +00:00
Eric Bottard
32c65f2da7 Allow usage without Spring Boot AutoConfiguration
Fixes #166
2017-10-04 11:15:01 +02:00