Commit Graph

826 Commits

Author SHA1 Message Date
Janne Valkealahti
1caeacfb9c Upgrade spring-boot 3.1.2
- Fixes #819
2023-07-20 14:48:57 +01:00
Janne Valkealahti
9531504261 Polish error messages
- Polish mandatory option message by using
  same format as in 3.0.x. (old parser)
- Remove prefixed code/position parts from
  all messages coming from a parser. (new parser)
- Backport #815
- Fixes #816
2023-07-19 08:12:54 +01:00
Janne Valkealahti
d86bfed773 Add primary command docs
- Backport #755
- Relates #799
2023-07-07 14:05:46 +01:00
Janne Valkealahti
051f7da5dc 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.
- Backport #755
- Relates #799
2023-07-07 14:05:05 +01:00
github-actions[bot]
f388a30716 Next development version 2023-06-27 07:26:26 +00:00
Janne Valkealahti
3cfe03b25d Add run-name to release workflow 2023-06-27 07:42:40 +01:00
Janne Valkealahti
8b6e040f5e Add timeout for native build 2023-06-26 13:09:12 +01:00
Janne Valkealahti
4376b1dece Document CommandNotFoundMessageProvider
- Relates #793
2023-06-23 06:31:44 +01:00
Janne Valkealahti
4aecebd542 Add run-name for e2e 2023-06-23 05:45:02 +01:00
Janne Valkealahti
d36b9d83fc Upgrade spring-boot 3.1.1
- Fixes #786
2023-06-22 16:41:23 +01:00
Janne Valkealahti
ff60039c85 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.
- Backport #796
- Fixes #798
2023-06-22 16:37:06 +01:00
Janne Valkealahti
0edf4eb450 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.
- Backport #795
- Fixes #797
2023-06-22 09:53:59 +01:00
Janne Valkealahti
d1592456a5 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.
- Backport #778
- Relates #793
2023-06-20 12:33:54 +01:00
Janne Valkealahti
ee94ba37ef 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.
- Backport #777
- Fixes #783
2023-06-19 12:38:51 +01:00
Janne Valkealahti
641aee4411 Prepare maintenance branch for 3.1.x 2023-06-14 16:22:08 +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
Janne Valkealahti
2cc7f8ec39 Migrate docs to spring-asciidoctor-backends
- Use io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.5
- As this relates to anon repo access, use ge conventions from
  public repos and fix some other used repos.
- Fixes #722
2023-04-28 13:36:09 +01:00
Janne Valkealahti
1c73ca4f73 Revert to spring-boot 3.1.0-M1
- Relates #717
2023-04-28 13:15:56 +01:00
Janne Valkealahti
2d714c04cf Upgrade spring-boot 3.1.0-RC1
- Fixes #717
2023-04-27 20:48:40 +01:00
Janne Valkealahti
fa1adeaa82 Disable tests with manual build 2023-04-10 17:56:17 +01:00
Janne Valkealahti
0f5f5e0ca7 Upload buildlogs with failure in e2e tests 2023-04-10 16:27:41 +01:00