Skip to content

Improve CLI Show and Clip Commands #12083

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

droidmonkey
Copy link
Member

  • Fixes CLI Show does not output attributes named uuid or tags #11767
  • When requesting TOTP, only output that value and then exit
  • Add explicit requests for UUID and Tags for both show and clip commands.
  • When showing all values, also include UUID and Tags.
  • Only hide the attribute names when specifically requesting them by name

Testing strategy

Tested new commands manually

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)
  • ✅ New feature (change that adds functionality)

@droidmonkey droidmonkey added this to the v2.8.0 milestone May 10, 2025
@droidmonkey droidmonkey requested review from louib and Copilot May 10, 2025 13:32
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the CLI commands for showing and clipping entry attributes by adding explicit options for UUID and tags, adjusting the behavior when requesting TOTP, and updating the output to include UUID and tags based on command-line options.

  • Remove top‑level attribute getters from Utils to favor explicit handling in show/clip.
  • Introduce new QCommandLineOption options for UUID and tags in both commands.
  • Update docs to reflect new functionality and clarify behavior when selecting multiple options.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

File Description
src/cli/Utils.h & Utils.cpp Removed unused static field definitions and getTopLevelField function.
src/cli/Show.h & Show.cpp Modified show command to handle explicit UUID and tags options and TOTP exit.
src/cli/Clip.h & Clip.cpp Modified clip command to support UUID and tags options and updated error handling.
docs/man/keepassxc-cli.1.adoc Updated documentation to describe new options and behavior changes.
Comments suppressed due to low confidence (1)

src/cli/Clip.cpp:130

  • [nitpick] The change from "totp" to "TOTP" alters the casing of the attribute identifier. Ensure that this change is intentional and that it remains consistent across all related commands.
selectedAttribute = "TOTP";

@louib
Copy link
Member

louib commented May 10, 2025

@droidmonkey is this ready to review? CI is failing

* Fixes #11767
* When requesting TOTP, only output that value and then exit
* Add explicit requests for UUID and Tags for both show and clip commands.
* When showing all values, also include UUID and Tags.
* Only hide the attribute names when specifically requesting them by name
Copy link

codecov bot commented May 18, 2025

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 63.88%. Comparing base (f53c7e5) to head (87ccc85).

Files with missing lines Patch % Lines
src/cli/Clip.cpp 88.89% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12083      +/-   ##
===========================================
- Coverage    63.88%   63.88%   -0.00%     
===========================================
  Files          369      369              
  Lines        38938    38946       +8     
===========================================
+ Hits         24875    24880       +5     
- Misses       14063    14066       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

CLI Show does not output attributes named uuid or tags
2 participants