ShouldCopyToClipboard resolves an explicit flag value before falling back to configuration.
(cfg gh.Config, flagValue *bool)
| 62 | |
| 63 | // ShouldCopyToClipboard resolves an explicit flag value before falling back to configuration. |
| 64 | func 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 |