From 00804ba2bafba780c2f7e74b3e21ed14468ae7e6 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Mon, 11 Sep 2017 12:16:20 -0300 Subject: Add beginnings of CLI for defines --- .../main/java/bjc/utils/cli/objects/DefineCLI.java | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 BJC-Utils2/src/main/java/bjc/utils/cli/objects/DefineCLI.java (limited to 'BJC-Utils2/src/main/java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/cli/objects/DefineCLI.java b/BJC-Utils2/src/main/java/bjc/utils/cli/objects/DefineCLI.java new file mode 100644 index 0000000..71c683d --- /dev/null +++ b/BJC-Utils2/src/main/java/bjc/utils/cli/objects/DefineCLI.java @@ -0,0 +1,40 @@ +package bjc.utils.cli.objects; + +public class DefineCLI { + public static void main(String[] args) { + + } + + /** + * Run the CLI on an input source. + * + * @param input + * The place to read input from. + * @param ioSource + * The name of the place to read input from. + * @param interactive + * Whether or not the source is interactive + */ + public void run(Scanner input, String ioSource, boolean interactive) { + int lno = 0; + while(input.hasNextLine()) { + if(interactive) + System.out.printf("define-conf(%d)>", lno); + + String ln = input.nextLine(); + + lno += 1; + + Command com = Command.fromString(ln, lno, ioSource); + if(com == null) continue; + + handleCommand(com, interactive); + } + + input.close(); + } + + public void handleCommand(Command com, boolean interactive) { + + } +} -- cgit v1.2.3