View Source mix aoc.set (aoc v0.14.0)

This task allows to configure the default values used by the other commands.

Custom default values are stored in .aoc.defaults at the root of your project.

This is useful when working on a puzzle belonging to another year, or when solvig the day 20 puzzle takes a long time and you want to continue to work on it during day 21, 22, etc.

By calling mix aoc.set -d 20, the other commands such as mix aoc.run will use 20 as the default day, unless the flag is explicitly given as in mix aoc.run -d 20.

The command will accumulate values when called multiple times. For instance:

mix aoc.set -d 20
mix aoc.set -y 2020

Executing the two commands above will lead to defaults of day 20 and year 2020.

Then, calling the command with the -r flag will reset other unspecified flags:

mix aoc.set -r -d 22

After the command above is executed, the default day will be 22 but the default year has been reset to be dynamically defined using today's date when other commands are called.

Finally, you can reset everything using mix aoc.set -r. Deleting the .aoc.defaults file is another way to do that.

Usage

mix aoc.set [options]

Options

  • -y, --year <integer> - Year to use as default.
  • -d, --day <integer> - Day to force as default.
  • -r, --reset - Resets the default values. Can be combined with other flags to reset unspecified flags only.
  • --help - Displays this help.

Summary

Functions

Callback implementation for Mix.Task.run/1.

Functions

run(argv)

Callback implementation for Mix.Task.run/1.