Skip to content

Refactor CLI encryption handling and improve command options - #23

Merged
zombocoder merged 2 commits into
mainfrom
fix/cli-options-extract-paths
Oct 24, 2026
Merged

zombocoder merged 2 commits into
mainfrom
fix/cli-options-extract-paths

Conversation

@zombocoder

@zombocoder zombocoder commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner
  • Updated cmd_create.c, cmd_extract.c, and cmd_verify.c to replace direct encryption password and keyfile handling with a new cli_credentials_t structure for better encapsulation and management of encryption options.
  • Changed command-line options for encryption to use -p/--password, --password-file and -K/--keyfile in create, extract and verify. In create, the old -e/--encrypt and the short -k still work but are deprecated and print a warning. --keyfile stays the main key-file option.
  • Enhanced help messages to reflect the new command options and provide clearer usage examples.
  • Implemented checks to ensure that both password and keyfile cannot be specified simultaneously.
  • Added end-to-end tests for the CLI to validate the new encryption handling and ensure proper functionality of the extract command with symlink safety checks.
  • Introduced a new test helper make_symlink_parent to facilitate testing of symlink behavior in the CLI.
  • Updated the CMake configuration to include new CLI tests and ensure proper linking of dependencies.

Closes #18
Closes #19

- Updated `cmd_create.c`, `cmd_extract.c`, and `cmd_verify.c` to replace direct encryption password and keyfile handling with a new `cli_credentials_t` structure for better encapsulation and management of encryption options.
- Changed command-line options for encryption to use `--password` and `--keyfile`, while deprecating the old `--encrypt` and `--keyfile` options.
- Enhanced help messages to reflect the new command options and provide clearer usage examples.
- Implemented checks to ensure that both password and keyfile cannot be specified simultaneously.
- Added end-to-end tests for the CLI to validate the new encryption handling and ensure proper functionality of the `extract` command with symlink safety checks.
- Introduced a new test helper `make_symlink_parent` to facilitate testing of symlink behavior in the CLI.
- Updated the CMake configuration to include new CLI tests and ensure proper linking of dependencies.
@zombocoder
zombocoder merged commit ceb9904 into main Oct 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant