Read only part 2
It would be nice to have a flag for reading only part 2 of a puzzle.
The underlying aoc-cli does not have a flag for it. It should be simple enough to add this on our side, but I'm wondering if the upstream project wouldn't benefit from this as well.
Anyway, I would accept a PR that adds this on our side as well.
Something I noticed is that once you have completed part 1, the part 2 is not saved automatically to the puzzle file. Doing cargo read <problem_no> after you have completed part 1 makes use of the aoc website/api and reads the puzzle from there but after that it does not save it to the puzzles file again. The puzzle file stays outdated
Something I noticed is that once you have completed part 1, the part 2 is not saved automatically to the puzzle file. Doing
cargo read <problem_no>after you have completed part 1 makes use of the aoc website/api and reads the puzzle from there but after that it does not save it to the puzzles file again. The puzzle file stays outdated
After looking into this issue seems to be because of the way aoc_cli handles the read command. In the code of the template we are using this code
pub fn read(day: Day) -> Result<Output, AocCommandError> {
let puzzle_path = get_puzzle_path(day);
let args = build_args(
"read",
&[
"--description-only".into(),
"--puzzle-file".into(),
puzzle_path,
],
day,
);
call_aoc_cli(&args)
}
But the issue is that the puzzle-file and description-only arguments don't mean anything for aoc-cli in this particular command, this command always uses the api and directly displays the puzzle from there. aoc read --day 2 --puzzle-file test.md Running this command does not make any test.md file and it looks like the puzzle-file argument is only for the download command. The code for running the read command inside aoc-cli does not show any use for this argument. This is something that should also be handled on our end and maybe on aoc-cli too if they feel like going in this direction