Skip to content

[cli] Enable negative expressions as positional arguments#202

Merged
forfudan merged 2 commits intodevfrom
cli
Apr 10, 2026
Merged

[cli] Enable negative expressions as positional arguments#202
forfudan merged 2 commits intodevfrom
cli

Conversation

@forfudan
Copy link
Copy Markdown
Owner

@forfudan forfudan commented Apr 10, 2026

This PR updates the Decimo CLI argument parsing so expressions that start with - (e.g., negative numbers / negative expressions) can be passed as the positional <EXPR> more naturally, and documents/tests the behavior.

Changes:

  • Enable hyphen-prefixed values for the expr positional argument via ArgMojo (allow_hyphen=True) and remove the older command-level negative-number allowance.
  • Expand CLI integration tests to cover negative expressions, mixed option/positional ordering, and -- separator cases.
  • Add user-manual documentation for “Negative Expressions” and update the CLI calculator plan checklist accordingly.

Copy link
Copy Markdown

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 updates the Decimo CLI argument parsing so expressions that start with - (e.g., negative numbers / negative expressions) can be passed as the positional <EXPR> more naturally, and documents/tests the behavior.

Changes:

  • Enable hyphen-prefixed values for the expr positional argument via ArgMojo (allow_hyphen=True) and remove the older command-level negative-number allowance.
  • Expand CLI integration tests to cover negative expressions, mixed option/positional ordering, and -- separator cases.
  • Add user-manual documentation for “Negative Expressions” and update the CLI calculator plan checklist accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/cli/main.mojo Allows expr positional to start with - and removes allow_negative_numbers() usage.
tests/test_cli.sh Adds integration coverage for negative expressions and option/positional ordering.
docs/user_manual_cli.md Documents negative-expression usage (needs clarification for option-like collisions).
docs/plans/cli_calculator.md Updates planning checklist notes for the new approach (one option name inconsistency).

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

Comment thread tests/test_cli.sh Outdated
Comment thread tests/test_cli.sh Outdated
Comment thread tests/test_cli.sh Outdated
Comment thread docs/user_manual_cli.md
Comment thread docs/user_manual_cli.md Outdated
Comment thread docs/plans/cli_calculator.md Outdated
@forfudan forfudan merged commit 7f51854 into dev Apr 10, 2026
11 checks passed
@forfudan forfudan deleted the cli branch April 10, 2026 22:00
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.

2 participants