MCPcopy Create free account
hub / github.com/NVIDIA/nvcf / resolveTaskID

Function resolveTaskID

src/clis/nvcf-cli/cmd/task.go:407–422  ·  view source on GitHub ↗

============================================================================ Helpers ============================================================================ resolveTaskID returns the task ID from positional args, or falls back to the current task in state.

(args []string)

Source from the content-addressed store, hash-verified

405 taskUpdateSecretsCmd.Flags().StringSliceVar(&taskUpdateSecretsFlags.secrets, "secrets", []string{}, "Secrets in name=value format (e.g. NGC_API_KEY=nvapi-...)")
406
407}
408
409// ============================================================================
410// Helpers
411// ============================================================================
412
413// resolveTaskID returns the task ID from positional args, or falls back to the
414// current task in state.
415func resolveTaskID(args []string) (string, error) {
416 if len(args) >= 1 && args[0] != "" {
417 return args[0], nil
418 }
419 if !HasCurrentTask() {
420 if err := LoadStateForCurrentCommand(); err != nil {
421 logging.Warning("Could not load existing state: %v", err)
422 }
423 }
424 if HasCurrentTask() {
425 taskID := GetCurrentState().TaskID

Callers 9

runTaskGetFunction · 0.85
runTaskDeleteFunction · 0.85
runTaskCancelFunction · 0.85
runTaskEventsFunction · 0.85
runTaskResultsFunction · 0.85
runTaskUpdateSecretsFunction · 0.85

Calls 6

HasCurrentTaskFunction · 0.85
GetCurrentStateFunction · 0.85
WarningMethod · 0.80
InfoMethod · 0.45
ErrorfMethod · 0.45

Tested by 3