diff options
author | Alejandro Gallo <aamsgallo@gmail.com> | 2018-09-17 11:37:29 +0200 |
---|---|---|
committer | Alejandro Gallo <aamsgallo@gmail.com> | 2018-09-17 11:37:29 +0200 |
commit | 6fd3cf6e81fa540f2cdccc995bdb84574cdb07ce (patch) | |
tree | dc292d2d64618783603df69ecd5d99935c4e118b | |
parent | 8e14b550f80f260486cad35b0c3fd3cb705308be (diff) |
Add papis format to update
-rw-r--r-- | papis/commands/update.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/papis/commands/update.py b/papis/commands/update.py index d07bd3ad..673ad611 100644 --- a/papis/commands/update.py +++ b/papis/commands/update.py @@ -21,6 +21,18 @@ Examples papis update --from-bibtex libraryfile.bib -i +- Tag all einstein papers with the tag classics + + .. code:: + + papis update --all --set tags classics einstein + +and add the tag of ``physics`` to all papers tagged as ``classics`` + + .. code:: + + papis update --all --set tags '{doc[tags]} physics' einstein + Cli ^^^ .. click:: papis.commands.update:cli @@ -119,7 +131,8 @@ def run(document, data=dict(), interactive=False, force=False): ) @click.option( "-s", "--set", - help="Update document's information with key value", + help="Update document's information with key value." + "The value can be a papis format.", multiple=True, type=(str, str), ) @@ -156,7 +169,9 @@ def cli( from_isbnplus = None if set: - data.update({s[0]: s[1] for s in set}) + data.update( + {s[0]: papis.utils.format_doc(s[1], document) for s in set} + ) if auto: if 'doi' in document.keys() and not from_doi: |