Skip to content

Commit d3d324d

Browse files
committed
Use seed 3.4.0
1 parent ef76fdd commit d3d324d

6 files changed

Lines changed: 12 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Version 1.0.1 (2017-11-31)
1+
# Version 1.0.1 (2017-11-29)
22

33
* [chg] Update to Seed 3.4.0.
44

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
<parent>
1414
<groupId>org.seedstack.poms</groupId>
1515
<artifactId>parent-internal</artifactId>
16-
<version>3.0.0</version>
16+
<version>3.1.0</version>
1717
</parent>
1818

1919
<groupId>org.seedstack.addons.shell</groupId>
2020
<artifactId>shell</artifactId>
2121
<version>1.0.1-SNAPSHOT</version>
2222

2323
<properties>
24-
<seed.version>3.4.0-SNAPSHOT</seed.version>
24+
<seed.version>3.4.0</seed.version>
2525

26-
<compatibility.skip>true</compatibility.skip>
26+
<compatibility.version>1.0.0</compatibility.version>
2727

2828
<bintray.package>shell-addon</bintray.package>
2929
</properties>

src/main/java/org/seedstack/shell/internal/AbstractShell.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
abstract class AbstractShell implements org.apache.sshd.server.Command, Runnable {
3333
private static final String COMMAND_PATTERN = "([a-zA-Z][a-zA-Z0-9\\-]+:)?[a-zA-Z][a-zA-Z0-9\\-]+";
34+
static final String UTF_8 = "UTF-8";
3435
private final CommandLineParser commandLineParser = new DefaultParser();
3536
InputStream inputStream;
3637
OutputStream outputStream;

src/main/java/org/seedstack/shell/internal/InteractiveShell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class InteractiveShell extends AbstractShell {
5656

5757
@Override
5858
public void start(Environment environment) throws IOException {
59-
errorPrintStream = new PrintStream(errorStream, true);
59+
errorPrintStream = new PrintStream(errorStream, true, UTF_8);
6060

6161
String user = environment.getEnv().get(Environment.ENV_USER);
6262

src/main/java/org/seedstack/shell/internal/NonInteractiveShell.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class NonInteractiveShell extends AbstractShell {
3737

3838
@Override
3939
public void start(Environment env) throws IOException {
40-
outputPrintStream = new PrintStream(outputStream, true);
41-
errorPrintStream = new PrintStream(errorStream, true);
40+
outputPrintStream = new PrintStream(outputStream, true, UTF_8);
41+
errorPrintStream = new PrintStream(errorStream, true, UTF_8);
4242

4343
ses = new SubjectAwareExecutorService(Executors.newSingleThreadExecutor());
4444
ses.submit(this);

src/main/java/org/seedstack/shell/internal/commands/StrCommand.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
* License, v. 2.0. If a copy of the MPL was not distributed with this
66
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
77
*/
8+
89
package org.seedstack.shell.internal.commands;
910

10-
import org.apache.commons.beanutils.BeanUtils;
11-
import org.seedstack.seed.command.Argument;
1211
import org.seedstack.seed.command.Command;
1312
import org.seedstack.seed.command.CommandDefinition;
1413

@@ -17,17 +16,14 @@
1716
*
1817
* @author adrien.lauer@mpsa.com
1918
*/
20-
@CommandDefinition(scope = "", name = "str", description = "Return the argument string")
19+
@CommandDefinition(scope = "", name = "str", description = "Return the argument as a string")
2120
public class StrCommand implements Command {
22-
@Argument(index = 0, description = "The property to get", mandatory = false, defaultValue = "")
23-
private String string;
24-
2521
@Override
2622
public Object execute(Object object) throws Exception {
2723
if (object != null) {
2824
return object.toString();
25+
} else {
26+
return null;
2927
}
30-
31-
return BeanUtils.getProperty(object, string);
3228
}
3329
}

0 commit comments

Comments
 (0)