Closed davidshen84 closed 1 year ago
You're right. That's a bit unsettling, isn't it? I think the -R implementation should be changed as you said. Do you want to make a PR? Or do I do it? :)
I think one line would do.
return ''.join(map(lambda w: choose_delimiter(delimiters) + w, words))[:-1]
I have not tested it. I will create a PR tonight if you have not fixed it already.
Do you plan to merge it, or is it not worth the change?
I don't have commit rights on this repo ;)
I'll continue the conversation at #151
Closing this as the PR is merged, thank you both!
With
-d
, delimiters are inserted between the wordsre. https://github.com/redacted/XKCD-password-generator/blob/master/xkcdpass/xkcd_password.py#L343C24-L343C24
With
-R
, delimiters are inserted at the beginning, the end and between the wordsre. https://github.com/redacted/XKCD-password-generator/blob/master/xkcdpass/xkcd_password.py#L366
I wonder if it is implement like so intentionally. I think
-R
should only insert delimiters between the words.