-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding command-line utility #8
Conversation
import subprocess | ||
import argparse | ||
import json | ||
import tldextract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing package dep in setup.py. here?
python-keepassxc-browser/setup.py
Line 7 in 610ea63
install_requires=[ |
Also, can we avoid this dep?
Hmm, I have mixed feelings about this. Wouldn't it be a better idea to maintain this separately? The library is specifically NOT a commandline client (loads of options there iirc?), but something that's easy to use in scripts. Also see the comments. And sorry for the long wait :( |
|
||
def main(): | ||
argument_parser = argparse.ArgumentParser(description="Fetch credentials from a running KeepassXC instance") | ||
argument_parser.add_argument('url') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc?
|
||
extract_result = tldextract.extract(url) | ||
|
||
# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the thought process here? You try to do some sensible matching on the url? What usecase are you covering? At least this needs to be documented (see below @argparse) somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is in parts from the qutebrowser scripts for old KeePass. The idea is, if no match is found for the given domain, to search 'upward' the tree of subdomains, up to the last before the TLD.
That view is of certainly reasonable. It's just that when I found the lib, I also noticed the tickets asking for a CLI utility. As I needed one myself, I created this and then thought I could share it. Actually I don't have an opinion on whether it should be included with the lib or not. It's just an offer, nothing more. |
As there seem to be more people interested in this (#1), I would offer to donate my CLI utility for this library.