Skip to content

feat: updated command line parser and tests - #2

Merged
ajeetsinghyadav merged 1 commit into
mainfrom
VNE_UTILS_COMMOND_LINE
Aug 12, 2026
Merged

ajeetsinghyadav merged 1 commit into
mainfrom
VNE_UTILS_COMMOND_LINE

Conversation

@ajeetsinghyadav

@ajeetsinghyadav ajeetsinghyadav commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Command-line options now behave consistently when accessed through either their canonical names or registered aliases.
    • Values provided using short or long aliases are correctly shared and retrievable, including -w=value syntax.
    • Repeated option values are now returned consistently regardless of which recognized name was used.

@ajeetsinghyadav ajeetsinghyadav self-assigned this Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The command-line parser now stores option values under canonical names and resolves registered aliases for isSet, value, and values. Tests cover short aliases, long names, repeated values, and equals-form syntax.

Changes

Canonical Command-Line Option Lookup

Layer / File(s) Summary
Canonical name resolution
include/vertexnova/utils/command_line_parser.h, src/command_line_parser.cpp
The parser stores values under primary option names. Lookup methods resolve aliases through canonicalOptionName. The API documentation describes canonical and alias lookup.
Alias lookup validation
tests/command_line_parser_test.cpp
Tests verify shared state and values across short and long aliases, including repeated values and -w=value syntax.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the command-line parser and related tests, although it does not specify alias canonicalization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch VNE_UTILS_COMMOND_LINE

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/command_line_parser_test.cpp (1)

434-436: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test values with the registered alias.

values("-w") is part of the public alias contract, but this test only queries "--window". Add an alias assertion to detect regressions in alias normalization for values.

Proposed test addition
     auto window_vals = parser.values("--window");
     EXPECT_EQ(window_vals.size(), 1);
     EXPECT_EQ(window_vals[0], "1920x1080");
+    auto window_alias_vals = parser.values("-w");
+    EXPECT_EQ(window_alias_vals.size(), 1);
+    EXPECT_EQ(window_alias_vals[0], "1920x1080");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/command_line_parser_test.cpp` around lines 434 - 436, Extend the test
around parser.values("--window") to also query the registered "-w" alias and
assert it returns the same single "1920x1080" value, verifying alias
normalization for values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/command_line_parser_test.cpp`:
- Around line 434-436: Extend the test around parser.values("--window") to also
query the registered "-w" alias and assert it returns the same single
"1920x1080" value, verifying alias normalization for values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c4c5a7a5-719d-4a2b-937b-787035cec831

📥 Commits

Reviewing files that changed from the base of the PR and between ae29699 and 3f140db.

📒 Files selected for processing (3)
  • include/vertexnova/utils/command_line_parser.h
  • src/command_line_parser.cpp
  • tests/command_line_parser_test.cpp

@vertexnova vertexnova deleted a comment from cursor Bot Aug 12, 2026
@ajeetsinghyadav
ajeetsinghyadav merged commit 654c0c7 into main Aug 12, 2026
10 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

Development

Successfully merging this pull request may close these issues.

1 participant