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
This commit is contained in:
committed by
GitHub
parent
eed1d84653
commit
bd9ab62013
@@ -36,9 +36,6 @@ import org.springframework.nativex.type.NativeConfiguration;
|
||||
resources = {
|
||||
@ResourceHint(
|
||||
patterns = {
|
||||
"completion/.*",
|
||||
"template/.*.st",
|
||||
"org/springframework/shell/component/.*.stg",
|
||||
"com/sun/jna/win32-x86-64/jnidispatch.dll"
|
||||
}
|
||||
),
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.shell.samples.standard;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.shell.command.CommandRegistration;
|
||||
import org.springframework.shell.standard.ShellComponent;
|
||||
import org.springframework.shell.standard.ShellMethod;
|
||||
|
||||
@ShellComponent
|
||||
public class AliasCommands {
|
||||
|
||||
@ShellMethod(key = { "alias anno main1", "alias anno main2" }, group = "Alias Commands")
|
||||
public String annoMain1() {
|
||||
return "Hello annoMain1";
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommandRegistration regMain1() {
|
||||
return CommandRegistration.builder()
|
||||
.command("alias", "reg", "main1")
|
||||
.group("Alias Commands")
|
||||
.withAlias()
|
||||
.command("alias", "reg", "main2")
|
||||
.group("Alias Commands")
|
||||
.and()
|
||||
.withTarget()
|
||||
.function(ctx -> {
|
||||
return "Hello regMain1";
|
||||
})
|
||||
.and()
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,8 @@ spring:
|
||||
history:
|
||||
name: spring-shell-samples-history.log
|
||||
command:
|
||||
help:
|
||||
grouping-mode: group
|
||||
completion:
|
||||
root-command: spring-shell-samples
|
||||
## disable console logging
|
||||
|
||||
Reference in New Issue
Block a user