Replies: 1 comment 1 reply
-
Looks like you're missing argument name like in |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am brand new to Spring Shell, so it might well be a simple newbie issue... but I am struggling to get command options to work.
Using annotations I can get them to work for simple cases as long as I do not specify a longname (have not tried shortnames). This works, in a way:
t1 hello
printsT1: You passed in: 'hello'
- unexpected, but OK?t1 --myParam hello
printsT1: You passed in: 'hello'
- works as expectedt1 --userIsMistaken hello
printsT1: You passed in: '--userIsMistaken'
- not OK, expected error due to unknown named optionAs soon as I add a longname to the option parameter like so
I cannot get it to accept the option value at all. All call flavors of
t1
executed fort2
plust2 --alongname hello
printT2: You passed in: 'null'
Calling
help t2
also does not list the option:Using
CommandRegistration
and calling a POJO method I have not managed to communicate an option value at all. E.g.with the
echo
method defined like so in a POJO (no shell annotations present at all)always yields
You passed in: 'null'
.Can someone point out where I am going wrong here?
Spring Shell version
2.1.0
Spring Boot version
2.7.2
Java version
11
I am using the plain vanilla project as it is generated by start.spring.io with
Spring Shell
as the only dependency.Thanks!
Ralf
Beta Was this translation helpful? Give feedback.
All reactions