forked from borgbackup/borg
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor yes(), cleanup env var semantics, fixes borgbackup#355
refactorings: - introduced concept of default answer: if the answer string is in the defaultish sequence, the return value of yes() will be the default. e.g. if just pressing <enter> when asked on the console or if an empty string or "default" is in the environment variable for overriding. if an environment var has an invalid value and no retries are enabled: return default if retries are enabled, next retry won't use the env var again, but either ask via input(). - simplify: only one default - this should be a SAFE default as it is used in some special conditions like EOF or invalid input with retries disallowed. no isatty() magic, the "yes" shell command exists, so we could receive input even if it is not from a tty. - clean: separate retry flag from retry_msg
- Loading branch information
1 parent
968a1c3
commit 368fbcb
Showing
7 changed files
with
109 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters