Skip to content

Commit 87609aa

Browse files
committed
doc: Fixed command docs in README.md
1 parent a456d10 commit 87609aa

File tree

4 files changed

+61
-67
lines changed

4 files changed

+61
-67
lines changed

README.md

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ while you focus on problem solving!
1515
- [Call your solution module manually](#call-your-solution-module-manually)
1616
- [TL; DR](#tl-dr)
1717
- [Available Commands](#available-commands)
18-
- [mix.aoc.open](#mixaocopen)
19-
- [mix.aoc.create](#mixaoccreate)
20-
- [mix.aoc.test](#mixaoctest)
21-
- [mix.aoc.run](#mixaocrun)
22-
- [mix.aoc.fetch](#mixaocfetch)
23-
- [mix.aoc.url](#mixaocurl)
18+
- [mix aoc.open](#mix-aocopen)
19+
- [mix aoc.create](#mix-aoccreate)
20+
- [mix aoc.test](#mix-aoctest)
21+
- [mix aoc.run](#mix-aocrun)
22+
- [mix aoc.fetch](#mix-aocfetch)
23+
- [mix aoc.url](#mix-aocurl)
2424
- [Custom default values for commands](#custom-default-values-for-commands)
2525
- [Upgrading to `0.12`](#upgrading-to-012)
2626

@@ -365,7 +365,7 @@ You may also get a quick summary of options by calling those commands with the
365365

366366

367367
<!-- block:mix.aoc.open -->
368-
### mix.aoc.open
368+
### mix aoc.open
369369

370370
Opens the puzzle page with your defined browser on on adventofcode.com.
371371

@@ -377,15 +377,14 @@ The command to call with the URL will be defined in the following order:
377377

378378
#### Usage
379379

380-
```shell
381-
mix aoc.open [options]
382-
```
380+
mix aoc.open [options]
381+
383382

384383
#### Options
385384

386-
* `-y, --year <integer>`- Year of the puzzle Defaults to today's year or custom default.
387-
* `-d, --day <integer>`- Day of the puzzle Defaults to today's day or custom default.
388-
* `--help`- Displays this help.
385+
* `-y, --year <integer>` - Year of the puzzle Defaults to today's year or custom default.
386+
* `-d, --day <integer>` - Day of the puzzle Defaults to today's day or custom default.
387+
* `--help` - Displays this help.
389388

390389

391390
<!-- endblock:mix.aoc.open -->
@@ -394,7 +393,7 @@ mix aoc.open [options]
394393

395394

396395
<!-- block:mix.aoc.create -->
397-
### mix.aoc.create
396+
### mix aoc.create
398397

399398
This task will execute the following operations:
400399

@@ -415,15 +414,14 @@ option:
415414

416415
#### Usage
417416

418-
```shell
419-
mix aoc.create [options]
420-
```
417+
mix aoc.create [options]
418+
421419

422420
#### Options
423421

424-
* `-y, --year <integer>`- Year of the puzzle Defaults to today's year or custom default.
425-
* `-d, --day <integer>`- Day of the puzzle Defaults to today's day or custom default.
426-
* `--help`- Displays this help.
422+
* `-y, --year <integer>` - Year of the puzzle Defaults to today's year or custom default.
423+
* `-d, --day <integer>` - Day of the puzzle Defaults to today's day or custom default.
424+
* `--help` - Displays this help.
427425

428426

429427
<!-- endblock:mix.aoc.create -->
@@ -432,7 +430,7 @@ mix aoc.create [options]
432430

433431

434432
<!-- block:mix.aoc.test -->
435-
### mix.aoc.test
433+
### mix aoc.test
436434

437435
Runs your test file for the Advent of Code puzzle.
438436

@@ -459,20 +457,19 @@ end
459457

460458
#### Usage
461459

462-
```shell
463-
mix aoc.test [options]
464-
```
460+
mix aoc.test [options]
461+
465462

466463
#### Options
467464

468-
* `-y, --year <integer>`- Year of the puzzle Defaults to today's year or custom default.
469-
* `-d, --day <integer>`- Day of the puzzle Defaults to today's day or custom default.
470-
* `--trace`- forward option to `mix test`
471-
* `--stale`- forward option to `mix test`
472-
* `--failed`- forward option to `mix test`
473-
* `--seed <integer>`- forward option to `mix test`
474-
* `--max-failures <integer>`- forward option to `mix test`
475-
* `--help`- Displays this help.
465+
* `-y, --year <integer>` - Year of the puzzle Defaults to today's year or custom default.
466+
* `-d, --day <integer>` - Day of the puzzle Defaults to today's day or custom default.
467+
* `--trace` - forward option to `mix test`
468+
* `--stale` - forward option to `mix test`
469+
* `--failed` - forward option to `mix test`
470+
* `--seed <integer>` - forward option to `mix test`
471+
* `--max-failures <integer>` - forward option to `mix test`
472+
* `--help` - Displays this help.
476473

477474

478475
<!-- endblock:mix.aoc.test -->
@@ -481,23 +478,22 @@ mix aoc.test [options]
481478

482479

483480
<!-- block:mix.aoc.run -->
484-
### mix.aoc.run
481+
### mix aoc.run
485482

486483
Runs your solution with the corresponding year/day input from `priv/inputs`.
487484

488485
#### Usage
489486

490-
```shell
491-
mix aoc.run [options]
492-
```
487+
mix aoc.run [options]
488+
493489

494490
#### Options
495491

496-
* `-y, --year <integer>`- Year of the puzzle Defaults to today's year or custom default.
497-
* `-d, --day <integer>`- Day of the puzzle Defaults to today's day or custom default.
498-
* `-p, --part <integer>`- Part of the puzzle Defaults to both parts.
499-
* `-b, --benchmark`- Runs the solution parts repeatedly for 5 seconds to print statistics about execution time. Defaults to `false`.
500-
* `--help`- Displays this help.
492+
* `-y, --year <integer>` - Year of the puzzle Defaults to today's year or custom default.
493+
* `-d, --day <integer>` - Day of the puzzle Defaults to today's day or custom default.
494+
* `-p, --part <integer>` - Part of the puzzle Defaults to both parts.
495+
* `-b, --benchmark` - Runs the solution parts repeatedly for 5 seconds to print statistics about execution time. Defaults to `false`.
496+
* `--help` - Displays this help.
501497

502498

503499
<!-- endblock:mix.aoc.run -->
@@ -506,23 +502,22 @@ mix aoc.run [options]
506502

507503

508504
<!-- block:mix.aoc.fetch -->
509-
### mix.aoc.fetch
505+
### mix aoc.fetch
510506

511507
This task will fetch the puzzle into `priv/inputs`.
512508

513509
It will not overwrite an existing input file.
514510

515511
#### Usage
516512

517-
```shell
518-
mix aoc.fetch [options]
519-
```
513+
mix aoc.fetch [options]
514+
520515

521516
#### Options
522517

523-
* `-y, --year <integer>`- Year of the puzzle Defaults to today's year or custom default.
524-
* `-d, --day <integer>`- Day of the puzzle Defaults to today's day or custom default.
525-
* `--help`- Displays this help.
518+
* `-y, --year <integer>` - Year of the puzzle Defaults to today's year or custom default.
519+
* `-d, --day <integer>` - Day of the puzzle Defaults to today's day or custom default.
520+
* `--help` - Displays this help.
526521

527522

528523
<!-- endblock:mix.aoc.fetch -->
@@ -531,7 +526,7 @@ mix aoc.fetch [options]
531526

532527

533528
<!-- block:mix.aoc.url -->
534-
### mix.aoc.url
529+
### mix aoc.url
535530

536531
Outputs the on adventofcode.com URL for a puzzle.
537532

@@ -546,15 +541,14 @@ xdg-open $(mix aoc.url | grep 'https')
546541

547542
#### Usage
548543

549-
```shell
550-
mix aoc.url [options]
551-
```
544+
mix aoc.url [options]
545+
552546

553547
#### Options
554548

555-
* `-y, --year <integer>`- Year of the puzzle Defaults to today's year or custom default.
556-
* `-d, --day <integer>`- Day of the puzzle Defaults to today's day or custom default.
557-
* `--help`- Displays this help.
549+
* `-y, --year <integer>` - Year of the puzzle Defaults to today's year or custom default.
550+
* `-d, --day <integer>` - Day of the puzzle Defaults to today's day or custom default.
551+
* `--help` - Displays this help.
558552

559553

560554
<!-- endblock:mix.aoc.url -->
@@ -596,4 +590,4 @@ move your old modules.
596590

597591
Sorry for the inconvenience. That change was necessary to have a clean ordering
598592
of files in the solutions directories and to allow everyone to generate the
599-
modules in a directory according to their prefix.
593+
modules in a directory according to their preferred namespace.

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ defmodule AoC.MixProject do
4343
defp deps do
4444
[
4545
# Lib
46-
{:cli_mate, "~> 0.7", runtime: false},
46+
{:cli_mate, "~> 0.8", runtime: false},
4747
{:req, "~> 0.5"},
4848
{:benchee, "~> 1.2"},
4949
{:modkit, "~> 0.6.0"},

mix.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
%{
22
"benchee": {:hex, :benchee, "1.4.0", "9f1f96a30ac80bab94faad644b39a9031d5632e517416a8ab0a6b0ac4df124ce", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "299cd10dd8ce51c9ea3ddb74bb150f93d25e968f93e4c1fa31698a8e4fa5d715"},
33
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
4-
"cli_mate": {:hex, :cli_mate, "0.7.1", "922e3f7fcf9085be01b2e22ba0b16b1e3bb2e88a6af77657964dc0900a97cd4f", [:mix], [], "hexpm", "a8677fbedd9c31caad99c48481e5e3b857d1fe5bc22ba0eaf0501091713b8b53"},
4+
"cli_mate": {:hex, :cli_mate, "0.8.1", "376fdc710b9d8936205d4a7d0da98ea76d99f7390ec035242591798c14584e6c", [:mix], [], "hexpm", "553cebbecd823936588854fe185f31ac39d96d66f5db7ddcb107e40a6da0adfe"},
55
"credo": {:hex, :credo, "1.7.12", "9e3c20463de4b5f3f23721527fcaf16722ec815e70ff6c60b86412c695d426c1", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8493d45c656c5427d9c729235b99d498bd133421f3e0a683e5c1b561471291e5"},
66
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
77
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
88
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
99
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
10-
"ex_doc": {:hex, :ex_doc, "0.37.3", "f7816881a443cd77872b7d6118e8a55f547f49903aef8747dbcb345a75b462f9", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "e6aebca7156e7c29b5da4daa17f6361205b2ae5f26e5c7d8ca0d3f7e18972233"},
10+
"ex_doc": {:hex, :ex_doc, "0.38.0", "0ab17291b71f9b2c479c0b92404107ac5005214872c3b43f845f6f644ba14f56", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "dee6d6485ef501384fbfc7c90cb0fe621636078bebc0f7a1fd2ddcc20b185013"},
1111
"file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"},
1212
"finch": {:hex, :finch, "0.19.0", "c644641491ea854fc5c1bbaef36bfc764e3f08e7185e1f084e35e0672241b76d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.6.2 or ~> 1.7", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 1.1", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fc5324ce209125d1e2fa0fcd2634601c52a787aff1cd33ee833664a5af4ea2b6"},
1313
"hpax": {:hex, :hpax, "1.0.3", "ed67ef51ad4df91e75cc6a1494f851850c0bd98ebc0be6e81b026e765ee535aa", [:mix], [], "hexpm", "8eab6e1cfa8d5918c2ce4ba43588e894af35dbd8e91e6e55c817bca5847df34a"},

tools/regen-readme.exs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ defmodule Readme do
4646
defp update_command_blocks(lines_in) do
4747
blocks =
4848
%{
49-
"mix.aoc.open" => Mix.Tasks.Aoc.Open,
50-
"mix.aoc.create" => Mix.Tasks.Aoc.Create,
51-
"mix.aoc.test" => Mix.Tasks.Aoc.Test,
52-
"mix.aoc.run" => Mix.Tasks.Aoc.Run,
53-
"mix.aoc.fetch" => Mix.Tasks.Aoc.Fetch,
54-
"mix.aoc.url" => Mix.Tasks.Aoc.Url
49+
"mix aoc.open" => Mix.Tasks.Aoc.Open,
50+
"mix aoc.create" => Mix.Tasks.Aoc.Create,
51+
"mix aoc.test" => Mix.Tasks.Aoc.Test,
52+
"mix aoc.run" => Mix.Tasks.Aoc.Run,
53+
"mix aoc.fetch" => Mix.Tasks.Aoc.Fetch,
54+
"mix aoc.url" => Mix.Tasks.Aoc.Url
5555
}
5656

5757
Enum.reduce(blocks, lines_in, fn {block_name, module}, lines ->
@@ -60,12 +60,12 @@ defmodule Readme do
6060
|> Code.fetch_docs()
6161
|> elem(4)
6262
|> Map.fetch!("en")
63-
|> String.replace("## Usage", "#### Usage")
63+
|> String.replace("## Synopsis", "#### Usage")
6464
|> String.replace("## Options", "#### Options")
6565

6666
block_content = ["### ", block_name, "\n\n" | block_content]
6767

68-
update_block(lines, block_name, block_content)
68+
update_block(lines, String.replace(block_name, " ","."), block_content)
6969
end)
7070
end
7171
end

0 commit comments

Comments
 (0)