mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +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
@ -63,22 +63,30 @@ func writeManpages(dir string) error {
|
||||
}
|
||||
|
||||
func writeBashCompletion(file string) error {
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing bash completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenBashCompletionFile(file)
|
||||
}
|
||||
|
||||
func writeFishCompletion(file string) error {
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing fish completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenFishCompletionFile(file, true)
|
||||
}
|
||||
|
||||
func writeZSHCompletion(file string) error {
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing zsh completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenZshCompletionFile(file)
|
||||
}
|
||||
|
||||
func writePowerShellCompletion(file string) error {
|
||||
if stdoutIsTerminal() {
|
||||
Verbosef("writing powershell completion file to %v\n", file)
|
||||
}
|
||||
return cmdRoot.GenPowerShellCompletionFile(file)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user