Skip to content

Commit

Permalink
Named Mode Args #84
Browse files Browse the repository at this point in the history
Added support for specifying mode arguments via flags
  • Loading branch information
Maksymilian Wojczuk authored and jlampar committed Mar 9, 2018
1 parent 8f665ec commit d0c8331
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cliparser/cliparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,20 @@ func ParseCliArguments(args []string) (cliArguments CliArguments, err error) {
return
}

if len(*convertImpOutputFile) > 0 && len(*convertImpTemplate) > 0 {
cliArguments.TemplatePath = convertImpTemplate
cliArguments.OutputFilePath = convertImpOutputFile
} else if len(*convertOutputFile) > 0 && len(*convertTemplate) > 0 {
cliArguments.TemplatePath = convertTemplate
cliArguments.OutputFilePath = convertOutputFile
} else if len(*convertTemplate) > 0 && len(*convertImpOutputFile) > 0 {
cliArguments.TemplatePath = convertTemplate
cliArguments.OutputFilePath = convertImpOutputFile
} else {
err = errors.New("You have to specify the template and the output file, try --help")
return
}

// configure
case configure.FullCommand():
cliArguments.Mode = &ConfigureMode
Expand Down

0 comments on commit d0c8331

Please sign in to comment.