Tweak command-line interface to take string query by default
hrs opened this issue · comments
When I started writing docsim
I'd thought of it as a tool for comparing documents (hence doc
ument sim
ilarity). But I'd been thinking of "documents" as "files," not as abstract blobs of text including queries, so I added a --query
flag that took a file, not a string.
Currently:
--query
takes a path argument- passing in a string query only works through
STDIN
.
Ideally, we'd have something like:
- the first positional argument is always a string query, unless either:
- there's a Boolean
--stdin
flag (or something like-
, mirroring its use ingrep
), in which case we read fromSTDIN
, or - there's a string flag
--file
or--input
(or even leave it at--query
) that takes a file and acts in the current way.
- there's a Boolean
The usage lines in the man
page would look something like:
docsim [OPTION...] QUERY [PATH...]
command | docsim [OPTION...] --stdin [PATH...]
docsim [OPTION...] --file PATH [PATH...]