cmd: add --progress-terminal-title to print ETA to terminal title
Adds a flag, --progress-terminal-title, that when used with --progress, will print the string `ETA: %s` to the terminal title. This also adds WriteTerminalTitle to lib/terminal
This commit is contained in:
parent
6dc28ef50a
commit
aac2406e19
8 changed files with 33 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
package terminal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
|
@ -29,3 +30,8 @@ func IsTerminal(fd int) bool {
|
|||
func ReadPassword(fd int) ([]byte, error) {
|
||||
return terminal.ReadPassword(fd)
|
||||
}
|
||||
|
||||
// WriteTerminalTitle writes a string to the terminal title
|
||||
func WriteTerminalTitle(title string) {
|
||||
fmt.Printf(ChangeTitle + title + BEL)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue