Skip to content

[cli] Make all short names upper cases + Enable pipe mode and file mode#203

Merged
forfudan merged 4 commits intodevfrom
cli
Apr 11, 2026
Merged

[cli] Make all short names upper cases + Enable pipe mode and file mode#203
forfudan merged 4 commits intodevfrom
cli

Conversation

@forfudan
Copy link
Copy Markdown
Owner

@forfudan forfudan commented Apr 11, 2026

This PR updates the Decimo CLI to avoid short-flag collisions with negative expressions by uppercasing short options, and adds new stdin (pipe) + file-based input modes for evaluating multiple expressions.

Changes:

  • Uppercase short flags for formatting/computation options (-P/-S/-E/-D/-R) and remove the --pad short flag to prevent collisions with expressions like -e, -pi, -sin(1).
  • Add pipe mode (read/evaluate expressions from stdin, one per non-empty non-comment line) and file mode (-F/--file).
  • Extend integration/unit tests and update docs/changelog/plans for the new CLI UX.

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

Updates the Decimo CLI to avoid short-flag collisions with negative expressions by uppercasing short options, and adds new input modes for evaluating expressions from stdin (pipe) and from a file.

Changes:

  • Uppercase all short option names (-P/-S/-E/-D/-R) and remove the --pad short flag to prevent collisions with expressions like -e, -pi, -sin(1).
  • Add pipe mode (read/evaluate expressions from stdin, one per line) and file mode (evaluate expressions from a -F/--file path).
  • Extend integration + unit tests and update CLI documentation/changelog to reflect the new UX.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_cli.sh Updates short flags and adds integration coverage for pipe mode and -F/--file mode.
tests/cli/test_io.mojo Adds unit tests for new I/O helpers (line splitting, comment stripping, etc.).
src/cli/main.mojo Implements mode detection (expr vs pipe vs file), new -F/--file option, and updated short flags.
src/cli/calculator/io.mojo Introduces stdin/file reading and line-processing utilities used by pipe/file modes.
src/cli/calculator/init.mojo Re-exports new I/O utilities from the calculator package.
docs/user_manual_cli.md Documents new short flags and adds an “Input Modes” section.
docs/plans/cli_calculator.md Updates CLI plan/status to mark pipe/file input and uppercase short flags as implemented.
docs/changelog.md Notes pipe mode + file mode additions under “Unreleased”.

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

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 to avoid short-flag collisions with negative expressions by uppercasing short options, and adds new stdin (pipe) + file-based input modes for evaluating multiple expressions.

Changes:

  • Uppercase short flags for formatting/computation options (-P/-S/-E/-D/-R) and remove the --pad short flag to prevent collisions with expressions like -e, -pi, -sin(1).
  • Add pipe mode (read/evaluate expressions from stdin, one per non-empty non-comment line) and file mode (-F/--file).
  • Extend integration/unit tests and update docs/changelog/plans for the new CLI UX.

Reviewed changes

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

Show a summary per file
File Description
tests/test_cli.sh Updates integration tests for new short flags; adds pipe/file mode integration coverage.
tests/cli/test_io.mojo Adds unit tests for new I/O helpers (splitting, comment stripping, etc.).
src/cli/main.mojo Implements new input mode detection and pipe/file execution paths; updates CLI flags and help tips.
src/cli/calculator/io.mojo Introduces stdin/file reading helpers and line filtering utilities for pipe/file mode.
src/cli/calculator/init.mojo Re-exports the new calculator I/O utilities.
docs/user_manual_cli.md Updates option reference and documents the three input modes + new flag casing.
docs/plans/cli_calculator.md Updates plan/status notes to reflect completed pipe/file mode and new short flags.
docs/changelog.md Adds unreleased changelog entries describing pipe/file mode additions.

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

@forfudan forfudan merged commit 2c484de into dev Apr 11, 2026
11 checks passed
@forfudan forfudan deleted the cli branch April 11, 2026 18:24
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