1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

Add comments

This commit is contained in:
sauls8t 2019-04-27 17:11:58 +01:00
parent 8f1bc8ce1f
commit 1fefdaec9f
2 changed files with 1135 additions and 1138 deletions

9
core/env/parser.go vendored
View file

@ -36,19 +36,16 @@ func ParseFlags() (f Flags, ok bool) {
return return
} }
// configFile read parameters from TOML format config file. // configFile checks for the presence of exactly one command argument
// checks to see if it is a TOML format config file.
func configFile() (f Flags, ok bool) { func configFile() (f Flags, ok bool) {
ok = false ok = false
// See if we have -config parameter -- return false to signal no config file specified. // We are expecting: ./documize sample.conf
var configFile string var configFile string
// flag.StringVar(&configFile, "config", "", "specify path to TOML format config file")
// flag.Parse()
if len(os.Args) != 2 { if len(os.Args) != 2 {
return return
} }
configFile = os.Args[1] configFile = os.Args[1]
if len(configFile) == 0 || !configFileExists(configFile) { if len(configFile) == 0 || !configFileExists(configFile) {
return return

File diff suppressed because one or more lines are too long