andersju / zzzfoo

Full-text desktop search with Rofi+Recoll
GNU General Public License v2.0
121 stars 8 forks source link

Cannot pass certain arguments to Rofi #1

Closed hallgchris closed 6 years ago

hallgchris commented 6 years ago

First off, brilliant little script! Loving it so far.

For some reason, I can't pass the argument -i to Rofi to disable case sensitivity. The exact command I tried was zzzfoo -r '-i'. zzzfoo outputs the following:

usage: zzzfoo [-h] [-c RECOLL_CONFDIR] [-e QUERY_EXTRA] [-i EXTRA_DBS]
              [--no-abstract] [--synthetic-abstract] [-n NUM_RESULTS]
              [-o OPEN_WITH] [-q QUERY_STRING] [-r ROFI_OPTIONS]
              [-p STRIP_PATH] [-x] [--color-abstract COLOR_ABSTRACT]
              [--color-file-info COLOR_FILE_INFO] [--color-path COLOR_PATH]
              [--color-title COLOR_TITLE]
zzzfoo: error: argument -r/--rofi-options: expected one argument

The example from the readme zzzfoo -r '-location 3 -width 50' works fine.

andersju commented 6 years ago

I believe it has to do with how Python's argparse module handles things. Not sure if there's a nice way to fix it, but a workaround is to use a leading space: zzzfoo -r ' -i' Or do it like this: zzzfoo -r="-i" I'll update the help to suggest this. Thanks!