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