Skip to content

Conversation

@eksperimental
Copy link
Contributor

Some mix commands fail when no argument is given.

Before this PR:

$ mix archive.uninstall
** (Mix) No argument was given to uninstall command

$ mix cmd
** (Mix) Expected at least one argument in mix cmd

$ mix escript.build
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1

$ mix escript.install
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1

$ mix escript.uninstall
** (Mix) No argument was given to uninstall command

$ mix eval
** (Mix) "mix eval" expects a single string to evaluate as argument

$ mix new
** (Mix) Expected PATH to be given, please use "mix new PATH"

$ mix xref
** (Mix) xref doesn't support this command. For more information run "mix help xref"

With this PR:

$ mix archive.uninstall
** (Mix) No argument was given to uninstall command.  Use "mix archive.uninstall PATH" or run "mix help archive.uninstall" for more information

$ mix cmd
** (Mix) No argument was given to mix cmd. Run "mix help cmd" for more information

$ mix escript.build
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1. Run "mix help escript.build" for more information

$ mix escript.install
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1. Run "mix help escript.build" for more information

$ mix escript.uninstall
** (Mix) No argument was given to uninstall command.  Use "mix archive.uninstall PATH" or run "mix help archive.uninstall" for more information

$ mix eval
** (Mix) "mix eval" expects a single string to evaluate as argument. Run "mix help eval" for more information

$ mix new
** (Mix) Expected PATH to be given. Use "mix new PATH" or run "mix help new" for more information

$ mix xref
** (Mix) No argument was given to xref command. Run "mix help xref" for more information

Screenshot:
image

Some mix commands fail when no argument is given.

Before this PR:

```
$ mix archive.uninstall
** (Mix) No argument was given to uninstall command

$ mix cmd
** (Mix) Expected at least one argument in mix cmd

$ mix escript.build
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1

$ mix escript.install
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1

$ mix escript.uninstall
** (Mix) No argument was given to uninstall command

$ mix eval
** (Mix) "mix eval" expects a single string to evaluate as argument

$ mix new
** (Mix) Expected PATH to be given, please use "mix new PATH"

$ mix xref
** (Mix) xref doesn't support this command. For more information run "mix help xref"
```

With this PR:

```
$ mix archive.uninstall
** (Mix) No argument was given to uninstall command.  Use "mix archive.uninstall PATH" or run "mix help archive.uninstall" for more information

$ mix cmd
** (Mix) No argument was given to mix cmd. Run "mix help cmd" for more information

$ mix escript.build
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1. Run "mix help escript.build" for more information

$ mix escript.install
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1. Run "mix help escript.build" for more information

$ mix escript.uninstall
** (Mix) No argument was given to uninstall command.  Use "mix archive.uninstall PATH" or run "mix help archive.uninstall" for more information

$ mix eval
** (Mix) "mix eval" expects a single string to evaluate as argument. Run "mix help eval" for more information

$ mix new
** (Mix) Expected PATH to be given. Use "mix new PATH" or run "mix help new" for more information

$ mix xref
** (Mix) No argument was given to xref command. Run "mix help xref" for more information
```
@eksperimental eksperimental changed the title Improve DevEx when Mix commands receive no arguments Improve DevEx when failing Mix commands receive no arguments Oct 23, 2025
@josevalim josevalim merged commit cf7d329 into elixir-lang:main Oct 24, 2025
13 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@eksperimental eksperimental deleted the chore/dx-mix-command-messages branch October 24, 2025 12:23
eksperimental added a commit to eksperimental-forks/elixir that referenced this pull request Oct 24, 2025
These changes were accidently left you in this PR: elixir-lang#14853
josevalim pushed a commit that referenced this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants