papertrail / papertrail-cli

Command-line client for Papertrail hosted syslog & app log management service
http://papertrailapp.com/
MIT License
426 stars 46 forks source link

Allow quoteless query #76

Closed DannyBen closed 8 years ago

DannyBen commented 8 years ago

Following a short discussion I had with Mark on the subject, wanted to see if this actually works.

This tiny PR allows running

$ papertrail any search string

In addition to the quoted version already available:

$ papertrail "any search string"

There are no tests, so it is hard for me to see if this breaks anything, but I believe this is backwards compatible and only adds a nice functionality.

troy commented 8 years ago

@DannyBen: when you run

papertrail any search string

.. with what's in master, what do you get? That should work today and does for me with bash. If it doesn't, can you paste the output?

markdascher commented 8 years ago

@troy: It actually doesn't work. You have to put any search string in quotes, or else it only searches for any. papertrail --help has a usage example:

papertrail 1.2.3 Failure

Implying that the quotes shouldn't be needed. On the other hand, the README has a whole section on quoted phrases, reinforcing the current behavior.

This fix is probably fine, since it just interprets extra parameters that were previously ignored. It doesn't make quoted phrases any less confusing, but that's probably a good thing. (To avoid introducing a breaking change.)

troy commented 8 years ago

Great catch, and good point. Makes sense to me.

@lmarburger will check this sometime next week and if the diff and behavior change make sense to him, merge it.

lmarburger commented 8 years ago

Well we've clearly never tried to run the example queries. I can't believe this hasn't been caught before. Apparently I always quote my queries.

No objections here.