-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minor REPL enhancements #233
base: master
Are you sure you want to change the base?
minor REPL enhancements #233
Conversation
do_exit if line.nil? | ||
puts line unless $stdin.tty? |
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.
what's the intention here?
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.
Ah, I see from your comment you want output when it's used in a pipe. I personally think this should be off by default, but it's a nice command-line option. For Postgres' psql it's the "-a" option, for example.
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.
Yeah, it's a nice REPL feature. I don't see why a flag would be useful, though. Is there a reason someone wouldn't want the output?
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.
Well, if you're writing a pipe it's not necessarily nice to have things in the middle dumping stuff to stdout. As another example, there's tar -v. I'm old (from when cp was braindead) so I often run things like "tar cf - . | (cd /foo/bar; tar xf -)". I definitely don't want both of the tar calls to dump the file list, and in many cases I don't want either one to do so. But I agree that it's a useful flag.
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.
But who's using REPL output as the input to a pipe? Again, I don't think there's a use case that would prefer the input not to be echoed, so no need for a flag. At least not one that's off by default.
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.
It's not clear to me that you always (or usually) want to see rebl input lines on stdout any more than you'd want to see inbound network messages on stdout. If your goal is to control bud from a command line script and see what it does, it's not clear whether you want that control logic in the output.
Anyway, I'm very open to a command-line flag on this; we can ponder what the right default is but the important thing is to enable what you're asking for here.
Full list of changes in line number order:
$stdout