generate falgs based on struct options instead of defining them externally

This commit is contained in:
zlji 2017-01-09 22:06:46 +08:00 committed by Iwasaki Yudai
parent c4ed7bc415
commit d71e2fcfa8
6 changed files with 218 additions and 231 deletions

13
utils/path.go Normal file
View file

@ -0,0 +1,13 @@
package utils
import (
"os"
)
func ExpandHomeDir(path string) string {
if path[0:2] == "~/" {
return os.Getenv("HOME") + path[1:]
} else {
return path
}
}