From 99df7df76378050b33d66f5426e77c3b5bca28f1 Mon Sep 17 00:00:00 2001 From: Mel Dommer Date: Fri, 27 Dec 2024 14:46:27 -0600 Subject: [PATCH] Updated README.md --- 2024/README.md | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/2024/README.md b/2024/README.md index c1f2793..c12b46e 100644 --- a/2024/README.md +++ b/2024/README.md @@ -2,20 +2,20 @@ Welcome to the AdventOfCode 2024 CLI! This tool helps you manage and run my Advent of Code solutions for the year 2024. -## Installation +## Building Exe Clone the repository and open a terminal to the AdventOfCode folder ```sh cd ./2024/Advent -dotnet build +dotnet publish -c Release ``` ## Usage Here are some common commands you can use with the AdventOfCode 2024 CLI: -### Run Solutions (Option 1) +### Run using dotnet CLI Using the dotnet cli. @@ -25,32 +25,27 @@ Example from `./2024/Advent` folder ```sh dotnet run -- day1 -dotnet run -- day2 -dotnet run -- day6 +dotnet run -- day2 --part 2 +dotnet run -- day6 -p 1 +dotnet run -- day15 --help dotnet run -- day25 ``` -Each day may have multipl parts use the help command to see additional arguments. +Each day has multiple parts use the help command to see additional arguments. If an argument is not specified but required you will be prompted to make a selection. -```sh -dotnet run -- day1 --help -``` - -Example: - -```sh -dotnet run -- day1 --part 1 -dotnet run -- day1 --part "Part 1" -``` - -### Run Solutions (Option 2) +### Run using exe -Example from `./2024/Advent` folder -The key is the input folder with all the input files needs to be located in the current directory. +If you run the publish command you will get a single file exe that is fully +self-contained. Publish for your target os and run it as if you would any other CLI ```sh -dotnet build -c Release +dotnet publish -c Release --runtime win-x64 +dotnet publish -c Release --runtime linux-x64 +dotnet publish -c Release --runtime osx-64 +# \bin\Release\net9.0\linux-x64\publish +# \bin\Release\net9.0\win-x64\publish +# \bin\Release\net9.0\osx-x64\publish ./bin/Release/net9.0/Advent.exe --help ./bin/Release/net9.0/Advent.exe day1 ./bin/Release/net9.0/Advent.exe day6 --part 2 @@ -62,10 +57,12 @@ I wrote the code using tests first using the sample data they gave in the exampl Funny how sometimes you'll get the code working against the test data but then find it fails on the real data. Seemed to be 50/50 for me. -From repository root: - ```sh -dotnet test ./2024/2024.sln +# from root +dotnet test ./2024 + +# from ./2024 +dotnet test ``` ## License