Skip to content
Snippets Groups Projects
Commit 973cfaf4 authored by Jack MacLauchlan CS2015's avatar Jack MacLauchlan CS2015
Browse files

added frame for update command

parent 78ede5a5
No related branches found
No related tags found
1 merge request!2Commit tree
......@@ -9,8 +9,6 @@ public class CommandLineInterface {
public CommandLineInterface() {
this.options = new Options();
addOptions();
HelpFormatter formatter = new HelpFormatter();
// formatter.printHelp("to do", options); //todo
}
......@@ -56,6 +54,15 @@ public class CommandLineInterface {
.build();
uniqueCommands.addOption(comment);
Option updateIssue = Option.builder()
.longOpt("update")
.hasArgs()
.numberOfArgs(3)
.argName("ID> <OPTION> <UPDATEVAL>")
.desc("update issue with given id")
.build();
uniqueCommands.addOption(updateIssue);
// Option createIssue = Option.builder()
// .longOpt("new")
// .hasArgs()
......@@ -66,12 +73,6 @@ public class CommandLineInterface {
// uniqueCommands.addOption(createIssue);
Option updateIssue = Option.builder()
.longOpt("update")
.desc("update issue with given id")
.build();
uniqueCommands.addOption(updateIssue);
Option deleteIssue = Option.builder()
.longOpt("remove")
.hasArg()
......@@ -85,6 +86,11 @@ public class CommandLineInterface {
}
public void help() {
HelpFormatter formatter = new HelpFormatter();
formatter.printHelp("TO DO", options);
}
public CommandLine getInput(String[] userInput) throws ParseException {
CommandLineParser parser = new DefaultParser();
return parser.parse(options, userInput);
......
......@@ -30,6 +30,7 @@ public class CommandSelector {
} else if (userInput.hasOption("comment")) {
command = comment(userInput.getOptionValues("comment"));
} else {
commandLineInterface.help();
command = nullCommand();
}
command.execute();
......@@ -63,4 +64,8 @@ public class CommandSelector {
return new CommandShow(id);
}
private Command update(String[] args) {
return new CommandUpdate(args);
}
}
package command;
import git.IssueRepo;
import issueData.IssueRepository;
public class CommandShow implements Command {
......
package command;
public class CommandUpdate implements Command {
public CommandUpdate(String[] args){
}
@Override
public void execute() {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment