|
1 | 1 | /*
|
2 |
| - * Copyright 2017 the original author or authors. |
| 2 | + * Copyright 2017-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -package org.springframework.shell.jline; |
| 17 | +package org.springframework.shell.boot; |
18 | 18 |
|
19 | 19 | import java.io.IOException;
|
20 |
| -import java.util.List; |
21 |
| -import java.util.stream.Collectors; |
22 | 20 |
|
23 | 21 | import org.jline.reader.Parser;
|
24 | 22 | import org.jline.terminal.Terminal;
|
|
30 | 28 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
31 | 29 | import org.springframework.context.annotation.Bean;
|
32 | 30 | import org.springframework.context.annotation.Configuration;
|
| 31 | +import org.springframework.shell.jline.ExtendedDefaultParser; |
| 32 | +import org.springframework.shell.jline.PromptProvider; |
33 | 33 |
|
34 | 34 | /**
|
35 | 35 | * Shell implementation using JLine to capture input and trigger completions.
|
@@ -63,16 +63,4 @@ public Parser parser() {
|
63 | 63 | parser.setEofOnEscapedNewLine(true);
|
64 | 64 | return parser;
|
65 | 65 | }
|
66 |
| - |
67 |
| - /** |
68 |
| - * Sanitize the buffer input given the customizations applied to the JLine parser (<em>e.g.</em> support for |
69 |
| - * line continuations, <em>etc.</em>) |
70 |
| - */ |
71 |
| - static List<String> sanitizeInput(List<String> words) { |
72 |
| - words = words.stream() |
73 |
| - .map(s -> s.replaceAll("^\\n+|\\n+$", "")) // CR at beginning/end of line introduced by backslash continuation |
74 |
| - .map(s -> s.replaceAll("\\n+", " ")) // CR in middle of word introduced by return inside a quoted string |
75 |
| - .collect(Collectors.toList()); |
76 |
| - return words; |
77 |
| - } |
78 | 66 | }
|
0 commit comments