Skip to content

feat(cli): allow forms subcommand to accept multiple arguments#2996

Open
abhishekDeshmukh74 wants to merge 3 commits intoAutomattic:masterfrom
abhishekDeshmukh74:feat/cli-forms-multiple-args
Open

feat(cli): allow forms subcommand to accept multiple arguments#2996
abhishekDeshmukh74 wants to merge 3 commits intoAutomattic:masterfrom
abhishekDeshmukh74:feat/cli-forms-multiple-args

Conversation

@abhishekDeshmukh74
Copy link
Copy Markdown

Issues

Closes #2989

Description

This PR allows harper-cli forms and just get-forms to accept multiple word arguments instead of just one.

Changes:

  • harper-cli/src/main.rs: Changed the Forms variant from a single line: String to lines: Vec<String> with #[arg(num_args = 1..)]. The body now iterates over each word, printing a blank line separator between entries.
  • justfile: Updated get-forms recipe from word: (single arg) to +words: (one or more args), and passes {{words}} to harper-cli forms.
  • Minor trailing whitespace cleanup in the justfile.

Before:

just get-forms "hello/Na"
# or
harper-cli forms "hello/Na"

After:

just get-forms "hello/Na" "world/N"
# or
harper-cli forms "hello/Na" "world/N"

Demo

N/A — CLI-only change, no visual UI changes.

How Has This Been Tested?

  • Reviewed code for correctness; single-word usage still works as before, multi-word usage iterates and prints each result separated by a blank line.
  • CI will validate formatting and compilation via just precommit.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes

Updated `harper-cli forms` and `just get-forms` to accept multiple word arguments instead of just one. This enables contributors to check inflected forms of several dictionary entries in a single invocation.

Closes Automattic#2989
@hippietrail
Copy link
Copy Markdown
Collaborator

Hey thanks for this! I'll give it a proper look over. Did you notice the Rust build is failing. That's usually Clippy wanting different formatting. Before I push to PRs I try to always remember to first run cargo fmt and then cargo clippy. There's also just format which will format all the TypeScript files too. Maybe other stuff. But when You're only touching Rust code cargo fmt is enough.

(I checked and this is what's causing the failure this time.)

@abhishekDeshmukh74
Copy link
Copy Markdown
Author

abhishekDeshmukh74 commented Mar 31, 2026

Hey thanks for this! I'll give it a proper look over. Did you notice the Rust build is failing. That's usually Clippy wanting different formatting. Before I push to PRs I try to always remember to first run cargo fmt and then cargo clippy. There's also just format which will format all the TypeScript files too. Maybe other stuff. But when You're only touching Rust code cargo fmt is enough.

(I checked and this is what's causing the failure this time.)

Yes done!
Noted! New to the repo :)

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.

Allow harper-cli forms and maybe also just get-forms to accept multiple arguments

2 participants