Skip to content

util: take circuit path as CLI arg instead of hardcoding - #129

Draft
midasbal wants to merge 1 commit into
alpenlabs:mainfrom
midasbal:fix/issue-14-cli-paths
Draft

midasbal wants to merge 1 commit into
alpenlabs:mainfrom
midasbal:fix/issue-14-cli-paths

Conversation

@midasbal

Copy link
Copy Markdown

Description

Both binaries in util/ hardcoded the input circuit path
(/Users/user/g16.ckt), so choosing a different circuit file meant editing the
source and recompiling. This changes bench and dupecheck to take the circuit
file path as a required positional CLI argument instead.

  • Add a clap-derived Cli with one positional input: PathBuf to each binary.
  • clap was already a workspace dependency, so it is just added to the two
    crates' [dependencies]; no new dependency is introduced.
  • No logic changes; START/NUM and the rest of each tool are untouched.

Usage:

bench <INPUT>
dupecheck <INPUT>

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Notes to Reviewers

Per the issue, the remaining hardcoded paths were in util/bench and
util/dupecheck; this covers both.

Two disclosures:

  • AI: I used Claude (Claude Code) to analyze the issue and author this patch,
    and to help draft this description. I reviewed the change myself.
  • I did not build or run the test suite locally, so I am relying on CI to
    confirm formatting, clippy, and tests. The two checklist items about warnings
    and tests are left unchecked until CI verifies them.

I used a positional argument rather than an --input flag since there is a
single required input; happy to switch to a flag if you'd prefer.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

Closes #14

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.

Accept file paths are command line inputs (CLI) instead of hardcoding them

1 participant