aslpavel / sweep-rs

Sweep is a tool for interactive search through a list of entries. It is inspired by fzf.
MIT License
21 stars 0 forks source link

[request] more examples in the README #3

Open salahoued opened 1 month ago

salahoued commented 1 month ago

I've come across this project by pure chance, after looking into the pywayland project, I was looking for a rusty fzf to replace the now dormant skim, it was happy surprise for me.

I can see that sweep offers good functionalities the like of which fzf has, but I couldn't get some to work for me, like the --preview option, I couldn't find the proper way for it to work. Is it like fzf: --preview 'bat {}' or is there any other way.

I tried to run the demo python -msweep demo, it didn't work

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 159, in _get_module_details
  File "<frozen importlib._bootstrap_external>", line 1074, in get_code
  File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/salo/Documents/sweep-rs/sweep/sweep/sweep.py", line 126
    class SweepSelect[I]:
                     ^
SyntaxError: invalid syntax

From this output I couldn't figure out the problem, is it some dependency missing?

I use opensuse Tumblweed and python-3.11

Thank for all your hard work, you've put into this utility

aslpavel commented 2 weeks ago
salahoued commented 2 weeks ago

Thanks again for your hard work; Yes, it works just fine.

For a fun story, I pulled the latest git version, compiled with cargo and run the example ls | sweep --preview 'cat {}', and got : Error parsing option '--preview' with value 'cat {}': provided string was not true or false. wandering why it didn't work was about to report it, until I remembered that I did run it with old version. :)

Last, I couldn't start the demo again with python3.12 -msweep demo, I got:

usage: sweep.py [-h] [-p PROMPT] [--prompt-icon PROMPT_ICON] [--query QUERY] [--nth NTH] [--delimiter DELIMITER] [--theme THEME] [--scorer SCORER] [--tty TTY] [--height HEIGHT]
                [--sweep SWEEP] [--json] [--no-match {nothing,input}] [--keep-order] [--input INPUT] [--tmp-socket] [--log LOG] [--border BORDER]
sweep.py: error: unrecognized arguments: demo

And I tried ls | python3.12 -msweep and did run correctly.

Thanks again.

aslpavel commented 2 weeks ago

To run the demo you need to run it from sweep-py directory

salahoued commented 2 weeks ago

Sorry about that,