Skip to content

Commit

Permalink
Readme and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dlesbre committed Feb 20, 2024
1 parent b50e603 commit ece9c28
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ narrow down the list of sources if some aren't relevant using command line optio
- [Dependencies](#dependencies)
- [Usage](#usage)
- [Command line arguments](#command-line-arguments)
- [Specifying output](#specifying-output)
- [Query filtering](#query-filtering)
- [New field formatting](#new-field-formatting)
- [Global output formatting](#global-output-formatting)
Expand Down Expand Up @@ -208,6 +209,11 @@ to respond and slow `btac`.

## Command line arguments

As `btac` has a lot of option I'd recommend setting up an alias if you use a lot
regularly.

### Specifying output

- `-o --output <file.bib>`

Write output to given file. Can be used multiple times when also giving
Expand All @@ -218,6 +224,13 @@ to respond and slow `btac`.
`db2.bib` and `db3.bib`, and write their outputs to `out1.bib`, `out2.bib`
and `db3.btac.bib` respectively.

- `-i --inplace` Modify input files inplace, ignores any specified output files.
Avoid on non backed-up/version-controlled files, I'd hate it if my script
corrupted your data.

- `-O --no-output` don't write any output files (except the one specified by `--dump-data`)
can be used with `-v/--verbose` mode to only print a list of changes to the terminal

### Query filtering

- `-q --only-query <site>` or `-Q --dont-query <site>`
Expand Down Expand Up @@ -306,9 +319,6 @@ are a few options you can use to control the output format:

### Optional flags

- `-i --inplace` Modify input files inplace, ignores any specified output files.
Avoid on non backed-up/version-controlled files, I'd hate it if my script
corrupted your data.
- `-p --prefix` Write new fields with a prefix. The script will add `BTACtitle =
...` instead of `title = ...` in the bib file. This can be combined with `-f`
to safely show info for already present fields.
Expand All @@ -317,6 +327,12 @@ are a few options you can use to control the output format:
without the `-f` option.
- `-f --force-overwrite` Overwrite already present fields. The default is to
overwrite a field only if it is empty or absent
- `-D --diff` only print the new fields in the output file. In this mode, old
fields are removed and entries with no new fields are deleted. This cannot be
used with the `-i --inplace` flag for safety reasons. If you really want to overwrite
your input file (and delete a bunch of data in the process), you can do so with
by specifying it explicitly via the `-o --output` option.

- `-t --timeout <float>` set timeout on request in seconds, default: 20.0 s,
increase this if you are getting a lot of timeouts. Set it to -1 for no timeout.
- `-S --ignore-ssl` bypass SSL verification. Use this if you encounter the error:
Expand Down Expand Up @@ -355,9 +371,6 @@ are a few options you can use to control the output format:
]
```

- `-O --no-output` don't write any output files (except the one specified by `--dump-data`)
can be used with `-v/--verbose` mode to only print a list of changes to the terminal

- `-v --verbose` verbose mode shows more info. It details entries as they are
being processed and shows a summary of new fields and their source at the end.
Using it more than once prints debug info (up to four times).
Expand Down
2 changes: 1 addition & 1 deletion bibtexautocomplete/core/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def write_dumps(self, path: Path) -> None:

def write(self, files: List[Path]) -> None:
"""Writes the databases in self to the given files
If not enough files, extra databases are written to stdout
If not enough files, an error is raised.
If too many files, extras are ignored"""
self.write_header()
total = len(self.bibdatabases)
Expand Down

0 comments on commit ece9c28

Please sign in to comment.