DioxusLabs / DioxusLabs/dioxus
`dx component add` does not correctly suggests --package flag when in workspace
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
When trying to `dx component add` in a workspace with multiple binaries, the `--package` flag is suggested. It would be very nice to understand _at what position_ that flag is expected:
```
$ dx components add progress
ERROR dx components: Failed to find binary package to build.
You need to either run dx from inside a binary crate or specify a binary package to build with the `--package` flag. Try building again with one of the binary packages in the workspace:
- distrox-cli
- distrox-gui-desktop
$ dx components add progress --package distrox-gui-desktop
error: unexpected argument '--package' found
tip: to pass '--package' as a value, use '-- --package'
Usage: dx components add ...
For more information, try '--help'.
$ dx --package distrox-gui-desktop components add progress
error: unexpected argument '--package' found
Usage: dx [OPTIONS]
For more information, try '--help'.
$ dx components --package distrox-gui-desktop add progress
error: unexpected argument '--package' found
Usage: dx components [OPTIONS]
For more information, try '--help'.
$ dx components add --package distrox-gui-desktop progress
error: unexpected argument '--package' found
tip: to pass '--package' as a value, use '-- --package'
Usage: dx components add [OPTIONS] [COMPONENTS]...
For more information, try '--help'.
$ dx components add progress --package distrox-gui-desktop
error: unexpected argument '--package' found
tip: to pass '--package' as a value, use '-- --package'
Usage: dx components add ...
For more informaton, try '--help'.
```
**Steps To Reproduce**
Steps to reproduce the behavior:
- Have a workspace with multiple binaries
- `dx component add `
**Expected behavior**
Suggestions what exact command to execute.
**Environment:**
- Dioxus version: 0.7.3
- Rust version: 1.93.1
- OS info: NixOS 25.11
- App platform: desktop fullstack
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `dx components add progress` in a workspace with multiple binary packages, then locate the CLI entry point and argument definition for `components add`. Check how the suggested `--package` placement is generated and verify that the documented invocation is accepted by the command parser.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100