diff options
| author | bingoohuang <bingoo.huang@gmail.com> | 2021-03-01 09:22:46 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-01 09:22:46 +0800 |
| commit | eb65cbf0025e4bfbfe6359a5ba5bfbd094c3e81d (patch) | |
| tree | 7aa6c966d0d36a6cd4d2c16735b6b265527af142 /weed/util | |
| parent | 0cfbe8f059c9f97f606e7c76f77aa8a8a8c97765 (diff) | |
| parent | e52c94640e9898be5308a77867ecea5ef1567c5b (diff) | |
| download | seaweedfs-eb65cbf0025e4bfbfe6359a5ba5bfbd094c3e81d.tar.xz seaweedfs-eb65cbf0025e4bfbfe6359a5ba5bfbd094c3e81d.zip | |
Merge pull request #5 from chrislusf/master
sync
Diffstat (limited to 'weed/util')
| -rw-r--r-- | weed/util/constants.go | 2 | ||||
| -rw-r--r-- | weed/util/file_util.go | 4 | ||||
| -rw-r--r-- | weed/util/fla9/fla9.go | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/weed/util/constants.go b/weed/util/constants.go index 1900d3d42..55f5b52d6 100644 --- a/weed/util/constants.go +++ b/weed/util/constants.go @@ -5,7 +5,7 @@ import ( ) var ( - VERSION = fmt.Sprintf("%s %d.%02d", sizeLimit, 2, 26) + VERSION = fmt.Sprintf("%s %d.%02d", sizeLimit, 2, 28) COMMIT = "" ) diff --git a/weed/util/file_util.go b/weed/util/file_util.go index 70135180d..f83f80265 100644 --- a/weed/util/file_util.go +++ b/weed/util/file_util.go @@ -69,6 +69,10 @@ func CheckFile(filename string) (exists, canRead, canWrite bool, modTime time.Ti func ResolvePath(path string) string { + if !strings.Contains(path, "~") { + return path + } + usr, _ := user.Current() dir := usr.HomeDir diff --git a/weed/util/fla9/fla9.go b/weed/util/fla9/fla9.go index 335b9ff7a..91d3b5ce9 100644 --- a/weed/util/fla9/fla9.go +++ b/weed/util/fla9/fla9.go @@ -886,7 +886,7 @@ func (f *FlagSet) parseOne() (bool, error) { // The return value will be ErrHelp if -help or -h were set but not defined. func (f *FlagSet) Parse(arguments []string) error { if _, ok := f.formal[DefaultConfigFlagName]; !ok { - f.String(DefaultConfigFlagName, "", "config file") + f.String(DefaultConfigFlagName, "", "file with command line options with each line in optionName=optionValue format") } f.parsed = true @@ -1078,7 +1078,7 @@ func NewFlagSetWithEnvPrefix(name string, prefix string, errorHandling ErrorHand // DefaultConfigFlagName defines the flag name of the optional config file // path. Used to lookup and parse the config file when a default is set and // available on disk. -var DefaultConfigFlagName = "config" +var DefaultConfigFlagName = "options" // ParseFile parses flags from the file in path. // Same format as commandline arguments, newlines and lines beginning with a |
