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

Add -i/--include option to "generate" CLI command. #7112

Conversation

libklein
Copy link
Contributor

@libklein libklein commented Nov 6, 2021

Currently, it is not possible to include additional character in the "generate" CLI command. This PR fixes this.
It adds -i/--include to the generate cli and sets the additional character set accordingly.
Here, it mimics the behavior of the GUI: The default character set is used if the generator is not constrained otherwise.

Testing strategy

Add two tests to TestCli. First test tests that additional characters are included, second asserts that the default character set is used unless specified otherwise.

Open questions

Type of change

  • ✅ New feature (change that adds functionality)

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2021

Codecov Report

Merging #7112 (d834432) into develop (d3b28f8) will increase coverage by 0.03%.
The diff coverage is 90.91%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #7112      +/-   ##
===========================================
+ Coverage    64.21%   64.24%   +0.03%     
===========================================
  Files          334      334              
  Lines        42221    42194      -27     
===========================================
- Hits         27111    27107       -4     
+ Misses       15110    15087      -23     
Impacted Files Coverage Δ
src/gui/PasswordGeneratorWidget.cpp 69.30% <50.00%> (+2.56%) ⬆️
src/core/PasswordGenerator.cpp 99.56% <96.67%> (+2.14%) ⬆️
src/cli/Generate.cpp 95.95% <100.00%> (+0.29%) ⬆️
src/core/Entry.cpp 83.91% <0.00%> (-0.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3b28f8...d834432. Read the comment docs.

@libklein libklein force-pushed the feature/support-generating-constrained-passwords-on-command-line branch from 030e464 to d834432 Compare November 23, 2021 21:05
src/cli/Generate.cpp Show resolved Hide resolved
src/core/PasswordGenerator.cpp Show resolved Hide resolved
@droidmonkey droidmonkey added this to the v2.7.0 milestone Dec 8, 2021
@droidmonkey droidmonkey merged commit a0a063b into keepassxreboot:develop Dec 8, 2021
t-h-e pushed a commit to t-h-e/keepassxc that referenced this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants