Commit Graph

600 Commits

Author SHA1 Message Date
Janne Valkealahti
32f77c1917 Rework completion interfaces
- Use same interface type in a generic interactive completions
  in a method level and option value level.
- Change CompletionResolver to have same function signature
  as with options and use CompletionContext to keep
  relevant information.
- Fixes #449
2022-07-06 09:02:06 +01:00
Janne Valkealahti
2520e0681f Rework theme sample
- Rename class and commands.
- Changes mostly to make it easier to test things
  out manually when following theming docs.
- Relates #433
2022-07-04 09:53:50 +01:00
Janne Valkealahti
8fc3ff9c6d Update docs
- Some new docs for theming.
- Relates #433
2022-07-04 09:47:39 +01:00
Janne Valkealahti
5eaa5dd093 Implement interactive completion
- This is a re-implementation of a interactive completion
  with breaking changes as it moves away from a direct use
  of a MethodParameter in favour of a CommandRegistration
  and its option definitions.
- Fixes #449
2022-06-28 14:10:23 +03:00
Janne Valkealahti
341a69e6e0 Add e2e test for command help 2022-06-15 18:47:06 +01:00
Janne Valkealahti
eb2d351b33 Fix native for availability
- Relates to #423
2022-06-15 18:46:20 +01:00
Janne Valkealahti
195d1d00ab Components can't use interactive mode without tty
- Adding a concept of no-tty which in this commit simply
  tracks DumbTerminal as jline creates that if there nothing
  better.
- For components without tty don't go to interaction loop.
- For new sample show that we can at least manually handle
  required option with a flow while command option is not
  required.
- Fixes #444
2022-06-15 09:56:14 +01:00
Janne Valkealahti
a019934169 Update docs
- Document option label
- Relates #433
2022-06-14 21:25:01 +01:00
Janne Valkealahti
088c4267b5 Update docs
- Polish getting started
- Relates #433
2022-06-14 21:07:17 +01:00
Janne Valkealahti
189794b0ef Update docs
- Remove and fix content with wrong links.
- Relates #433
2022-06-14 20:01:52 +01:00
Janne Valkealahti
39c01fe00b Fix availability feature
- Bring back some missing functionality which got missing
  during the rework to new command model.
- Polish some classes.
- Restore origin sample.
- Add availability things into help templates and its
  representation model.
- Fixes #423
2022-06-14 11:51:50 +01:00
Janne Valkealahti
b2f96e679a Fix version template
- Changes done with #442 left a bug where
  `version-default.st` contains wrong formats for styling.
2022-06-13 20:16:03 +01:00
Janne Valkealahti
25721dd63d ConfirmationInput should have resultValue
- Add flow hooks to ConfirmationInput so that user
  is able to pass a flag from an options so that
  component can bypass interactive mode.
- Fixes #445
2022-06-13 09:27:16 +01:00
Janne Valkealahti
073cd8562c Rework themes support
- Add theme settings for figures.
- Settings for styles are now in it own class and
  ThemeSettings are wrapping those.
- Prefixed formatting string to have `style-` prefix.
- Templates can now use added `figures` dictionary which
  is resolved per activated theme.
- Create `dump` theme.
- New `ThemeActive` interface where default impl uses dump
  theme if `CI` or `NO_COLOR` env is set.
- Rework existing templates.
- Fixes #442
2022-06-10 13:56:21 +01:00
Janne Valkealahti
fa65a2308e Support option label
- This adds `label` to `CommandOption` which is then used
  in a Help instead of type.
- Fixes #424
2022-06-08 07:39:44 +01:00
Janne Valkealahti
8548828873 Polish contribution 2022-06-07 18:23:41 +01:00
Yubi Lee
38ce78434a Capturing CTRL+D EOF to exit the shell
* Capturing CTRL+D (EOF) to exit the shell
* replace junit to assertj
* fix hang on testing
2022-06-07 18:20:52 +01:00
Janne Valkealahti
3556352ab3 Fix exit codes
- Fix not to error so that other mappers can be used.
- Relates #431
2022-06-03 12:52:57 +01:00
Janne Valkealahti
fa8693901f Add e2e results
- Going via jest-junit to xml and then with
  publish-unit-test-result-action to publish results.
2022-06-03 09:39:17 +01:00
Janne Valkealahti
5258e00c55 Manage labels 2022-06-02 12:47:30 +01:00
Janne Valkealahti
0e37989a6f e2e test for required option value 2022-06-02 09:58:16 +01:00
Janne Valkealahti
2ba288cb54 Fix ShellOption with required
- Take 2
- Fix case with optional.
- Fixes #436
2022-06-02 09:55:55 +01:00
Janne Valkealahti
f7992a682e Fix ShellOption with required
- Where applicable mark option required so that
  user is notified instead of blindly using null.
