Skip to content

Commit a600a16

Browse files
committed
Revert "#1346 Add pathCompletionTypes attribute to CommandLine"
This reverts commit b9fdd69.
1 parent 2b81864 commit a600a16

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/main/java/picocli/CommandLine.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ public class CommandLine {
150150
private final Tracer tracer = new Tracer();
151151
private CommandSpec commandSpec;
152152
private final Interpreter interpreter;
153-
private final Set<String> pathCompletionTypes = new HashSet<String>();
154153
private final IFactory factory;
155154

156155
private Object executionResult;
@@ -230,12 +229,6 @@ private CommandLine(Object command, IFactory factory, boolean userCalled) {
230229
if (userCalled) { this.applyModelTransformations(); }
231230
commandSpec.validate();
232231
if (commandSpec.unmatchedArgsBindings().size() > 0) { setUnmatchedArgumentsAllowed(true); }
233-
registerDefaultPathCompletionTypes();
234-
}
235-
236-
private void registerDefaultPathCompletionTypes() {
237-
pathCompletionTypes.add("java.io.File");
238-
pathCompletionTypes.add("java.nio.file.Path");
239232
}
240233

241234
/** Apply transformers to command spec recursively. */
@@ -260,8 +253,6 @@ private CommandLine copy() {
260253

261254
result.interpreter.converterRegistry.clear();
262255
result.interpreter.converterRegistry.putAll(interpreter.converterRegistry);
263-
result.pathCompletionTypes.clear();
264-
result.pathCompletionTypes.addAll(pathCompletionTypes);
265256
return result;
266257
}
267258

@@ -3286,39 +3277,6 @@ public <K> CommandLine registerConverter(Class<K> cls, ITypeConverter<K> convert
32863277
return this;
32873278
}
32883279

3289-
/**
3290-
* <p>Adds the type {@code type} to the list of supported type for path completion.</p>
3291-
* <p>Built-in supported types being:
3292-
* <ul>
3293-
* <li>{@link java.io.File}</li>
3294-
* <li>{@link java.nio.file.Path}</li>
3295-
* </ul>
3296-
* </p>
3297-
* type {@code type}.
3298-
* @param type the type to check if path completion is supported for
3299-
* @return this CommandLine object, to allow method chaining
3300-
* @see #supportsPathCompletion(Class)
3301-
*/
3302-
public <K> CommandLine registerForPathCompletion(Class<K> cls) {
3303-
pathCompletionTypes.add(cls.getName());
3304-
for (CommandLine command : getCommandSpec().commands.values()) {
3305-
command.registerForPathCompletion(cls);
3306-
}
3307-
return this;
3308-
}
3309-
3310-
/**
3311-
* Returns {@code true} if the CommandLine supports path completion for {@link Option} and {@link Parameters} of
3312-
* type {@code type}.
3313-
* @param type the type to check if path completion is supported for
3314-
* @return {@code true} if the CommandLine supports path completion for {@link Option} and {@link Parameters} of
3315-
* type {@code type}.
3316-
* @see #registerForPathCompletion(Class)
3317-
*/
3318-
public boolean supportsPathCompletion(Class<?> type) {
3319-
return pathCompletionTypes.contains(type.getName());
3320-
}
3321-
33223280
/** Returns the String that separates option names from option values when parsing command line options.
33233281
* @return the String the parser uses to separate option names from option values
33243282
* @see ParserSpec#separator() */

0 commit comments

Comments
 (0)