Skip to content

Conversation

@oliver254
Copy link
Contributor

  • Ajout de la commande principale ListCommand pour les opérations de liste.
  • Enrichissement des commandes GreetCommand, AddCommand et ListFilesCommand avec une option d'aide détaillée (--help ou -h).
  • Refonte de la gestion de l'aide globale dans CliApplication avec les méthodes ShowHelp et ShowCommandHelp.
  • Réorganisation des sous-commandes dans Program.cs pour une meilleure hiérarchie.
  • Ajout de métadonnées dans les fichiers .csproj pour générer des packages NuGet avec des informations supplémentaires.
  • Amélioration de la validation des commandes et des messages d'erreur pour une meilleure expérience utilisateur.

- Ajout de la commande principale `ListCommand` pour les opérations de liste.
- Enrichissement des commandes `GreetCommand`, `AddCommand` et `ListFilesCommand` avec une option d'aide détaillée (`--help` ou `-h`).
- Refonte de la gestion de l'aide globale dans `CliApplication` avec les méthodes `ShowHelp` et `ShowCommandHelp`.
- Réorganisation des sous-commandes dans `Program.cs` pour une meilleure hiérarchie.
- Ajout de métadonnées dans les fichiers `.csproj` pour générer des packages NuGet avec des informations supplémentaires.
- Amélioration de la validation des commandes et des messages d'erreur pour une meilleure expérience utilisateur.
@oliver254 oliver254 added this to the v1.1.0 milestone Dec 4, 2025
@oliver254 oliver254 requested a review from Copilot December 4, 2025 15:51
@oliver254 oliver254 self-assigned this Dec 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces typed generic support for CLI arguments and options, along with an automatic help generation system. Key improvements include a fluent CommandBuilder API for configuring commands, type-safe argument/option access methods, and automatic --help/-h handling without manual implementation.

  • Adds generic methods (AddOption<T>(), AddArgument<T>(), GetOption<T>(), etc.) for type-safe CLI configuration
  • Implements automatic help generation based on command metadata with opt-out support via DisableHelp
  • Introduces CommandBuilder for fluent command configuration and ArgumentDefinition for positional parameters

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
src/CliCoreKit.Hosting/CommandBuilder.cs New fluent builder class for configuring commands with typed arguments and options
src/CliCoreKit.Hosting/CliHostBuilder.cs Updated return types to CommandBuilder for fluent API support
src/CliCoreKit.Core/ParsedArguments.cs Added generic getter methods with automatic type conversion
src/CliCoreKit.Core/CommandDefinition.cs Added Arguments list and DisableHelp property
src/CliCoreKit.Core/ArgumentDefinition.cs New class defining positional argument metadata
src/CliCoreKit.Core/CliApplication.cs Refactored help system with automatic generation and improved formatting
src/CliCoreKit.Core/CliCoreKit.Core.csproj Version bump to 1.1.0
src/CliCoreKit.Hosting/CliCoreKit.Hosting.csproj Version bump to 1.1.0 with minor formatting changes
samples/CliCoreKit.Sample/Program.cs Updated to demonstrate new typed API and automatic help
samples/CliCoreKit.Sample/CliCoreKit.Sample.csproj Added IsPackable flag to prevent NuGet packaging
tests/CliCoreKit.Core.Tests/ParsedArgumentsGenericTests.cs Comprehensive tests for generic argument/option methods
tests/CliCoreKit.Core.Tests/AutoHelpTests.cs Tests for automatic help system functionality
docs/TypedArguments.md New documentation for typed arguments feature
docs/AutomaticHelp.md New documentation for automatic help system
CHANGELOG.md New changelog documenting version 1.1.0 changes
.claude/settings.local.json Configuration file for Claude AI permissions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CHANGELOG.md Outdated
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2025-01-XX
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release dates are placeholders with "2025-01-XX" format. Before release, these should be updated with the actual release date.

Copilot uses AI. Check for mistakes.
registry.Register(definition);

var app = new CliApplication(registry);
var output = new StringWriter();
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disposable 'StringWriter' is created but not disposed.

Copilot uses AI. Check for mistakes.
registry.Register(definition);

var app = new CliApplication(registry);
var output = new StringWriter();
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disposable 'StringWriter' is created but not disposed.

Copilot uses AI. Check for mistakes.
registry.Register(definition);

var app = new CliApplication(registry);
var output = new StringWriter();
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disposable 'StringWriter' is created but not disposed.

Copilot uses AI. Check for mistakes.
});

var app = new CliApplication(registry);
var output = new StringWriter();
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disposable 'StringWriter' is created but not disposed.

Copilot uses AI. Check for mistakes.
});

var app = new CliApplication(registry);
var output = new StringWriter();
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disposable 'StringWriter' is created but not disposed.

Copilot uses AI. Check for mistakes.
@oliver254 oliver254 merged commit 9c138c8 into dev Dec 4, 2025
1 check passed
@oliver254 oliver254 deleted the feature/generic-api branch December 4, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants