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

Attention: Patch coverage is 90.90909% with 4 lines in your changes missing coverage. Please review.

Project coverage is 64.24%. Comparing base (d3b28f8) to head (d834432).
Report is 558 commits behind head on develop.

Files with missing lines Patch % Lines
src/gui/PasswordGeneratorWidget.cpp 50.00% 3 Missing ⚠️
src/core/PasswordGenerator.cpp 96.67% 1 Missing ⚠️
Additional details and impacted files
@@             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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@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
@phoerious phoerious added pr: new feature Pull request that adds a new feature and removed new feature labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: CLI pr: new feature Pull request that adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants