papis / papis

Powerful and highly extensible command-line based document and bibliography manager.
http://papis.readthedocs.io/en/latest/
GNU General Public License v3.0
1.38k stars 97 forks source link

papis explore citations example command does not work #890

Closed erooke closed 1 month ago

erooke commented 1 month ago

On papis 0.13 the help dialog for papis explore citations gives an invalid example command. Invoking the help command gives a very helpful looking response

> papis explore citations --help
Usage: papis explore citations [OPTIONS] [QUERY]

  Query the citations of a paper

  Example:

  Go through the citations of a paper and export it in a yaml file

      papis explore citations 'einstein' export --format yaml einstein.yaml

Options:
  --doc-folder PATH  Document folder on which to apply action
  -h, --help         Show this message and exit.
  -b, --cited-by     Use the cited-by citations
  -a, --all          Apply action to all matching documents

However running the provided command results in an error.

> papis explore citations 'einstein' export --format yaml einstein.yaml
Usage: papis explore [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Error: No such command 'einstein.yaml'.
> papis --version
papis, version 0.13
erooke commented 1 month ago

The same thing happens with papis explore crossref

> papis explore crossref --help
Usage: papis explore export [OPTIONS]

  Export retrieved documents into various formats for later use

  Examples of its usage are

  papis explore crossref -m 200 -a 'Schrodinger' export --yaml lib.yaml

Options:
  -h, --help                      Show this message and exit.
  -f, --format [bibtex|json|yaml]
                                  Format for the document
  -o, --out PATH                  Outfile to write information to

But running the example command results in an error

> papis explore crossref -m 200 -a 'Schrodinger' export --yaml lib.yaml
Usage: papis explore export [OPTIONS]

Error: No such option: --yaml
alexfikl commented 1 month ago

Thanks for pointing these out! I guess they haven't been updated in a while :\

This should work

papis explore crossref -m 200 -a 'Schrodinger' export --format yaml --out lib.yml

i.e. the output file needs to be given with --out filename.yml. There also hasn't been a--yaml flag for a while.

In general, the "Options" section of the commands is automatically generated from the code, so that should be up to date and accurate. The additional text in there less so, unfortunately :(

alexfikl commented 1 month ago

891 should address the --out issues at least.