mirror of
https://github.com/restic/restic.git
synced 2024-12-26 17:57:50 +00:00
generate: write progress to STDOUT if this is a terminal
This allows usage as: eval "$(restic generated --bash-completion /dev/stdout)"
This commit is contained in:
parent
bdcafbc11c
commit
087cf7e114
1 changed files with 12 additions and 4 deletions
|
@ -63,22 +63,30 @@ func writeManpages(dir string) error {
|
|||
}
|
||||
|
||||
func writeBashCompletion(file string) error {
|
||||
Verbosef("writing bash completion file to %v\n", file)
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing bash completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenBashCompletionFile(file)
|
||||
}
|
||||
|
||||
func writeFishCompletion(file string) error {
|
||||
Verbosef("writing fish completion file to %v\n", file)
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing fish completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenFishCompletionFile(file, true)
|
||||
}
|
||||
|
||||
func writeZSHCompletion(file string) error {
|
||||
Verbosef("writing zsh completion file to %v\n", file)
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing zsh completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenZshCompletionFile(file)
|
||||
}
|
||||
|
||||
func writePowerShellCompletion(file string) error {
|
||||
Verbosef("writing powershell completion file to %v\n", file)
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing powershell completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenPowerShellCompletionFile(file)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue