diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 0301db1..a6f8a53 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -12,7 +12,7 @@ jobs: steps: - name: 📥 Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true # Fetch and checkout submodules fetch-depth: 0 # Ensure the full history is fetched, useful when dealing with submodules @@ -30,7 +30,7 @@ jobs: run: dotnet pack --no-build --configuration Release - name: 📤 Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: nupkg path: Guppi.Console/nupkg/*.nupkg @@ -43,7 +43,7 @@ jobs: if: github.ref == 'refs/heads/main' steps: - name: 📥 Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: nupkg diff --git a/.gitignore b/.gitignore index 2b7e669..4cff771 100644 --- a/.gitignore +++ b/.gitignore @@ -358,3 +358,8 @@ MigrationBackup/ # Code coverage coverage.json + +# AI Tools +.aider* +repomix-output.txt + diff --git a/Guppi.Console/Guppi.Console.csproj b/Guppi.Console/Guppi.Console.csproj index 41ad9c5..2c5a6f0 100644 --- a/Guppi.Console/Guppi.Console.csproj +++ b/Guppi.Console/Guppi.Console.csproj @@ -1,4 +1,4 @@ - + Exe @@ -13,7 +13,7 @@ https://github.com/rprouse/guppi https://github.com/rprouse/guppi dotnet-guppi - 6.4.0 + 6.5.0 true guppi ./nupkg diff --git a/Guppi.Console/Skills/CalendarSkill.cs b/Guppi.Console/Skills/CalendarSkill.cs index 074c5ad..ed25906 100644 --- a/Guppi.Console/Skills/CalendarSkill.cs +++ b/Guppi.Console/Skills/CalendarSkill.cs @@ -14,9 +14,14 @@ namespace Guppi.Console.Skills; -internal class CalendarSkill(ICalendarService service) : ISkill +internal class CalendarSkill : ISkill { - private readonly ICalendarService _service = service; + private readonly ICalendarService _service; + + public CalendarSkill(ICalendarService service) + { + _service = service; + } public IEnumerable GetCommands() { @@ -44,12 +49,13 @@ public IEnumerable GetCommands() await Agenda(midnight, "Tomorrow's agenda", markdown, table); }, markdown, table); - var month = new Command("month", "Displays this month's calendar") { markdown }; - month.SetHandler(async (bool markdown) => + var nextMonth = new Option(["--next", "-n"], "Display next month's calendar"); + var month = new Command("month", "Displays this month's calendar") { markdown, nextMonth }; + month.SetHandler(async (bool markdown, bool nextMonth) => { - if (markdown) await MonthMarkdown(); - else Month(); - }, markdown); + if (markdown) await MonthMarkdown(nextMonth); + else Month(nextMonth); + }, markdown, nextMonth); var free = new Command("free", "Displays free time for a given day"); free.AddArgument(new Argument("date", "The date to check")); @@ -270,9 +276,9 @@ private static string JoinLink(Core.Entities.Calendar.Event eventItem) => private static string TableLinkedSummary(Core.Entities.Calendar.Event eventItem) => string.IsNullOrEmpty(eventItem.MeetingUrl) ? eventItem.Summary : $"[{eventItem.Summary}]({eventItem.MeetingUrl})"; - private static void Month() + private static void Month(bool nextMonth) { - (DateOnly start, DateOnly end) = GetMonthRange(); + (DateOnly start, DateOnly end) = GetMonthRange(nextMonth); AnsiConsoleHelper.TitleRule($":calendar: {start:MMMM yyyy}"); @@ -307,9 +313,9 @@ private static void Month() AnsiConsoleHelper.Rule("white"); } - private static async Task MonthMarkdown() + private static async Task MonthMarkdown(bool nextMonth) { - (DateOnly start, DateOnly end) = GetMonthRange(); + (DateOnly start, DateOnly end) = GetMonthRange(nextMonth); StringBuilder cal = new(); cal.AppendLine("| Day | Date | Habits | Notes |"); cal.AppendLine("| --- | ---- | ------ | ----- |"); @@ -330,9 +336,9 @@ private static async Task MonthMarkdown() AnsiConsoleHelper.Rule("white"); } - private static (DateOnly start, DateOnly end) GetMonthRange() + private static (DateOnly start, DateOnly end) GetMonthRange(bool nextMonth) { - var now = DateTime.Now; + var now = nextMonth ? DateTime.Now.AddMonths(1) : DateTime.Now; var start = new DateOnly(now.Year, now.Month, 1); var end = new DateOnly(now.Year, now.Month, DateTime.DaysInMonth(now.Year, now.Month)); return (start, end);