Skip to content

dx component add does not correctly suggests --package flag when in workspace #5367

@matthiasbeyer

Description

@matthiasbeyer

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 <COMPONENTS>...                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                          
For more information, try '--help'.                                                                                                                                                                                                                                                                                                                                                                                                       
$ dx  --package distrox-gui-desktop components add progress                                                                                                                                                                                                                                                                                                                                                                               
error: unexpected argument '--package' found                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                          
Usage: dx [OPTIONS] <COMMAND>                                                                                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                          
For more information, try '--help'.                                                                                                                                                                                                                                                                                                                                                                                                       
$ dx components --package distrox-gui-desktop add progress                                                                                                                                                                                                                                                                                                                                                                                
error: unexpected argument '--package' found                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                          
Usage: dx components [OPTIONS] <COMMAND>                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                          
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 <COMPONENTS>...                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                          
For more informaton, try '--help'. 

Steps To Reproduce

Steps to reproduce the behavior:

  • Have a workspace with multiple binaries
  • dx component add <whatever>

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions