MCPcopy Create free account
hub / github.com/driangle/taskmd / GetGlobalFlags

Function GetGlobalFlags

apps/cli/internal/cli/root.go:154–172  ·  view source on GitHub ↗

GetGlobalFlags returns a struct with all global flag values

()

Source from the content-addressed store, hash-verified

152
153// GetGlobalFlags returns a struct with all global flag values
154func GetGlobalFlags() GlobalFlags {
155 // Resolve task directory with proper precedence:
156 // 1. Explicit --task-dir or --dir CLI flag (if changed from default)
157 // 2. Config file value (supports both "task-dir" and "dir" keys)
158 // 3. taskDir variable (for tests that set it directly)
159 // 4. Default "."
160 dirVal := resolveTaskDir()
161
162 return GlobalFlags{
163 Stdin: viper.GetBool("stdin") || stdin,
164 Quiet: viper.GetBool("quiet") || quiet,
165 Verbose: viper.GetBool("verbose") || verbose,
166 Debug: viper.GetBool("debug") || debug,
167 NoColor: viper.GetBool("no-color") || noColor,
168 TaskDir: dirVal,
169 IgnoreDirs: viper.GetStringSlice("ignore"),
170 Workflow: resolveWorkflow(),
171 }
172}
173
174// resolveRelativeToConfig resolves a relative path against the config file's directory.
175// If the path is absolute, or no config file is loaded, it is returned unchanged.

Callers 15

runSpecFunction · 0.85
TestConfigFile_DefaultsFunction · 0.85
runProjectInitFunction · 0.85
runNextFunction · 0.85
runSetFunction · 0.85
resolveDoneFlagFunction · 0.85
runSetVerificationFunction · 0.85

Calls 2

resolveWorkflowFunction · 0.85
resolveTaskDirFunction · 0.70