MCPcopy Create free account
hub / github.com/cli/cli / ShouldCopyToClipboard

Function ShouldCopyToClipboard

pkg/cmd/auth/shared/login_flow.go:64–69  ·  view source on GitHub ↗

ShouldCopyToClipboard resolves an explicit flag value before falling back to configuration.

(cfg gh.Config, flagValue *bool)

Source from the content-addressed store, hash-verified

62
63// ShouldCopyToClipboard resolves an explicit flag value before falling back to configuration.
64func ShouldCopyToClipboard(cfg gh.Config, flagValue *bool) bool {
65 if flagValue != nil {
66 return *flagValue
67 }
68 return cfg.Clipboard().Value == "enabled"
69}
70
71// ShouldUseExpiring resolves whether to prefer expiring credentials that gh refreshes automatically. An explicit
72// --expiring flag value wins; when the flag is unset it falls back to the expiring_credentials config setting

Callers 3

refreshRunFunction · 0.92
loginRunFunction · 0.92

Calls 1

ClipboardMethod · 0.65

Tested by 1