Commit Graph

831 Commits

Author SHA1 Message Date
Janne Valkealahti
d053fab383 Expose column and row min setting in GridView
- Add method setMinSize for setting minimum width for columns
  and minimum height for rows.
- Relates #805
2023-07-16 18:13:39 +01:00
Janne Valkealahti
3ac48bf15a Add missing GridView tests
- Add some new tests and reorg into nested model.
- Relates #805
2023-07-16 13:33:21 +01:00
Janne Valkealahti
a0bdbfc033 Initial terminal ui implementation
- This commit adds proof of concept work for terminal ui as is.
- Some things work, some don't but we need to start from somewhere.
  Further development continues in a main.
- Essentially we are starting to have enough so that it merits to
  move all this work into a main repo.
- Everything new is kept under org.springframework.shell.component.view
  and will get revisiter later to find correct locations for some classes.
- Catalog sample has been modified to provide "showcase" app for
  terminal ui features. This is a start while it already contains
  some usefull scenarios.
- Relates #800
- Relates #801
- Relates #802
- Relates #803
- Relates #804
- Relates #805
- Relates #806
- Relates #807
- Relates #808
- Relates #809
- Relates #810
- Relates #811
2023-07-15 16:42:39 +01:00
Janne Valkealahti
da04202822 Modify gitignore 2023-07-15 16:24:46 +01:00
Janne Valkealahti
625619fc92 Add primary command sample
- New spring-shell-sample-catalog which is a skeleton meant for
  future view overhaul work.
- Relates #755
2023-07-05 10:35:30 +01:00
Janne Valkealahti
6fd1a1c78a Add primary command docs
- Relates #755
2023-07-05 10:34:17 +01:00
Janne Valkealahti
32675c5e73 Add primary command feature
- NonInteractiveShellRunner can now shortcircuit into primary command
  just running it and passing args.
- Add hooks into autoconfig so that this is easy to configure.
- Relates #755
2023-07-05 10:33:55 +01:00
Janne Valkealahti
4ee1907f00 Add run-name to release workflow 2023-06-27 07:42:31 +01:00
Janne Valkealahti
770d4e373c Add timeout for native build 2023-06-26 13:07:42 +01:00
Janne Valkealahti
34aa01a21d Fix e2e workflow 2023-06-26 09:40:49 +01:00
Janne Valkealahti
49a791a0fa Fix e2e workflow 2023-06-26 07:28:19 +01:00
Janne Valkealahti
df40964e7b Document CommandNotFoundMessageProvider
- Relates #778
2023-06-23 06:30:30 +01:00
Janne Valkealahti
304566becd Add run-name for e2e 2023-06-23 05:45:05 +01:00
Janne Valkealahti
cdd703efa4 Fix alias usage with Command annotation
- Fix alias command extraction from existing @Command
  annotations so that we actually get multiple aliases
  defined if more than one defined on a method level.
- Fix rendering issue in a help stg template when
  multiple aliases exists.
- Fixes #796
2023-06-22 16:00:00 +01:00
Janne Valkealahti
811f1f9a55 Fix parser handling of positional args
- Change to have better support for args like:

    "--arg1 a --arg2 b"
    "--arg1 a --arg2 b c"
    "--arg1 a c --arg2 b c"
    "c --arg1 a --arg2 b"

  where option can have default values and position of
  positional args doesn't matter that much.
- Make parser to be aware of if it's handling last option
  so that we can differentiate if error can be given i.e.
  with too many args, etc.
- Fixes #795
2023-06-22 09:46:01 +01:00
Janne Valkealahti
9ef509a4da Make command not found configurable
- New CommandNotFoundResultHandler which handles
  CommandNotFound to be able to customize error shown.
- New CommandNotFoundMessageProvider which is a plain
  function given a "context" and returns a string.
  Context contains common info to provide better
  error messages.
