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

chore: commit save point

parent f433f121
No related branches found
No related tags found
No related merge requests found
Showing
with 275 additions and 117 deletions
...@@ -62,21 +62,17 @@ include $(MAKEFILE_IMPORT_PATH)terminal-check.mk ...@@ -62,21 +62,17 @@ include $(MAKEFILE_IMPORT_PATH)terminal-check.mk
############################################################################################# #############################################################################################
############################################################################################# #############################################################################################
%.md5: % GOFILES := $(shell find $(SOURCE_PATH) -name '*.go' ! -name 'catalog.go')
@md5sum $< | cmp -s $@ -; if test $$? -ne 0; then md5sum $< > $@; fi
LOCALEFILES := $(shell find $(SOURCE_PATH)translations/locales/ -name '*.json') LOCALEFILES := $(shell find $(SOURCE_PATH)translations/locales/ -name '*.json')
CATALOGFILES := $(SOURCE_PATH)translations/locales/catalog.go CATALOGFILES := $(SOURCE_PATH)translations/locales/catalog.go
$(CATALOGFILES): $(LOCALEFILES) $(CATALOGFILES): $(LOCALEFILES) $(GOFILES)
echo $(LOCALEFILES) $(QUIET) $(GO) generate $(SOURCE_PATH)translations/translations.go
$(QUITE) $(ECHO) "Generating catalog files..." $(QUIET) touch $(CATALOGFILES) $(LOCALEFILES)
$(QUITE) $(GO) generate $(SOURCE_PATH)translations/translations.go
.PHONY: build-locales .PHONY: build-locales
# Generate the catalog files # Generate the catalog files
build-locales: $(CATALOGFILES) build-locales: $(CATALOGFILES)
$(QUITE) $(ECHO) "Building locales..."
package commands
import (
"github.com/kelseyhightower/envconfig"
"gopkg.in/yaml.v3"
"os"
"os/user"
"strings"
)
const configName = "config.yaml"
type Configuration struct {
Document struct {
Path string `yaml:"Path" envconfig:"PATH"`
Template string `yaml:"Template" envconfig:"TEMPLATE"`
} `yaml:"Document"`
}
func checkAndInitConfiguration(name string) bool {
if name == "" {
return false
}
ptr, err := os.Open(name)
if err != nil {
return false
}
defer ptr.Close()
decoder := yaml.NewDecoder(ptr)
err = decoder.Decode(state.configuration)
if err != nil {
return false
}
return true
}
func initConfiguration() {
userConfig := ""
usr, err := user.Current()
if err == nil {
userConfig = usr.HomeDir + "/.config/" + state.info.Mnemonic + "/" + configName
}
current, err := os.Getwd()
if err == nil {
current = current + "/" + configName
}
state.configuration = &Configuration{}
err = envconfig.Process(strings.ToUpper(state.info.Mnemonic), state.configuration)
CheckError(err)
for _, path := range []string{
state.definition.ConfigurationPath,
current,
userConfig,
"/etc/" + state.info.Mnemonic + "/" + configName} {
if checkAndInitConfiguration(path) {
return
}
}
}
package commands package commands
import ( import (
"errors"
"github.com/jessevdk/go-flags"
"gitlab.schukai.com/oss/utilities/documentation-manager/translations" "gitlab.schukai.com/oss/utilities/documentation-manager/translations"
"os" "os"
) )
type stateStruct struct { type stateStruct struct {
info Info info InfoStruct
exitCode int exitCode int
warnings []string warnings []string
errors []string errors []string
messages []string messages []string
parser *flags.Parser
definition *Definition
configuration *Configuration
} }
type Info struct { type InfoStruct struct {
Version string Version string
Build string Build string
Mnemonic string
} }
var state *stateStruct var state *stateStruct
...@@ -24,30 +30,80 @@ func init() { ...@@ -24,30 +30,80 @@ func init() {
state = &stateStruct{} state = &stateStruct{}
} }
func ExitWithError(code int, message string, a ...interface{}) { func exitWithError(code int, message string, a ...interface{}) {
state.SetCode(code).AddError(translations.T.Sprintf(message, a)).Exit() state.setCode(code).addError(translations.T.Sprintf(message, a)).Exit()
} }
func (e *stateStruct) AddWarning(warning string) *stateStruct { func (e *stateStruct) addWarning(warning string) *stateStruct {
e.warnings = append(e.warnings, warning) e.warnings = append(e.warnings, warning)
return e return e
} }
func (e *stateStruct) AddError(error string) *stateStruct { func (e *stateStruct) addError(error string) *stateStruct {
e.errors = append(e.errors, error) e.errors = append(e.errors, error)
return e return e
} }
func (e *stateStruct) AddMessage(message string) *stateStruct { func (e *stateStruct) addMessage(message string) *stateStruct {
e.messages = append(e.messages, message) e.messages = append(e.messages, message)
return e return e
} }
func (e *stateStruct) SetCode(code int) *stateStruct { func (e *stateStruct) setCode(code int) *stateStruct {
e.exitCode = code e.exitCode = code
return e return e
} }
func (e *stateStruct) getDocumentPath() string {
if e.definition.Document.Path != "" {
return e.definition.Document.Path
}
if e.configuration.Document.Path != "" {
return e.configuration.Document.Path
}
path, err := os.Getwd()
CheckError(err)
return path
}
func evaluateTemplate(data string) string {
if data == "" {
return ""
}
// check if the template is a file
template, err := os.ReadFile(data)
if err == nil {
return string(template)
}
// weather the template is a string
if errors.Is(err, os.ErrNotExist) {
return data
}
CheckError(err)
return ""
}
func (e *stateStruct) getDocumentTemplate() string {
if t := evaluateTemplate(e.definition.Document.Add.Template); t != "" {
return t
}
if t := evaluateTemplate(e.configuration.Document.Template); t != "" {
return t
}
return newDocumentTemplate
}
const ExitWithCodeSymbol = "exit with code" const ExitWithCodeSymbol = "exit with code"
func (e *stateStruct) Exit() { func (e *stateStruct) Exit() {
......
...@@ -15,7 +15,7 @@ func initCommands() { ...@@ -15,7 +15,7 @@ func initCommands() {
for i, y := range x { for i, y := range x {
if i == 0 { if i == 0 {
c = terminalState.parser.Find(y) c = state.parser.Find(y)
} else { } else {
c = c.Find(y) c = c.Find(y)
} }
......
...@@ -39,37 +39,37 @@ func checkFlagsError(err error) { ...@@ -39,37 +39,37 @@ func checkFlagsError(err error) {
e := err.(*flags.Error) e := err.(*flags.Error)
switch e.Type { switch e.Type {
case flags.ErrUnknown: case flags.ErrUnknown:
state.AddError(translations.T.Sprintf("flag error unknown")).Exit() state.addError(translations.T.Sprintf("flag error unknown")).Exit()
case flags.ErrExpectedArgument: case flags.ErrExpectedArgument:
state.AddError(translations.T.Sprintf("expected argument")).Exit() state.addError(translations.T.Sprintf("expected argument")).Exit()
case flags.ErrUnknownFlag: case flags.ErrUnknownFlag:
state.AddError(translations.T.Sprintf("unknown flag")).Exit() state.addError(translations.T.Sprintf("unknown flag")).Exit()
case flags.ErrUnknownGroup: case flags.ErrUnknownGroup:
state.AddError(translations.T.Sprintf("unknown group")).Exit() state.addError(translations.T.Sprintf("unknown group")).Exit()
case flags.ErrMarshal: case flags.ErrMarshal:
state.AddError(translations.T.Sprintf("marshal")).Exit() state.addError(translations.T.Sprintf("marshal")).Exit()
case flags.ErrHelp: case flags.ErrHelp:
state.Exit() state.Exit()
case flags.ErrNoArgumentForBool: case flags.ErrNoArgumentForBool:
state.AddError(translations.T.Sprintf("no argument for bool")).Exit() state.addError(translations.T.Sprintf("no argument for bool")).Exit()
case flags.ErrRequired: case flags.ErrRequired:
state.Exit() state.Exit()
case flags.ErrShortNameTooLong: case flags.ErrShortNameTooLong:
state.AddError(translations.T.Sprintf("short name too long")).Exit() state.addError(translations.T.Sprintf("short name too long")).Exit()
case flags.ErrDuplicatedFlag: case flags.ErrDuplicatedFlag:
state.AddError(translations.T.Sprintf("duplicated flag")).Exit() state.addError(translations.T.Sprintf("duplicated flag")).Exit()
case flags.ErrTag: case flags.ErrTag:
state.AddError(translations.T.Sprintf("tag %s", err.Error())).Exit() state.addError(translations.T.Sprintf("tag %s", err.Error())).Exit()
case flags.ErrCommandRequired: case flags.ErrCommandRequired:
state.Exit() state.Exit()
case flags.ErrUnknownCommand: case flags.ErrUnknownCommand:
state.AddError(translations.T.Sprintf("unknown command")).Exit() state.addError(translations.T.Sprintf("unknown command")).Exit()
case flags.ErrInvalidChoice: case flags.ErrInvalidChoice:
state.AddError(translations.T.Sprintf("invalid choice")).Exit() state.addError(translations.T.Sprintf("invalid choice")).Exit()
case flags.ErrInvalidTag: case flags.ErrInvalidTag:
state.AddError(translations.T.Sprintf("invalid tag")).Exit() state.addError(translations.T.Sprintf("invalid tag")).Exit()
default: default:
state.AddError(translations.T.Sprintf("unrecognized error type")).Exit() state.addError(translations.T.Sprintf("unrecognized error type")).Exit()
} }
} }
...@@ -84,5 +84,5 @@ func CheckError(err error) { ...@@ -84,5 +84,5 @@ func CheckError(err error) {
checkFlagsError(err) checkFlagsError(err)
} }
ExitWithError(1, "Unknown Error: %s", err.Error()) exitWithError(1, "Unknown Error: %s", err.Error())
} }
package commands
import "github.com/jessevdk/go-flags"
type TerminalStateStruct struct {
parser *flags.Parser
definition *Definition
}
var terminalState TerminalStateStruct
package commands package commands
type Definition struct { type Definition struct {
Version VersionDefinition `command:"version" alias:"v"` ConfigurationPath string `long:"config" short:"c"`
Document DocumentDefinition `command:"document" alias:"d"` Version VersionDefinition `command:"version" alias:"v"`
Document DocumentDefinition `command:"document" alias:"d"`
} }
...@@ -6,23 +6,25 @@ import ( ...@@ -6,23 +6,25 @@ import (
"strings" "strings"
) )
func Execute(Info Info) { func Execute(Info InfoStruct) {
state.info = Info state.info = Info
initTerminalState() initTerminalState()
initCommands() initCommands()
_, err := terminalState.parser.Parse() _, err := state.parser.Parse()
CheckError(err) CheckError(err)
a := terminalState.parser.Command.Active initConfiguration()
a := state.parser.Command.Active
if a == nil { if a == nil {
ExitWithError(1, "No active command found") exitWithError(1, "No active command found")
} }
queue := []string{} queue := []string{}
runCommand(queue, terminalState.parser.Command.Active) runCommand(queue, state.parser.Command.Active)
} }
...@@ -34,10 +36,8 @@ func initTerminalState() { ...@@ -34,10 +36,8 @@ func initTerminalState() {
parser.ShortDescription = translations.T.Sprintf("This program can be used to create documentation for your project.") parser.ShortDescription = translations.T.Sprintf("This program can be used to create documentation for your project.")
parser.LongDescription = translations.T.Sprintf("This program can be used to create documentation for your project.\nIt can be used to create a new documentation project,\nadd new documentation to an existing project, or to generate\ndocumentation from a source code project.") parser.LongDescription = translations.T.Sprintf("This program can be used to create documentation for your project.\nIt can be used to create a new documentation project,\nadd new documentation to an existing project, or to generate\ndocumentation from a source code project.")
terminalState = TerminalStateStruct{ state.parser = parser
parser: parser, state.definition = definition
definition: definition,
}
} }
...@@ -56,6 +56,6 @@ func runCommand(queue []string, activeCommand *flags.Command) { ...@@ -56,6 +56,6 @@ func runCommand(queue []string, activeCommand *flags.Command) {
execute := handler.execute execute := handler.execute
execute(activeCommand) execute(activeCommand)
} else { } else {
ExitWithError(1, "handler %s not found", k) exitWithError(1, "handler %s not found", k)
} }
} }
...@@ -16,7 +16,7 @@ func init() { ...@@ -16,7 +16,7 @@ func init() {
} }
type DocumentDefinition struct { type DocumentDefinition struct {
Path string `long:"path" short:"p" default:"."` Path string `long:"path" short:"p"`
Add DocumentAddDefinition `command:"add" alias:"a"` Add DocumentAddDefinition `command:"add" alias:"a"`
} }
......
package commands package commands
import ( import (
"fmt"
"github.com/jessevdk/go-flags" "github.com/jessevdk/go-flags"
"gitlab.schukai.com/oss/utilities/documentation-manager/translations" "gitlab.schukai.com/oss/utilities/documentation-manager/translations"
"os"
"path"
"path/filepath"
) )
const documentAddSymbol = "document-add" const documentAddSymbol = "document-add"
...@@ -44,6 +46,7 @@ func init() { ...@@ -44,6 +46,7 @@ func init() {
} }
type DocumentAddDefinition struct { type DocumentAddDefinition struct {
Template string `long:"template" short:"t"`
Positional struct { Positional struct {
Name []string `positional-arg-name:"name" required:"yes" positional:"yes"` Name []string `positional-arg-name:"name" required:"yes" positional:"yes"`
} `positional-args:"yes" required:"yes"` } `positional-args:"yes" required:"yes"`
...@@ -54,6 +57,13 @@ func initDocumentAdd(command *flags.Command) { ...@@ -54,6 +57,13 @@ func initDocumentAdd(command *flags.Command) {
command.ShortDescription = translations.T.Sprintf(text) command.ShortDescription = translations.T.Sprintf(text)
command.LongDescription = translations.T.Sprintf(text) command.LongDescription = translations.T.Sprintf(text)
for _, opt := range command.Options() {
switch opt.LongName {
case "template":
opt.Description = translations.T.Sprintf("template for the new document")
}
}
for _, arg := range command.Args() { for _, arg := range command.Args() {
switch arg.Name { switch arg.Name {
case "name": case "name":
...@@ -64,42 +74,33 @@ func initDocumentAdd(command *flags.Command) { ...@@ -64,42 +74,33 @@ func initDocumentAdd(command *flags.Command) {
} }
func createNewDocument(name string) error { func createNewDocument(name string) {
//p := path.Join(arguments.Path, arguments.Add.Name+".md") root := state.getDocumentPath()
//if fileExists(p) { path := path.Join(root, name)
// printErrorAndExit(2, "the document with name already exists", arguments.Add.Name, p)
//} fileExtension := filepath.Ext(path)
// if fileExtension == "" {
//t := config.Document.Template.Add path += ".md"
//t = strings.Replace(t, "%%ID%%", arguments.Add.Name, -1) } else if fileExtension != ".md" {
//t = strings.Replace(t, "%%CREATED%%", time.Now().Format("2006-01-02"), -1) exitWithError(1, "file extension %s is not supported", fileExtension)
// }
//d1 := []byte(t)
//err := os.WriteFile(p, d1, 0644) template := state.getDocumentTemplate()
//if err != nil { err := os.WriteFile(path, []byte(template), 0644)
// return err CheckError(err)
//}
//
//return nil
return nil
} }
func runDocumentAdd(command *flags.Command) { func runDocumentAdd(command *flags.Command) {
t := terminalState names := state.definition.Document.Add.Positional.Name
p := t.definition.Document.Path
fmt.Println(p)
names := terminalState.definition.Document.Add.Positional.Name
if len(names) == 0 { if len(names) == 0 {
ExitWithError(1, "no document name given") exitWithError(1, "no document name given")
} }
for _, name := range names { for _, name := range names {
fmt.Printf("Adding document %s\n", name)
createNewDocument(name) createNewDocument(name)
} }
......
...@@ -2,11 +2,15 @@ module gitlab.schukai.com/oss/utilities/documentation-manager ...@@ -2,11 +2,15 @@ module gitlab.schukai.com/oss/utilities/documentation-manager
go 1.18 go 1.18
require golang.org/x/text v0.3.7 require (
github.com/gookit/color v1.5.1
github.com/jessevdk/go-flags v1.5.0
golang.org/x/text v0.3.7
gopkg.in/yaml.v3 v3.0.1
)
require ( require (
github.com/gookit/color v1.5.1 // indirect github.com/kelseyhightower/envconfig v1.4.0 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
golang.org/x/sys v0.0.0-20220702020025-31831981b65f // indirect golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect
) )
...@@ -3,6 +3,8 @@ github.com/gookit/color v1.5.1 h1:Vjg2VEcdHpwq+oY63s/ksHrgJYCTo0bwWvmmYWdE9fQ= ...@@ -3,6 +3,8 @@ github.com/gookit/color v1.5.1 h1:Vjg2VEcdHpwq+oY63s/ksHrgJYCTo0bwWvmmYWdE9fQ=
github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
...@@ -13,7 +15,10 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/ ...@@ -13,7 +15,10 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY= golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY=
golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
...@@ -7,8 +7,9 @@ import ( ...@@ -7,8 +7,9 @@ import (
// Used when building per // Used when building per
// -ldflags "-X main.version=$app_version -X main.build=$(due --iso-8601 | tr -d "-" )" // -ldflags "-X main.version=$app_version -X main.build=$(due --iso-8601 | tr -d "-" )"
var ( var (
version string = "dev" version string = "dev"
build string = "dev" build string = "dev"
mnemonic string = "docman"
) )
/** /**
...@@ -23,9 +24,10 @@ func main() { ...@@ -23,9 +24,10 @@ func main() {
commands.Exit() commands.Exit()
}() }()
commands.Execute(commands.Info{ commands.Execute(commands.InfoStruct{
Version: version, Version: version,
Build: build, Build: build,
Mnemonic: mnemonic,
}) })
} }
...@@ -45,15 +45,16 @@ var messageKeyToIndex = map[string]int{ ...@@ -45,15 +45,16 @@ var messageKeyToIndex = map[string]int{
"Info": 2, "Info": 2,
"No active command found": 18, "No active command found": 18,
"Not permitted": 3, "Not permitted": 3,
"Prints the version and build information": 27, "Prints the version and build information": 28,
"This program can be used to create documentation for your project.": 19, "This program can be used to create documentation for your project.": 19,
"This program can be used to create documentation for your project.\nIt can be used to create a new documentation project,\nadd new documentation to an existing project, or to generate\ndocumentation from a source code project.": 20, "This program can be used to create documentation for your project.\nIt can be used to create a new documentation project,\nadd new documentation to an existing project, or to generate\ndocumentation from a source code project.": 20,
"Unknown Error: %s": 17, "Unknown Error: %s": 17,
"Warn": 1, "Warn": 1,
"base directory in which the documents are saved": 23, "base directory in which the documents are saved": 23,
"build: %s\n": 29, "build: %s\n": 30,
"duplicated flag": 11, "duplicated flag": 11,
"expected argument": 5, "expected argument": 5,
"file extension %s is not supported": 26,
"file names of the new documents, separated by spaces": 25, "file names of the new documents, separated by spaces": 25,
"flag error unknown": 4, "flag error unknown": 4,
"handler %s not found": 21, "handler %s not found": 21,
...@@ -61,17 +62,17 @@ var messageKeyToIndex = map[string]int{ ...@@ -61,17 +62,17 @@ var messageKeyToIndex = map[string]int{
"invalid tag": 15, "invalid tag": 15,
"marshal": 8, "marshal": 8,
"no argument for bool": 9, "no argument for bool": 9,
"no document name given": 26, "no document name given": 27,
"short name too long": 10, "short name too long": 10,
"tag %s": 12, "tag %s": 12,
"unknown command": 13, "unknown command": 13,
"unknown flag": 6, "unknown flag": 6,
"unknown group": 7, "unknown group": 7,
"unrecognized error type": 16, "unrecognized error type": 16,
"version: %s\n": 28, "version: %s\n": 29,
} }
var deIndex = []uint32{ // 31 elements var deIndex = []uint32{ // 32 elements
0x00000000, 0x00000007, 0x0000000f, 0x00000014, 0x00000000, 0x00000007, 0x0000000f, 0x00000014,
0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014,
0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014,
...@@ -79,23 +80,23 @@ var deIndex = []uint32{ // 31 elements ...@@ -79,23 +80,23 @@ var deIndex = []uint32{ // 31 elements
0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014,
0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014,
0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014,
0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014,
} // Size: 148 bytes } // Size: 152 bytes
const deData string = "\x02Fehler\x02Warnung\x02Info" const deData string = "\x02Fehler\x02Warnung\x02Info"
var enIndex = []uint32{ // 31 elements var enIndex = []uint32{ // 32 elements
0x00000000, 0x00000006, 0x0000000b, 0x00000010, 0x00000000, 0x00000006, 0x0000000b, 0x00000010,
0x0000001e, 0x00000031, 0x00000043, 0x00000050, 0x0000001e, 0x00000031, 0x00000043, 0x00000050,
0x0000005e, 0x00000066, 0x0000007b, 0x0000008f, 0x0000005e, 0x00000066, 0x0000007b, 0x0000008f,
0x0000009f, 0x000000a9, 0x000000b9, 0x000000c8, 0x0000009f, 0x000000a9, 0x000000b9, 0x000000c8,
0x000000d4, 0x000000ec, 0x00000101, 0x00000119, 0x000000d4, 0x000000ec, 0x00000101, 0x00000119,
0x0000015c, 0x0000023c, 0x00000254, 0x00000281, 0x0000015c, 0x0000023c, 0x00000254, 0x00000281,
0x000002b1, 0x000002de, 0x00000313, 0x0000032a, 0x000002b1, 0x000002de, 0x00000313, 0x00000339,
0x00000357, 0x0000036b, 0x0000037d, 0x00000350, 0x0000037d, 0x00000391, 0x000003a3,
} // Size: 148 bytes } // Size: 152 bytes
const enData string = "" + // Size: 893 bytes const enData string = "" + // Size: 931 bytes
"\x02Error\x02Warn\x02Info\x02Not permitted\x02flag error unknown\x02expe" + "\x02Error\x02Warn\x02Info\x02Not permitted\x02flag error unknown\x02expe" +
"cted argument\x02unknown flag\x02unknown group\x02marshal\x02no argument" + "cted argument\x02unknown flag\x02unknown group\x02marshal\x02no argument" +
" for bool\x02short name too long\x02duplicated flag\x02tag %[1]s\x02unkn" + " for bool\x02short name too long\x02duplicated flag\x02tag %[1]s\x02unkn" +
...@@ -108,8 +109,8 @@ const enData string = "" + // Size: 893 bytes ...@@ -108,8 +109,8 @@ const enData string = "" + // Size: 893 bytes
"\x02handler %[1]s not found\x02Functions for creating and editing docume" + "\x02handler %[1]s not found\x02Functions for creating and editing docume" +
"nts\x02base directory in which the documents are saved\x02Functions for " + "nts\x02base directory in which the documents are saved\x02Functions for " +
"creating and editing documents\x02file names of the new documents, separ" + "creating and editing documents\x02file names of the new documents, separ" +
"ated by spaces\x02no document name given\x02Functions for creating and e" + "ated by spaces\x02file extension %[1]s is not supported\x02no document n" +
"diting documents\x04\x00\x01\x0a\x0f\x02version: %[1]s\x04\x00\x01\x0a" + "ame given\x02Functions for creating and editing documents\x04\x00\x01" +
"\x0d\x02build: %[1]s" "\x0a\x0f\x02version: %[1]s\x04\x00\x01\x0a\x0d\x02build: %[1]s"
// Total table size 1209 bytes (1KiB); checksum: DC32E83D // Total table size 1255 bytes (1KiB); checksum: 9B4E79C0
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
"id": "Error", "id": "Error",
"message": "Error", "message": "Error",
"translation": "Fehler" "translation": "Fehler"
}, },
{ {
"id": "Warn", "id": "Warn",
"message": "Warn", "message": "Warn",
"translation": "Warnung" "translation": "Warnung"
}, },
......
...@@ -157,6 +157,20 @@ ...@@ -157,6 +157,20 @@
"message": "file names of the new documents, separated by spaces", "message": "file names of the new documents, separated by spaces",
"translation": "" "translation": ""
}, },
{
"id": "file extension {Arg_1} is not supported",
"message": "file extension {Arg_1} is not supported",
"translation": "",
"placeholders": [
{
"id": "Arg_1",
"string": "%[1]s",
"type": "",
"underlyingType": "string",
"argNum": 1
}
]
},
{ {
"id": "no document name given", "id": "no document name given",
"message": "no document name given", "message": "no document name given",
......
...@@ -207,6 +207,22 @@ ...@@ -207,6 +207,22 @@
"translatorComment": "Copied from source.", "translatorComment": "Copied from source.",
"fuzzy": true "fuzzy": true
}, },
{
"id": "file extension {Arg_1} is not supported",
"message": "file extension {Arg_1} is not supported",
"translation": "file extension {Arg_1} is not supported",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "Arg_1",
"string": "%[1]s",
"type": "",
"underlyingType": "string",
"argNum": 1
}
],
"fuzzy": true
},
{ {
"id": "no document name given", "id": "no document name given",
"message": "no document name given", "message": "no document name given",
......
Document:
Path: /home/volker.schukai/projekte/gitlab/oss/utilities/documentation-manager/development/examples/example2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment