Skip to content
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

Merged
merged 1 commit into from
Jun 28, 2019

Conversation

mdujava
Copy link
Contributor

@mdujava mdujava commented Oct 17, 2018

If an option takes the path, run expanduser so '~' will be expanded to correct directory.
Fixing #42.

Signed-off-by: Matej Dujava [email protected]

Copy link
Owner

@jaymzh jaymzh left a 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:
Copy link
Owner

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',
Copy link
Owner

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 = [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about --mail-text ?

@jaymzh jaymzh added the waitingonsubmitter Waiting on the sbumitter label Jun 28, 2019
@jaymzh
Copy link
Owner

jaymzh commented Jun 28, 2019

Ping?

@mdujava mdujava force-pushed the expand_user_in_path branch from 94759ba to 70881cc Compare June 28, 2019 15:05
@mdujava
Copy link
Contributor Author

mdujava commented Jun 28, 2019

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.

@jaymzh jaymzh merged commit ef13e7f into jaymzh:master Jun 28, 2019
@jaymzh jaymzh removed the waitingonsubmitter Waiting on the sbumitter label Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants