From 84746650eaccc6edd54d4573bdefaf24339af626 Mon Sep 17 00:00:00 2001 From: jihye kim Date: Wed, 4 Jul 2012 11:10:42 +0900 Subject: [PATCH] [Title] fix advanced option's problem [Type] bug fix [Module] emulator manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- package/pkginfo.manifest | 4 ++-- src/org/tizen/emulator/manager/console/Action.java | 20 ++++++++++++++++++++ .../tizen/emulator/manager/console/ActionList.java | 4 ++-- .../manager/console/CommandLineProcessor.java | 8 ++++---- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index ce85ea7..f38a4e1 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Package: emulator-manager -Version: 1.0.62 +Version: 1.0.63 OS: linux Build-host-os: linux Maintainer: Yeong-Kyoon Lee @@ -7,7 +7,7 @@ Source: emulator-manager Description: Tizen Emulator Manager Package: emulator-manager -Version: 1.0.62 +Version: 1.0.63 OS: windows Build-host-os: windows Maintainer: Yeong-Kyoon Lee diff --git a/src/org/tizen/emulator/manager/console/Action.java b/src/org/tizen/emulator/manager/console/Action.java index 3b57866..7a9af06 100644 --- a/src/org/tizen/emulator/manager/console/Action.java +++ b/src/org/tizen/emulator/manager/console/Action.java @@ -145,6 +145,14 @@ class Command { this.isInCommandLine = false; } + public boolean checkExtraArg(String arg) { + if (arg.startsWith("-")) { + return false; + } else { + return true; + } + } + public String getKey() { return key; } @@ -189,6 +197,18 @@ class Command { } } +class AddOptions extends Command { + + public AddOptions(String shortName, String longName, String description, + String defaultValue, boolean isMandatory, boolean needsExtra) { + super(shortName, longName, description, defaultValue, isMandatory, needsExtra); + } + + public boolean checkExtraArg(String arg) { + return true; + } +} + class Actions { // global options public final static String OP_HELP = "help"; diff --git a/src/org/tizen/emulator/manager/console/ActionList.java b/src/org/tizen/emulator/manager/console/ActionList.java index 588b3a1..23efb48 100644 --- a/src/org/tizen/emulator/manager/console/ActionList.java +++ b/src/org/tizen/emulator/manager/console/ActionList.java @@ -359,7 +359,7 @@ class Create extends Action { property.isGLAcceleration ? "yes" : "no", false, true)); commandList.add(new Command("t", Actions.OP_MAXTOUCH, "Set count of multi touch point.(1 or 2)", Integer.toString(property.maxTouchCount), false, true)); - commandList.add(new Command("a", Actions.OP_ADDOPTION, + commandList.add(new AddOptions("a", Actions.OP_ADDOPTION, "Add other qemu's options.", "", false, true)); } @@ -416,7 +416,7 @@ class Modify extends Action { property.isGLAcceleration ? "yes" : "no", false, true)); commandList.add(new Command("t", Actions.OP_MAXTOUCH, "Set count of multi touch point.(1 or 2)", Integer.toString(property.maxTouchCount), false, true)); - commandList.add(new Command("a", Actions.OP_ADDOPTION, + commandList.add(new AddOptions("a", Actions.OP_ADDOPTION, "Add other qemu's options.", "", false, true)); } diff --git a/src/org/tizen/emulator/manager/console/CommandLineProcessor.java b/src/org/tizen/emulator/manager/console/CommandLineProcessor.java index 174353e..68b6957 100644 --- a/src/org/tizen/emulator/manager/console/CommandLineProcessor.java +++ b/src/org/tizen/emulator/manager/console/CommandLineProcessor.java @@ -91,14 +91,14 @@ public class CommandLineProcessor { // error throw new ConsoleException("Missing argument for '" + a + "'."); } - String b = args[i]; - if (b.startsWith("-")) { + + if (!command.checkExtraArg(args[i])) { // error throw new ConsoleException( - "It(" + b + ") looks like you didn't provide an avliable argument for '" + a + "'"); + "It(" + args[i] + ") looks like you didn't provide an avliable argument for '" + a + "'"); } - command.setCurrentValue(b); + command.setCurrentValue(args[i]); // TODO : test // System.out.println(command.getLongName() + " : " + b); } -- 2.7.4