You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[cli] Make all short names upper cases + Enable pipe mode and file mode (#203)
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 file name to clipboardExpand all lines: docs/changelog.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,17 @@
2
2
3
3
This is a list of changes for the Decimo package (formerly DeciMojo).
4
4
5
+
## Unreleased - under development
6
+
7
+
### ⭐️ New in v0.10.0
8
+
9
+
**CLI Calculator:**
10
+
11
+
1. Add **pipe/stdin mode**: read expressions from standard input, one per line, when no positional argument is given and stdin is piped (e.g. `echo "1+2" | decimo`, `printf "pi\nsqrt(2)" | decimo -P 100`). Blank lines and comment lines (starting with `#`) are automatically skipped.
12
+
1. Add **file mode**: use `--file` / `-F` flag to evaluate expressions from a file, one per line (e.g. `decimo -F expressions.dm -P 50`). Comments (`#`), inline comments, and blank lines are skipped. All CLI flags (precision, formatting, rounding) apply to every expression.
13
+
14
+
### 🦋 Changed in v0.10.0
15
+
5
16
## 20260323 (v0.9.0)
6
17
7
18
Decimo v0.9.0 updates the codebase to **Mojo v0.26.2** and marks the **"make it useful"** phase. This release introduces three major additions:
| 1.8 | Pipeline / stdin input (`echo "1+2" \| decimo`) |✓|Pipe mode: reads stdin when no positional arg and stdin is not a TTY |
279
+
| 1.9 | File input (`decimo -F file.dm`) |✓| File mode via `-F/--file` flag: reads files line by line, skips comments (#) and blank lines|
280
280
281
281
### Phase 2: Power and Functions
282
282
@@ -328,7 +328,7 @@ Format the final `BigDecimal` result based on CLI flags:
328
328
| 3.13 | Documentation (user manual for CLI) | ✗ |`docs/user_manual_cli.md`; include shell completion setup |
329
329
| 3.14 | Build and distribute as single binary | ✗ ||
330
330
| 3.15 | Allow negative expressions | ✓ |`allow_hyphen=True` on `Positional`; `decimo "-3*pi*(sin(1))"` works |
331
-
| 3.16 | Make short names upper cases to avoid expression collisions |✗|`-sin(1)` clashes with `-s` (scientific), `-e` clashes with `--engineering`|
331
+
| 3.16 | Make short names upper cases to avoid expression collisions |✓|`-P`, `-S`, `-E`, `-D`, `-R`; `--pad` has no short name; `-e`, `-pi`, `-sin(1)` all work|
332
332
| 3.17 | Define `allow_hyphen_values` in declarative API | ✗ | When argmojo supports it |
333
333
334
334
### Phase 4: Interactive REPL & Subcommands
@@ -408,7 +408,7 @@ This is the natural choice for a calculator: users expect `7 / 2` to be `3.5`, n
0 commit comments