Bugswriter/tuxi

Raw output not sanitizing errors

Closed this issue · 11 comments

Not really an issue because this behavior is caused by options ordering. -r before query does work correctly.

Leaving this open anyway to see if there's a change that can allow flags on either side

  • zsh
  • Arch Linux:
  • GNOME Terminal:
  • echo $TERM = xterm-256color

Steps to Reproduce the Problem

  • tuxi -r "Barack Obama" -> No Result! (in red)
  • tuxi -rq "Barack Obama" -> No Result! (in red)

Expected Behavior

No Result! in plaintext

Actual Behavior

Screenshot from 2021-02-18 13-32-33

i dont remember who wrote the text formatting, but lets just wait for him to read this and fix it xd.

You have search
tuxi -r <query>
not
tuxi <query> -r

Tuxi treats -r as a part of the query if its after the query

@colonvirus you're totally right. My bad for not checking that. Might leave this open to remind myself to see if there's any workaround to that

You have search
tuxi -r <query>
not
tuxi <query> -r

Tuxi treats -r as a part of the query if its after the query

You are right but why he is getting No result for barak obama?

You are right but why he is getting No result for barak obama?

That seemed like a fluke It spit out a result when I used tux -rq "Barack Obama"
Screenshot from 2021-02-18 13-43-13

You are right but why he is getting No result for barak obama?

Cuz tuxi treats the query as "Barack Obama -r",
which doesn't give the above result in google

Fixing this would mean removing all arguments after the query, that have a hyphen in it
Seems doable but messy

Sanitizing options with arrays would be cleaner, but since arrays aren't posix, it would be messy

You are right but why he is getting No result for barak obama?

Cuz tuxi treats the query as "Barack Obama -r",
which doesn't give the above result in google

But we are using quotation :(
That's not good
But I think .. that's not a big issue.

query="$*"
this gobbles up everything after the options

oh yes. This is one of my code. LOL. you guys really changed the script so much.
This is not a big issue .. if user use things incorrectly .. he deserve to get punished with No result.