-
Notifications
You must be signed in to change notification settings - Fork 26
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
libpius: expand user '~' in options #108
Conversation
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.
Sorry for the delay, I missed this PR somehow.
@@ -84,6 +91,8 @@ def parse_dotfile(parser): | |||
parts = sep.split(line.strip()) | |||
if not parts[0].startswith('--'): | |||
parts[0] = '--%s' % parts[0] | |||
if parts[0] in EXPAND_USER_OPTIONS and len(parts) > 1: | |||
parts[1] = os.path.expanduser(parts[1]) | |||
if parser.has_option(parts[0]): | |||
opts.extend(parts) | |||
elif not parts[0] in VALID_OPTIONS: |
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.
I know I wrote this code, but... I also, dunno what the point is.
If it's a valid option, then parser.has_option
will be true, and if not, it's not a valid option... so we should get ride of VALID_OPTIONS
altogether, and just make this an else
, I think... you don't have to do that in this PR, just... happened to notice this.
@@ -25,6 +25,7 @@ | |||
'--interactive', | |||
'--all-keys', | |||
'--gpg-agent', | |||
'--gpg-path', |
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.
this ... doesn't do anything afaict. See other comment.
@@ -37,6 +38,12 @@ | |||
'--policy-url', | |||
'--verbose', | |||
] | |||
EXPAND_USER_OPTIONS = [ |
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.
how about --mail-text
?
Ping? |
Signed-off-by: Matej Dujava <[email protected]>
94759ba
to
70881cc
Compare
Hi, sorry I missed that one option, updated. abut that VALID_OPTIONS, yeah, it might be leftover before moving to argparse or something like that. |
If an option takes the path, run expanduser so '~' will be expanded to correct directory.
Fixing #42.
Signed-off-by: Matej Dujava [email protected]