package seedu.address.logic.parser;

import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import seedu.address.logic.commands.SetDataDirectoryCommand;
import seedu.address.logic.parser.CommandLineParser.RestArgument;
import seedu.address.model.ReadOnlyModel;

/**
 * Parser for the "setdatadir" command.
 */
public class SetDataDirectoryParser implements Parser<SetDataDirectoryCommand> {

    private final RestArgument<File> newDirArg = new RestArgument<>("NEW_DIRECTORY",
            new FileParser().withAutocomplete(this::autocompleteNewDir));
    private final CommandLineParser cmdParser = new CommandLineParser().addArgument(newDirArg);

    @Override
    public SetDataDirectoryCommand parse(String str) throws ParseException {
        cmdParser.parse(str);
        return new SetDataDirectoryCommand(newDirArg.getValue());
    }

    @Override
    public List<String> autocomplete(ReadOnlyModel model, String input, int pos) {
        return cmdParser.autocomplete(model, input, pos);
    }

    private List<String> autocompleteNewDir(ReadOnlyModel model, String input, int pos) {
        if (!input.trim().isEmpty()) {
            return Collections.emptyList();
        }
        return Arrays.asList(model.getTaskBookFilePath());
    }

}

@@ -55,63 +55,8 @@
 le;%0A
-import java.util.Arrays;%0Aimport java.util.Collections;%0A
 impo
@@ -74,16 +74,16 @@
 l.List;%0A
+
 %0Aimport 
@@ -459,28 +459,16 @@
 ECTORY%22,
-%0A           
  new Fil
@@ -480,51 +480,8 @@
 er()
-.withAutocomplete(this::autocompleteNewDir)
 );%0A 
@@ -859,32 +859,32 @@
 put, int pos) %7B%0A
+
         return c
@@ -936,255 +936,6 @@
  %7D%0A%0A
-    private List%3CString%3E autocompleteNewDir(ReadOnlyModel model, String input, int pos) %7B%0A        if (!input.trim().isEmpty()) %7B%0A            return Collections.emptyList();%0A        %7D%0A        return Arrays.asList(model.getTaskBookFilePath());%0A    %7D%0A%0A
 %7D%0A

Remove setdatadir autocomplete