- Default provider gives same message but
  removes long stacktrace(which previously originated
  from a common ThrowableResultHandler.
- Relates #778
2023-06-20 11:31:19 +01:00
Janne Valkealahti
38f9126aeb Add better support for modified option names
- Longnames in a command option if modified via
  name modifier didn't provide enough backmapping
  info for command execution experience being accurate.
- Add new getLongNamesModified() into CommandOption
  which is populated if name modifier is used.
- Add more hints in CommandExecution for modified
  option names.
- This should bring annotation, legacy annotation
  and programmatic commands up to date.
- Fixes #777
2023-06-19 12:30:29 +01:00
Janne Valkealahti
c27b85fb0e Split sample app
- spring-shell-sample-commands and spring-shell-sample-e2e
- Needed changes in e2e tests and workflow
- Fixes #754
2023-06-15 10:49:52 +01:00
Janne Valkealahti
71ed64670f Schedule 3.1.x e2e 2023-06-15 07:21:04 +01:00
Janne Valkealahti
7381095741 Start working on Spring Shell 3.2 2023-06-14 16:23:27 +01:00
Janne Valkealahti
7e634bb80e Polish 2023-06-13 15:45:38 +01:00
github-actions[bot]
e8443486c3 Next development version 2023-06-13 13:29:18 +00:00
Janne Valkealahti
3d39ef3518 Discard empty args
- Take 2 of #763
- Revert changes in 06e89dcca3
  what comes for `ExtendedDefaultParser`.
- Discard empty args in a `Shell` coming from `ExtendedDefaultParser`
- `ExtendedDefaultParserTests` has more tests, some commented out, to
  see some differences for jline default parser impl. Something
  to get handled in #517
2023-06-12 10:12:52 +01:00
Janne Valkealahti
042d56e7e3 Add HandlerMethodArgumentResolver for @Option
- New OptionMethodArgumentResolver which is similar
  than ShellOptionMethodArgumentResolver for @ShellOption.
- Add missing annotation commands for e2e test command.
- Fixes #767
2023-06-07 15:28:57 +01:00
Janne Valkealahti
afacf86ac5 Add jna native hints for linux
- Need for libjnidispatch.so, CLibrary$termios
  and CLibrary$winsize.
- Fixes #762
2023-06-07 14:13:35 +01:00
Janne Valkealahti
06e89dcca3 ExtendedDefaultParser should not add empty arguments
- Fixes issue when last "word" is within quotes and
  cursor is at the end of a line which caused empty
  "word" string in an argument list.
- This then caused i.e. string option to have a collection
  as an input(if no arity settings used) and via
  spring conversions a comma were added.
- Fixes #763
2023-06-07 08:28:17 +01:00
Janne Valkealahti
58e3a5eec6 Add central close workflow 2023-06-05 12:14:08 +01:00
Janne Valkealahti
1e68e3ed65 Update labels 2023-06-02 15:36:45 +01:00
Janne Valkealahti
65ef14856e Update schedule-e2e workflow 2023-06-02 06:29:34 +01:00
Janne Valkealahti
36712e4ac2 Update schedule-e2e workflow 2023-06-02 06:25:34 +01:00
Janne Valkealahti
f2a48a061d Test help command with e2e tests
- Fixes #756
2023-06-02 06:19:12 +01:00
Janne Valkealahti
af34526e82 Add hints for Availability targets
- Annotate ShellComponent with @Reflective and use custom
  AvailabilityReflectiveProcessor to find possible method
  targets returning Availability.
- Fixes #747
2023-06-01 21:17:29 +01:00
Janne Valkealahti
f6f979a04c Update e2e readme 2023-06-01 09:08:16 +01:00
Janne Valkealahti
f2240a2c5e Schedule e2e in main and 3.0.x 2023-06-01 08:43:31 +01:00
Janne Valkealahti
c125c46010 Add short options into valid tokens
- Add short options as valid tokens in a `CommandModel` so that Lexer
  create tokens with accurate info and doesn't then cascade this issue
  in Ast and Parser.
- Previously with a command `command -a aaa -b bbb` tokenisation resulted
  `COMMAND OPTION ARGUMENT ARGUMENT ARGUMENT` with multiple short options
  while it should have been `COMMAND OPTION ARGUMENT OPTION ARGUMENT`.
- Relates #757
2023-05-31 17:28:21 +01:00
Janne Valkealahti
8cba636fdb Remove unused ci-publish workflow 2023-05-28 16:33:31 +01:00
Janne Valkealahti
96ef260d1e Update labels 2023-05-25 20:57:35 +01:00
github-actions[bot]
26746254a5 Next development version 2023-05-25 15:58:16 +00:00
Janne Valkealahti
812997f3a8 Add central manual release workflow 2023-05-25 15:01:00 +01:00
Janne Valkealahti
b63aab08a9 Add input into ConfirmationInput
- Now displaying what user actually inputs
- Fixes #740
2023-05-20 17:20:46 +01:00
Janne Valkealahti
8bed75ad77 Support plain boolean without option annotations
- Fix so that we can have `boolean arg` without using
  `@Option` or `@ShellOption` defaulting to false.
- Fixes #744
2023-05-20 14:49:21 +01:00
Janne Valkealahti
96402a79b6 Upgrade spring-boot 3.1.0
- Fixes #743
2023-05-19 08:30:48 +01:00
Janne Valkealahti
8e05aa97ca Upgrade spring-boot 3.1.0-RC2
- Fixes #733
2023-05-05 15:36:34 +01:00
Janne Valkealahti
7f9efd1374 Fix docs for option label
- Relates #732
2023-05-01 17:27:05 +01:00
Janne Valkealahti
a0ad3ad797 Support label with @Option
- Add `label` field into `@Option`. This sets option label if
  `label` field has any text.
- Fixes #732
2023-05-01 17:11:03 +01:00
Janne Valkealahti
755cf66350 Update annotation docs
- Relates #637
2023-05-01 09:25:23 +01:00
Janne Valkealahti
9d27466c6a Support explicit arity min max with @Option
- @Option now has arityMin/arityMax which if defined,
  non-negative, are used instead of arity.
- Fixes #731
2023-05-01 08:36:41 +01:00
Janne Valkealahti
c36aa41878 Use tabs in samples
- Use tabbing model from a new docs backend.
- Relates #637
2023-05-01 08:29:37 +01:00
Janne Valkealahti
6db122a498 Upgrade jline 3.23.0
- Fixes #725
2023-04-28 17:47:54 +01:00
Janne Valkealahti
0724523e78 Upgrade spring-boot 3.1.0-RC1
- Upgrade gradle 7.6.1 due to https://github.com/gradle/gradle/issues/24390
- Fixes #717
2023-04-28 14:52:22 +01:00