Expresso.BurritoEntryPoint (expresso v0.1.0)

Copy Markdown View Source

The entry point of the binary that Burrito makes

In a Burrito binary, start/2 runs the command line with run/2, and then it halts the VM with the exit status. run/2 calls Expresso.CommandLine.run/3, so the binary and mix expresso take the same arguments. Outside a Burrito binary, the module only starts the application.

The launcher of Burrito starts the VM with -s elixir start_cli. After the boot, the CLI of Elixir runs the first argument as a script, and then it halts the VM. Therefore start/2 runs the command before it returns, and the CLI of Elixir does not start.

Summary

Functions

Run the command line of the binary, and return its exit status

Start the application, and run the command line in a Burrito binary

Functions

run(args, program \\ "expresso")

@spec run([String.t()], String.t()) :: 0 | 1

Run the command line of the binary, and return its exit status

Expresso.CommandLine.run/3 runs the arguments, with program in the usage text and with the help text of the binary. This function also catches an exception, an exit or a throw from the deck. It then writes the message to the standard error, and the exit status is 1.

When the standard output closes before all the HTML is written, as for | head, the exit status is 0. In the binary, the launcher of Burrito stops the VM first: Expresso.SignalHandler tells how.

start(_, _)

@spec start(Application.start_type(), term()) :: {:ok, pid()} | {:error, term()}

Start the application, and run the command line in a Burrito binary

In a Burrito binary, the function does not return. It halts the VM with the exit status of run/2.