complete fgj → fj rename: env vars, config migration, docs
- Rename env vars: FGJ_HOST → FJ_HOST, FGJ_TOKEN → FJ_TOKEN, FGJ_FORCE_TTY → FJ_FORCE_TTY, FGJ_PAGER → FJ_PAGER, FGJ_BINARY_PATH → FJ_BINARY_PATH (all with legacy fallback) - Auto-migrate ~/.config/fgj/ → ~/.config/fj/ on first run - Update man page title, README, CHANGELOG - Update test fixture labels from [FGJ E2E Test] to [FJ E2E Test]
This commit is contained in:
parent
cf7c0e0878
commit
c3e8ad67ed
9 changed files with 94 additions and 33 deletions
|
|
@ -37,10 +37,10 @@ type IOStreams struct {
|
|||
}
|
||||
|
||||
// New creates an IOStreams wired to the real os.Stdin, os.Stdout, and os.Stderr,
|
||||
// with TTY status auto-detected. Setting FGJ_FORCE_TTY=1 forces all streams to
|
||||
// be treated as TTYs.
|
||||
// with TTY status auto-detected. Setting FJ_FORCE_TTY=1 (or legacy FGJ_FORCE_TTY=1)
|
||||
// forces all streams to be treated as TTYs.
|
||||
func New() *IOStreams {
|
||||
forceTTY := os.Getenv("FGJ_FORCE_TTY") != ""
|
||||
forceTTY := os.Getenv("FJ_FORCE_TTY") != "" || os.Getenv("FGJ_FORCE_TTY") != ""
|
||||
|
||||
stdinTTY := forceTTY || (isTerminal(os.Stdin.Fd()))
|
||||
stdoutTTY := forceTTY || (isTerminal(os.Stdout.Fd()))
|
||||
|
|
@ -118,14 +118,17 @@ func (s *IOStreams) ColorScheme() *ColorScheme {
|
|||
}
|
||||
|
||||
// StartPager starts an external pager process and redirects Out to its stdin.
|
||||
// It checks FGJ_PAGER, then PAGER, then defaults to "less". If LESS is not
|
||||
// already set, it is set to "FRX" for a good default experience.
|
||||
// It checks FJ_PAGER (or legacy FGJ_PAGER), then PAGER, then defaults to "less".
|
||||
// If LESS is not already set, it is set to "FRX" for a good default experience.
|
||||
func (s *IOStreams) StartPager() error {
|
||||
if !s.isStdoutTTY {
|
||||
return nil
|
||||
}
|
||||
|
||||
pagerCmd := os.Getenv("FGJ_PAGER")
|
||||
pagerCmd := os.Getenv("FJ_PAGER")
|
||||
if pagerCmd == "" {
|
||||
pagerCmd = os.Getenv("FGJ_PAGER")
|
||||
}
|
||||
if pagerCmd == "" {
|
||||
pagerCmd = os.Getenv("PAGER")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue