CLI : Fix argument counting logic in Main 93/12893/1
authorHeongseok Heo <hyeongseok.heo@samsung.com>
Mon, 25 Nov 2013 11:38:05 +0000 (20:38 +0900)
committerHeongseok Heo <hyeongseok.heo@samsung.com>
Mon, 25 Nov 2013 11:38:05 +0000 (20:38 +0900)
Fix counting argument length . Because there is default argument
'--current-workspace-path' , argument length should be 3 at least.

Change-Id: I8da62a7701150c961e1958bc6a15a38f76cfc86e

Change-Id: I8da62a7701150c961e1958bc6a15a38f76cfc86e
Signed-off-by: Heongseok Heo <hyeongseok.heo@samsung.com>
org.tizen.ncli.ide/src/org/tizen/core/ide/BuildWebAppModule.java
org.tizen.ncli.ide/src/org/tizen/ncli/core/CommandLineParser.java
org.tizen.ncli.ide/src/org/tizen/ncli/ide/shell/Main.java
org.tizen.ncli.ide/src/org/tizen/ncli/ide/subcommands/BuildWebCLICommand.java

index 46d338e..b08536f 100644 (file)
@@ -144,7 +144,6 @@ public class BuildWebAppModule {
         } else {
             throw new BuildException(null);
         }
-        Assert.notNull(cwd, "Current Working Directory should not be NULL.");
     }
 
     private void deleteOutput() {
@@ -320,7 +319,7 @@ public class BuildWebAppModule {
      * Add UI framework builder to buildProcess.
      * 
      * @param isExclude
-     *            If set true, Tizen web UI framework library will be excluded output path. Application will be used
+     *            If set true, Tizen web UI framework library will be excluded output path. Application will use
      *            target's Tizen web UI framework library.
      * @param useMin
      *            If 'isExclude' parameter set true and this parameter set true, application will be used target's
index 597790c..84d1950 100644 (file)
@@ -95,6 +95,7 @@ public class CommandLineParser extends CmdLineParser {
             log.trace("parseArgument CLP:{}\tCommand:{}", this, current);
             super.parseArgument(args);
         } catch (CmdLineException e) {
+            log.trace("CmdLineException occurred.\n{}", e.getMessage());
             /*
              * To show SubCommand information , make a information for SubCommand.
              */
@@ -102,7 +103,6 @@ public class CommandLineParser extends CmdLineParser {
             if (this == calleeParser) {
                 log.trace("Same CmdLineParser");
                 log.trace("args count: {}", args.length);
-                log.trace("CmdLineException occurred.\n{}", e.getMessage());
                 // process parsing subcommand infos
                 log.trace("make sub command reference infos.");
                 try {
index b265ace..223a337 100644 (file)
@@ -72,7 +72,7 @@ public class Main {
         } catch (CmdLineException e) {
             if (args.length == 0 || helpOpt) {
                 printDefaultCommandUsage(errorWriter);
-            } else if (args.length == 1) {
+            } else if (args.length == 3) {
                 /*
                  * Check if command name is correct and print proper message
                  */
@@ -85,7 +85,7 @@ public class Main {
                     printSubCommandOrArgUsage(command, errorWriter);
                 }
 
-            } else if (args.length > 1) {
+            } else if (args.length > 3) {
                 errorWriter.println();
                 errorWriter.println("Argument is not valid!");
                 errorWriter.println(MessageFormat.format("Error: {0}", e.getMessage()));
index cd0f7ae..7e6f0bc 100644 (file)
@@ -29,6 +29,8 @@ import java.io.IOException;
 import java.util.ArrayList;\r
 import java.util.List;\r
 \r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
 import org.tizen.common.builder.BuildProcess;\r
 import org.tizen.common.builder.Builder;\r
 import org.tizen.common.builder.Resource;\r
@@ -58,6 +60,7 @@ import org.tizen.web.common.WebConstant;
  * \r
  */\r
 public class BuildWebCLICommand extends AbstractSubCommand<BuildWebParameter> {\r
+    private Logger log = LoggerFactory.getLogger(getClass());\r
 \r
     // file filter. If you want to exclude a directory, append '/*'\r
     private static final String[] DEFAULT_EXCLUDES = { ".build" + File.separator + "*", ".project",\r
@@ -79,7 +82,9 @@ public class BuildWebCLICommand extends AbstractSubCommand<BuildWebParameter> {
     @Override\r
     protected BuildWebParameter call() {\r
         log.trace("BuildWeb command started ...");\r
-        log.info("Build started...");\r
+        log.info("-----------------------------------------------------");\r
+        log.info("Starting Tizen project build:");\r
+        log.info("-----------------------------------------------------");\r
         initExcludes();\r
         if (log.isTraceEnabled()) {\r
             log.trace("BuildData: {}", webAppBuildData);\r