INNER CODE UNIT · Go

setConfigFilePath

dundee/gdu · cmd/gdu/main.go:188

func setConfigFilePath() {
	// Read the arguments one by one instead of joining them, so that paths
	// containing spaces are not truncated.
	for i, arg := range os.Args {
		if value, found := strings.CutPrefix(arg, "--config-file="); found {
			af.CfgFile = value
			return
		}
		if arg == "--config-file" && i+1 < len(os.Args) {
			af.CfgFile = os.Args[i+1]
			return
		}
	}
	setDefaultConfigFilePath()
}

func setDefaultConfigFilePath() {
	home, err := os.UserHomeDir()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…