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

Function ShouldCopyToClipboard

pkg/cmd/auth/shared/login_flow.go:63–68  ·  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

61
62// ShouldCopyToClipboard resolves an explicit flag value before falling back to configuration.
63func ShouldCopyToClipboard(cfg gh.Config, flagValue *bool) bool {
64 if flagValue != nil {
65 return *flagValue
66 }
67 return cfg.Clipboard().Value == "enabled"
68}
69
70// ShouldUseExpiring resolves whether to prefer expiring credentials that gh refreshes automatically. An explicit
71// --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