aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-06-01 08:22:05 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-06-01 08:22:05 -0300
commitb75561585c6269196a3ffa8713621bb377f39fa8 (patch)
tree4aabfdc2887fe8c6fe6f94cb0c8c85002159e3bb
parent49869d77725fceebccf7fb54559932cae8026b0e (diff)
downloadscripts-b75561585c6269196a3ffa8713621bb377f39fa8.tar.gz
scripts-b75561585c6269196a3ffa8713621bb377f39fa8.tar.bz2
Fix: doi2bib: improved usage line
-rwxr-xr-xdoi2bib3
1 files changed, 2 insertions, 1 deletions
diff --git a/doi2bib b/doi2bib
index 1c26d21..b669737 100755
--- a/doi2bib
+++ b/doi2bib
@@ -1,6 +1,7 @@
#!/usr/bin/python3
# Adapted from https://scipython.com/blog/doi-to-bibtex/
+import os
import sys
import pycurl
from io import BytesIO
@@ -12,7 +13,7 @@ BASE_URL = 'http://dx.doi.org/'
try:
doi = sys.argv[1]
except IndexError:
- print('Usage:\n{} <doi>'.format(sys.argv[0]))
+ print('usage: {} <doi>'.format(os.path.basename(sys.argv[0])))
sys.exit(1)
url = BASE_URL + doi