[from now] 2014/09/11 10:12:26

diff --git a/gaiden-core/src/main/groovy/gaiden/command/AbstractCommand.groovy b/gaiden-core/src/main/groovy/gaiden/command/AbstractCommand.groovy
index 8e30cd1..9497da4 100644
--- a/gaiden-core/src/main/groovy/gaiden/command/AbstractCommand.groovy
+++ b/gaiden-core/src/main/groovy/gaiden/command/AbstractCommand.groovy
@@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired
 import java.nio.file.Files

 @CompileStatic
-abstract class AbstractCommand implements GaidenCommand {
+abstract class AbstractCommand implements GaidenCommand, UsageAwareCommand {

     @Autowired
     GaidenConfig gaidenConfig
@@ -75,6 +75,13 @@ abstract class AbstractCommand implements GaidenCommand {

     abstract void execute(List<String> arguments, OptionAccessor options)

+    /**
+     * Should a command be executed in the Gaiden project directory?
+     *
+     * @return True if a command should be executed in the Gaiden project directory
+     */
+    abstract boolean isOnlyGaidenProject()
+
     private boolean continues() {
         print messageSource.getMessage("not.gaiden.project.confirmation.message", [gaidenConfig.gaidenConfigFile])
         return BooleanUtils.toBoolean(new Scanner(System.in).nextLine())
diff --git a/gaiden-core/src/main/groovy/gaiden/command/GaidenCommand.groovy b/gaiden-core/src/main/groovy/gaiden/command/GaidenCommand.groovy
index 807448d..9ccbbc9 100644
--- a/gaiden-core/src/main/groovy/gaiden/command/GaidenCommand.groovy
+++ b/gaiden-core/src/main/groovy/gaiden/command/GaidenCommand.groovy
@@ -25,13 +25,6 @@ package gaiden.command
 interface GaidenCommand {

     /**
-     * Should a command be executed in the Gaiden project directory?
-     *
-     * @return True if a command should be executed in the Gaiden project directory
-     */
-    boolean isOnlyGaidenProject()
-
-    /**
      * Executes command.
      *
      * @param args command arguments
@@ -44,18 +37,4 @@ interface GaidenCommand {
      * @return the command name
      */
     String getName()
-
-    /**
-     * Returns the description.
-     *
-     * @return the description
-     */
-    String getDescription()
-
-    /**
-     * Returns the usage.
-     *
-     * @return the usage
-     */
-    String getUsage()
 }
diff --git a/gaiden-core/src/main/groovy/gaiden/command/UnknownCommand.groovy b/gaiden-core/src/main/groovy/gaiden/command/UnknownCommand.groovy
index 7b8cbc7..da0c49f 100644
--- a/gaiden-core/src/main/groovy/gaiden/command/UnknownCommand.groovy
+++ b/gaiden-core/src/main/groovy/gaiden/command/UnknownCommand.groovy
@@ -27,31 +27,19 @@ class UnknownCommand implements GaidenCommand {

     final String name = "unknown"

-    final boolean onlyGaidenProject = false
-
     @Autowired
     MessageSource messageSource

     @Autowired
-    List<GaidenCommand> commands
+    List<UsageAwareCommand> commands

     @Override
     void execute(List<String> options) {
         println messageSource.getMessage('usage.prefix')
         def targetCommands = commands.findAll { !(it instanceof VersionCommand || it instanceof UnknownCommand) }
-        def max = targetCommands.max { GaidenCommand command -> command.usage.size() }.usage.size()
-        targetCommands.each { GaidenCommand command ->
+        def max = targetCommands.max { UsageAwareCommand command -> command.usage.size() }.usage.size()
+        targetCommands.each { UsageAwareCommand command ->
             printf "    %-${max}s  %s\n", [command.usage, command.description]
         }
     }
-
-    @Override
-    String getDescription() {
-        null
-    }
-
-    @Override
-    String getUsage() {
-        null
-    }
 }
diff --git a/gaiden-core/src/main/groovy/gaiden/command/VersionCommand.groovy b/gaiden-core/src/main/groovy/gaiden/command/VersionCommand.groovy
index afc0400..d770f18 100644
--- a/gaiden-core/src/main/groovy/gaiden/command/VersionCommand.groovy
+++ b/gaiden-core/src/main/groovy/gaiden/command/VersionCommand.groovy
@@ -21,12 +21,10 @@ import org.springframework.stereotype.Component

 @Component
 @CompileStatic
-class VersionCommand extends AbstractCommand {
+class VersionCommand implements GaidenCommand {

     final String name = "version"

-    final boolean onlyGaidenProject = false
-
     @Override
     void execute(List<String> arguments) {
         def properties = new Properties()
@@ -52,9 +50,4 @@ JVM        : ${System.properties["java.version"]}
 Groovy     : ${GroovySystem.getVersion()}\
 """
     }
-
-    @Override
-    void execute(List<String> arguments, OptionAccessor options) {
-        // NOOP
-    }
 }
diff --git a/gaiden-core/src/main/resources/messages.properties b/gaiden-core/src/main/resources/messages.properties
index d02893b..2b5db93 100644
--- a/gaiden-core/src/main/resources/messages.properties
+++ b/gaiden-core/src/main/resources/messages.properties
@@ -14,8 +14,20 @@
 # limitations under the License.
 #

-usage.prefix=Usage: gaiden [-v|--version] [--non-interactive] <command>\n\n  commands:
-not.gaiden.project.confirmation.message=Not a Gaiden project (Cannot find {0})\nAre you sure you want to continue ? (y/n):
+usage.prefix=Usage: gaiden [-v|--version] [--non-interactive] <command> [<args>]\n\n  commands:
+command.build.usage=build
+command.build.description=Build pages from page sources
+command.clean.usage=clean
+command.clean.description=Clean the build directory
+command.create-project.usage=create-project <project name>
+command.create-project.description=Create the project directory
+command.install-theme.usage=install-theme <theme name>
+command.install-theme.description=Install a theme resources into the project directory
+command.watch.usage=watch
+command.watch.description=Watch the project files, build when files are changed
+command.wrapper.usage=wrapper
+command.wrapper.description=Install wrapper resources
+
 command.create.project.name.required.error=Project name is required\n\nUsage: gaiden create-project <project name>
 command.create.project.already.exists.error=The Gaiden project already exists: {0}
 command.create.project.success.message=Created Gaiden project at {0}
@@ -29,23 +41,10 @@ command.wrapper.success.message=Installed wrapper files
 command.watch.start.message=Watching {0}...
 command.watch.found.message=Found {1} {0}
 command.watch.rebuild.message=Rebuilding...
+
+not.gaiden.project.confirmation.message=Not a Gaiden project (Cannot find {0})\nAre you sure you want to continue ? (y/n):
 toc.page.reference.not.exists.message=''{0}'' in the Table of Contents refers to non-existent page
 output.page.reference.not.exists.message=''{0}'' in {1} refers to non-existent page
 image.reference.not.exists.message=''{0}'' in the ''{1}'' refers to non-existent file
 config.deprecated.parameter.message=''{0}'' is deprecated in GaidenConfig.groovy. Please use ''{1}'' instead.
 illegal.header.level=Could not create Table of Contents: ''{2}'' is an illegal header level: file=''{0}'', header=''{1}'', possible={3}
-
-command.build.usage=build
-command.build.description=Build pages from source pages
-command.clean.usage=clean
-command.clean.description=Clean the build directory
-command.create-project.usage=create-project <project name>
-command.create-project.description=Create the project directory
-command.install-theme.usage=install-theme <theme name>
-command.version.usage=<-v|--version>
-command.watch.usage=watch
-command.wrapper.usage=wrapper
-command.install-theme.description=Install Theme
-command.version.description=Show Gaiden Version
-command.watch.description=Watching
-command.wrapper.description=Install wrapper resources
[from now] 2014/09/11 11:18:16

diff --git a/gaiden-core/src/main/groovy/gaiden/command/UsageAwareCommand.groovy b/gaiden-core/src/main/groovy/gaiden/command/UsageAwareCommand.groovy
new file mode 100644
index 0000000..e5efe16
--- /dev/null
+++ b/gaiden-core/src/main/groovy/gaiden/command/UsageAwareCommand.groovy
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2014 the original author or authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package gaiden.command
+
+interface UsageAwareCommand {
+
+    /**
+     * Returns the description.
+     *
+     * @return the description
+     */
+    String getDescription()
+
+    /**
+     * Returns the usage.
+     *
+     * @return the usage
+     */
+    String getUsage()
+}
\ No newline at end of file