Skip to content

Add ADR for command-line option handling best practices#8758

Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-1521-opts-handling-docs
Open

Add ADR for command-line option handling best practices#8758
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-1521-opts-handling-docs

Conversation

@tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Nov 30, 2025

Add comprehensive documentation for command-line option handling best practices based on GitHub issue #1521. Includes philosophy, architecture, and step-by-step developer guide.

Fixes: #1521

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • n/a Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.01%. Comparing base (5719027) to head (520964a).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8758      +/-   ##
===========================================
- Coverage    80.02%   80.01%   -0.01%     
===========================================
  Files         1700     1700              
  Lines       188345   188345              
  Branches        73       73              
===========================================
- Hits        150716   150702      -14     
- Misses       37629    37643      +14     

☔ 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.

@tautschnig tautschnig marked this pull request as draft November 30, 2025 22:42
@tautschnig tautschnig force-pushed the fix-1521-opts-handling-docs branch from 110b4ac to affa974 Compare December 2, 2025 03:08
@tautschnig tautschnig marked this pull request as ready for review December 2, 2025 03:08
Copilot AI review requested due to automatic review settings March 10, 2026 12:18
@tautschnig tautschnig force-pushed the fix-1521-opts-handling-docs branch from affa974 to 20ffe00 Compare March 10, 2026 12:18
Copy link

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

Adds a new ADR that documents best practices and architecture for command-line option handling in CBMC, and links it from the ADR index.

Changes:

  • Introduce an ADR covering philosophy, key data structures (cmdlinet, optionst, configt), and a step-by-step guide for adding options
  • Document guidelines for help text, defaults, conflicts, deprecation, and testing
  • Add the new ADR to the ADR README navigation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
doc/ADR/command_line_option_handling.md New ADR documenting CLI option handling patterns and recommendations
doc/ADR/README.md Adds a link to the new command-line option handling ADR

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +235 to +241
#define CBMC_OPTIONS \
OPT_BMC \
"(no-standard-checks)" \
"(my-new-option)" \ // Boolean flag
"(my-valued-option):" \ // Option requiring a value (note the colon)
OPT_FUNCTIONS \
// ... rest of options
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The macro example shows line-continuation backslashes followed by spaces and // comments. In C/C++, a \\ must be the last character on the line to continue a macro; showing it with trailing whitespace/comments is misleading and can cause copy/paste failures. Consider moving the comments to their own preceding lines (or using /* ... */ before the trailing \\) so the \\ is at end-of-line in the example.

Copilot uses AI. Check for mistakes.
Comment on lines +255 to +259
#define OPT_GOTO_CHECK \
"(bounds-check)(pointer-check)(memory-leak-check)" \
"(my-new-check)" // Add here \
"(div-by-zero-check)" \
// ... rest of options
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Same issue as above: the macro continuation example mixes \\ line continuations with end-of-line // comments and alignment spacing. Since \\ must be the final character on the line, this example could lead to incorrect macros if copied. Adjust the formatting so comments don’t appear after a continuation, and keep each continuation backslash at true end-of-line.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +11
## Command-Line Interface

* \subpage command-line-option-handling
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The ADR index appears to use plain \\subpage ... entries (e.g., the existing \\subpage symex-ready-goto) rather than a Markdown bullet list. Consider matching the existing style (remove the * ) to keep the Doxygen/Markdown formatting consistent and avoid differences in rendered structure.

Copilot uses AI. Check for mistakes.
Add comprehensive documentation for command-line option handling
best practices based on GitHub issue diffblue#1521. Includes philosophy,
architecture, and step-by-step developer guide.

Fixes: diffblue#1521
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.

Discussion : best practice for handling (command line) options

4 participants