Skip to content
Snippets Groups Projects
Verified Commit 607822ac authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent a7e1a28f
No related branches found
No related tags found
No related merge requests found
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="document --help" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="documentation-manager" />
<working_directory value="$PROJECT_DIR$" />
<parameters value="document --help" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="document add" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="documentation-manager" />
<working_directory value="$PROJECT_DIR$/development/examples/example1" />
<parameters value="document add newdoc1 newdow2 newdoc3" />
<envs>
<env name="DOCMAN_PATH" value="dsfsdfsdfsdfsdfsdf" />
</envs>
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="document add --help" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="documentation-manager" />
<working_directory value="$PROJECT_DIR$" />
<parameters value="document add --help" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="server" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="documentation-manager" />
<working_directory value="$PROJECT_DIR$/development/examples/example1" />
<parameters value="server" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="server serve" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="documentation-manager" />
<working_directory value="$PROJECT_DIR$/development/examples/example1" />
<parameters value="server serve" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="version" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="documentation-manager" />
<working_directory value="$PROJECT_DIR$" />
<parameters value="version" />
<kind value="DIRECTORY" />
<directory value="$PROJECT_DIR$/application/source" />
<filePath value="$PROJECT_DIR$" />
<output_directory value="$PROJECT_DIR$/deployment/build" />
<method v="2" />
</configuration>
</component>
\ No newline at end of file
...@@ -71,7 +71,7 @@ $(CATALOGFILES): $(LOCALEFILES) $(GOFILES) ...@@ -71,7 +71,7 @@ $(CATALOGFILES): $(LOCALEFILES) $(GOFILES)
$(QUIET) touch $(CATALOGFILES) $(LOCALEFILES) $(QUIET) touch $(CATALOGFILES) $(LOCALEFILES)
.PHONY: build-locales .PHONY: build-locales
# Generate the catalog files ## Generate the catalog files
build-locales: $(CATALOGFILES) build-locales: $(CATALOGFILES)
......
...@@ -17,6 +17,10 @@ func initCommands() { ...@@ -17,6 +17,10 @@ func initCommands() {
if i == 0 { if i == 0 {
c = state.parser.Find(y) c = state.parser.Find(y)
} else { } else {
if c == nil {
exitWithError(1, "Command %s not found", y)
}
c = c.Find(y) c = c.Find(y)
} }
......
...@@ -4,4 +4,5 @@ type Definition struct { ...@@ -4,4 +4,5 @@ type Definition struct {
ConfigurationPath string `long:"config" short:"c"` ConfigurationPath string `long:"config" short:"c"`
Version VersionDefinition `command:"version" alias:"v"` Version VersionDefinition `command:"version" alias:"v"`
Document DocumentDefinition `command:"document" alias:"d"` Document DocumentDefinition `command:"document" alias:"d"`
Server ServerDefinition `command:"server" alias:"s"`
} }
...@@ -5,13 +5,15 @@ import ( ...@@ -5,13 +5,15 @@ import (
"gitlab.schukai.com/oss/utilities/documentation-manager/translations" "gitlab.schukai.com/oss/utilities/documentation-manager/translations"
) )
const documentSymbol = "document"
func init() { func init() {
h := handler{ h := handler{
init: initDocument, init: initDocument,
} }
handlers.executor["document"] = h handlers.executor[documentSymbol] = h
} }
......
package commands
import (
"github.com/jessevdk/go-flags"
"gitlab.schukai.com/oss/utilities/documentation-manager/translations"
)
const serverSymbol = "server"
func init() {
h := handler{
init: initServer,
}
handlers.executor[serverSymbol] = h
}
type ServerDefinition struct {
Serve ServerServeDefinition `command:"serve" alias:"s"`
}
func initServer(command *flags.Command) {
const text = "Server command"
command.ShortDescription = translations.T.Sprintf(text)
command.LongDescription = translations.T.Sprintf(text)
}
package commands
import (
"fmt"
"github.com/jessevdk/go-flags"
"gitlab.schukai.com/oss/utilities/documentation-manager/translations"
)
const serverServeSymbol = "server-serve"
func init() {
h := handler{
init: initServerServe,
execute: runServerServe,
}
handlers.executor[serverServeSymbol] = h
}
type ServerServeDefinition struct {
}
func initServerServe(command *flags.Command) {
const text = "Server command"
command.ShortDescription = translations.T.Sprintf(text)
command.LongDescription = translations.T.Sprintf(text)
}
func runServerServe(command *flags.Command) {
fmt.Println("Server command")
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment