# `Juggernaut.CLI.Inputs`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/cli/inputs.ex#L1)

What the analysis tasks read before they call a view (design notes §3, §11): a recorded
run from the store, and the view options a run does not hold (the configured
thresholds and timeout scoring, the source of the mutated files for excerpts, and the
test files that exist for the suggested test file).

Sources are read from the working tree as it is now, so an excerpt shows today's text
of a file that changed after the run.

# `load_run`

```elixir
@spec load_run(Juggernaut.CLI.Task.ctx(), Juggernaut.Store.Runs.ref()) ::
  {:ok, Juggernaut.Run.t()} | {:error, Juggernaut.Error.t()}
```

Loads the run `ref` names from the project's store.

# `print`

```elixir
@spec print(iodata()) :: :ok
```

Prints a view's document on stdout, without doubling its final newline.

# `sources`

```elixir
@spec sources(Path.t(), Juggernaut.Run.t()) :: %{required(String.t()) =&gt; String.t()}
```

The text of each file `run` mutated that can still be read under `root`.

# `test_files`

```elixir
@spec test_files(Path.t(), :project | [String.t()]) :: [String.t()]
```

The `*_test.exs` files under the test paths (`:project` means `test`), relative to `root`.

# `timeouts`

```elixir
@spec timeouts(Juggernaut.Run.t(), Juggernaut.Config.t()) :: :killed | :survived
```

The `timeouts` setting `run` was scored with (`Summary.timeouts`), else `config`'s (a
run recorded before the setting was kept), so a view matches the run's own gate.

# `view_options`

```elixir
@spec view_options(Juggernaut.CLI.Task.ctx(), Juggernaut.Run.t(), keyword()) ::
  {:ok, Juggernaut.View.options()} | {:error, Juggernaut.Error.t()}
```

View options for `run`: `extra` (page, per page, ...) plus the configuration's
thresholds and timeout scoring, the sources of the run's files and the existing test
files. An invalid `.juggernaut.exs` is a configuration error (exit 2).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
