-
Notifications
You must be signed in to change notification settings - Fork 382
Add -s
to pg:backups public-url
so people feel better about scripting
#1495
Conversation
If we add this, we should probably call this |
Could also move the text to stderr |
Incidentally, the linked TTY stuff is pretty straightforward (if not intuitive): a child process inherits stdin, stdout, and stderr from its parent. So it doesn't really matter where you're calling a process--only how you're redirecting output. So if you're going to be using the output somewhere that's not a TTY (e.g., redirecting it to another command, storing it in a variable, or using the output of a subshell invocation directly), it should just work correctly. |
@uhoh-itsmaciek , I changed it to quiet. (I didn't like suppress anyway.) @will re: our discussion in HipChat: I agree this isn't necessary because of the TTY stuff. But we've had That said, if consensus is that this is a bad idea, I'm happy to trash it. |
@chadbailey59 there are far worse command flags out there =) I guess people may have incorrectly assumed that the extra quotes in the old command's output wouldn't break anything (when in fact things were not-breaking because of the special If it reduces support burden, I'm all for it. One could conceivably want terse output even if output is a TTY (say, to more easily copy and paste into something). |
@@ -39,6 +39,7 @@ def copy | |||
# capture DATABASE # capture a new backup | |||
# restore [[BACKUP_ID] DATABASE] # restore a backup (default latest) to a database (default DATABASE_URL) | |||
# public-url BACKUP_ID # get secret but publicly accessible URL for BACKUP_ID to download it | |||
# -q, --quiet # Hide expiration message (for use in scripts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't appear to be in the right place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, nevermind, it is
Add `-s` to `pg:backups public-url` so people feel better about scripting
This adds an option to force hiding the "This link will expire in..." text from
pg:backups public-url
. This isn't entirely necessary, as we already check for TTY, but ruby can be tricky with that sometimes anyway. I'll be able to shut up more than a few support tickets with this.