There is some uncertainty as to wether it will be possible
to start an IEx shell dynamically from a -noshell environment.
Therefore, this PR simplifies the shell booting to still
rely on -user, as it did earlier than Erlang/OTP 26.
This gives us more control to cache paths
and over boot compared to relying on scripts.
This also makes it easier for someone to provide
alternatives to IEx.
The *nix equivalent shell script echoes the full erl.exe path and args to stdout when the environment variable ELIXIR_CLI_DRY_RUN is set instead of executing it.
This patch adds this behaviour to the Windows bat file for consistency.
This commit adds 6 new options to elixir CLI to aid releases:
* `--pipe-to PIPEDIR LOGDIR` - invokes run_erl with daemon pipe and logs (only on Unix-like systems)
* `--rpc-eval NODE COMMAND` - evaluates the given expression on the given node
* `--boot FILE`, `--boot-var VAR VALUE`, `--erl-config FILE` and `--vm-args FILE` - which are equivalent to Erlang's `-boot`, `-boot_var`, `-config` and `-args_file`
We have also rewritten the CLI to only pass Elixir options to Kernel.CLI.
Erlang parameters (CLI switch '--erl') are used with possible quotes around the argument removed ('%~1').
This causes an error if one arbitrary argument to elixir.bat represents a quoted path with spaces in it:
"[part of path after space] was unexpected at this time."
Enclose the complete expression with quotes to work around this (the quotes are not added to the content).
This behavior is not documented in the [Windows XP Command Line Reference for SET](https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/set.mspx)
but there are other places which document the [SET command](https://ss64.com/nt/set.html).
Fix for #6455
* Add usage information to iex.bat
Support command line switch '--help', '-h', '/h' and '/?' to show usage information for iex.bat.
Check argument with '/I' to make the test case insensitive:
This allows showing usage information with '--HELP', '-H' and '/H'.
Use 'setlocal' and 'endlocal' so changes to the environment are local to the batch file
(https://technet.microsoft.com/en-us/library/bb491001.aspx) - so there is no need to un-set __ELIXIR_IEX_FLAGS.
* Use documented syntax 'goto label' - without leading colon before the label
* Support cli switch '/?' to show help
Use label :end to jump to the end of the batch file after showing help text -
so the call to elixir.bat is not executed when showing help.
Use 'setlocal' and 'endlocal' so that the env var 'argc' is local to this batch file.
* Support cli switch '/?' to show help for elixir.bat
Test for cli switch '/?' does not need to be case insensitive.