- Fixes #436
2022-06-02 08:41:48 +01:00
Janne Valkealahti
0be37d164f Split e2e sample commands 2022-06-02 07:46:43 +01:00
Janne Valkealahti
c2774b9d8f Label workflow 2022-06-01 08:41:35 +01:00
Janne Valkealahti
7201a25567 Make ConversionService customisable
- Add ShellConversionServiceSupplier interface to define
  shell spesific ConversionService so that we don't
  get trouble with other services in boot.
- Fixes #435
2022-05-31 12:58:10 +01:00
Janne Valkealahti
3891a8b375 Add support for exit codes
- New configurations to CommandRegistration
- Re-using exit code concepts from boot
- Handling exit codes only in non-interactive mode
- Adding e2e commands and tests for better coverage
- Fixes #431
2022-05-31 07:49:50 +01:00
Janne Valkealahti
08428c88cb Add timeout to pr workflow 2022-05-30 14:13:20 +01:00
Janne Valkealahti
0fa85cba83 Update boot 2.7.0
- Pump spring-native 0.12.0 as needed by boot 2.7.0
- Fixes #419
2022-05-30 11:10:07 +01:00
Janne Valkealahti
a673310edc Fix tests for win 2022-05-28 08:37:56 +01:00
Jay Bryant
2af4e86925 Editing pass
for a bunch of new content to support the new version.
2022-05-28 08:27:36 +01:00
Janne Valkealahti
9779b5c729 Better errors with non-interactive mode
- Change how errors are printed for interactive
  vs non-interactive mode.
- This now changes behaviour so that stacktrace is printed
  if non-interactive mode is active so that user has a change
  to see the full error.
- Fixes #427
2022-05-27 09:09:21 +01:00
Janne Valkealahti
b194660ffa Set jdk11 if samples are enabled 2022-05-26 08:18:34 +01:00
Janne Valkealahti
5470e29a9c Add spring release repo to samples
- This is to be able to import project without having
  active spring profile. Basically needed for spring-native
  which is not in central.
2022-05-26 07:48:40 +01:00
Janne Valkealahti
bd9ab62013 Rework help command
- Change help command output to get templated using
  model classes.
- Remove things around ParameterDescription as those are
  replaced with template classes.
- Fixes for native configs.
- For now availability and aliases are removed from
  help to get back in better form.
- Aliases has been partly introduced to structure.
- Fixes #422
2022-05-26 07:45:35 +01:00
Janne Valkealahti
eed1d84653 Update docs 2022-05-18 09:44:26 +01:00
Janne Valkealahti
baf8346063 Change help to description in command registration
- Fixes #421
2022-05-18 08:59:57 +01:00
Janne Valkealahti
c7d3eb15b4 Expose CommandRegistration in CommandContext
- Fixes #420
2022-05-18 08:18:38 +01:00
Janne Valkealahti
b119473881 New e2e test 2022-05-18 08:01:24 +01:00
Janne Valkealahti
57f6cff7c6 Convert default value
- Change parser to user conversion service to attempt
  conversion from a default value to an expected type.
- Make more use of shellConversionService bean so that
  we use the one which can be customized.
2022-05-18 08:00:49 +01:00
Janne Valkealahti
6a1158dc12 Make history file path configurable
- UserConfigPathProvider interface to provid "user-level"
  config directory which can be used within a shell.
- New options which can be used to configure behaviour.
  spring.shell.history.enabled
  spring.shell.history.name
  spring.shell.config.location
  spring.shell.config.env
- Fixes #417
2022-05-17 18:29:58 +01:00
Janne Valkealahti
f2d97ae2de Upload surefire reports in manual workflow 2022-05-17 16:14:46 +01:00
Janne Valkealahti
4a05106d86 Add manual build and test workflow 2022-05-17 10:24:15 +01:00
Janne Valkealahti
3a832b1a8e Add e2e readme 2022-05-15 20:04:20 +01:00
Janne Valkealahti
0f655a03ce Add missing headers to snippets 2022-05-15 16:46:42 +01:00
Janne Valkealahti
ac451ad4d0 Schedule e2e tests 3 times per week 2022-05-15 16:37:14 +01:00
Janne Valkealahti
7224ee31de Update e2e tests
- Add new e2e group to samples which can be used
  with particular tests.
- Relates #401
2022-05-15 16:29:48 +01:00
Janne Valkealahti
ee21619885 Update docs 2022-05-15 16:29:23 +01:00
Janne Valkealahti
60e63f87ae Update docs 2022-05-14 17:08:09 +01:00
Janne Valkealahti
ab476345fa Update docs 2022-05-14 16:36:53 +01:00