Commit Graph

44 Commits

Author SHA1 Message Date
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
0a074b37e4 Polish 2022-02-22 08:07:52 +00:00
Janne Valkealahti
7746e571b6 Fix version command due to recent rework 2022-02-20 14:44:43 +00:00
Janne Valkealahti
5ff98290e9 Add more beans to AbstractShellComponent
- Add more common stuff like ResourceLoader, TemplateExecutor,
  ThemeResolver.
- Make class abstract.
- Expose more with sub-classes.
2022-02-18 13:07:08 +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
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
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
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
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
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
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
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
5d13c5f47a Add history command
Fixes #208
2018-03-14 22:18:41 +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
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
f0e5c45ee9 Add automatic command grouping
Fixes #163

Introduce Command and Command.Help
2017-09-28 09:44:48 +02:00
Roland Weisleder
e4e6471f27 Add command group and group output of help command
Resolves #135
2017-09-23 15:36:11 +02:00
Roland Weisleder
b21a1f16f1 Set assumed locale for HelpTest
Otherwise the test would fail on machines with other default than EN.
2017-09-23 15:34:57 +02:00
Spring Buildmaster
425493e0a9 [artifactory-release] Next development version 2017-09-14 14:29:28 +00:00
Spring Buildmaster
ccd2444b1e [artifactory-release] Release version 2.0.0.M1 2017-09-14 14:29:24 +00:00
Eric Bottard
4a6c699aca Inject the ValidatorFactory instead of Validator.
This prevents the Spring Validator Factory from being injected (it
does not support the 1.1 methods)
2017-09-11 17:16:43 +02:00
Eric Bottard
32c18bec75 Document bean validation constraints in help()
Fixes #147
2017-09-08 16:38:42 +02:00
Eric Bottard
9f88c03cf3 Add ability to run commands and exit 2017-08-30 16:54:36 +02:00
Eric Bottard
56adc9ab5a Write tutorial in ref doc 2017-08-23 21:09:40 +02:00
Eric Bottard
1eea04ad2f Add dynamic command availability
Introduce availability concept on MethodTarget (with reason if not available)
Add bridge to @CliAvailabilityIndicator to Legacy registrar

Fixes #138

Add help for unavailable commands

Add standard API for availability
2017-08-23 18:44:31 +02:00
Eric Bottard
ff3153c419 Add script command.
Also: prepare for execute-then-quit.
Add javadocs
2017-08-11 17:28:30 +02:00
Eric Bottard
136ab89678 Rework prefix handling 2017-08-10 15:34:38 +02:00
Eric Bottard
5b07a1a89c Rename ShellMethod.help() to value(), as it is the only mandatory attribute. 2017-08-10 11:13:13 +02:00
Eric Bottard
78f69d51e2 Fix build 2017-08-10 10:34:38 +02:00
Eric Bottard
a7d9ababa0 Move InputProvider to top-level 2017-08-09 17:43:46 +02:00
Eric Bottard
0ca3dacdce Allow overrides of standard commands 2017-08-08 11:52:32 +02:00
Eric Bottard
c8e4752119 Prevent double registration of commands 2017-08-08 11:52:32 +02:00
Eric Bottard
6497df181d Refactor packages and artifactIds to prepare for official migration to spring-projects repo.
Remove usage of component scan in favor of auto-conf

Fixes #61
2017-08-08 11:52:32 +02:00