CLI: switch to Spectre.Console.Cli and add inline options instead of project file#114
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the CLI from System.CommandLine to Spectre.Console.Cli, and adds support for “inline” compare options (type/source/target) as an alternative to supplying a project file, while also customizing the help output.
Changes:
- Switched CLI command parsing/execution to
Spectre.Console.Cliwith DI-based command activation. - Added inline compare options + validation logic (mutually exclusive with project-file mode) and a
ShowHelpExceptionflow to display help when no meaningful args are supplied. - Implemented a custom Spectre help provider and option grouping for improved help output.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| SQLSchemaCompare.CLI/Utils/ShowHelpException.cs | Adds a custom exception used to trigger help display. |
| SQLSchemaCompare.CLI/Utils/OptionGroupAttribute.cs | Adds an attribute to group related options in help output. |
| SQLSchemaCompare.CLI/Utils/CustomHelpProvider.cs | Implements custom header + grouped options rendering for --help. |
| SQLSchemaCompare.CLI/SQLSchemaCompare.CLI.csproj | Replaces System.CommandLine dependency with Spectre.Console.Cli and adds global usings. |
| SQLSchemaCompare.CLI/Program.cs | Rebuilds CLI bootstrap around CommandApp, DI registrar, and new error/help handling. |
| SQLSchemaCompare.CLI/CustomHelpAction.cs | Removes the prior System.CommandLine-based custom help action. |
| SQLSchemaCompare.CLI/Commands/CompareCommand.cs | Converts compare command to Spectre command + adds inline options and validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/TiCodeX/SQLSchemaCompare/sessions/465f9999-2007-4211-a6b4-2c07377b055d Co-authored-by: drebrez <1611547+drebrez@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TiCodeX/SQLSchemaCompare/sessions/465f9999-2007-4211-a6b4-2c07377b055d Co-authored-by: drebrez <1611547+drebrez@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TiCodeX/SQLSchemaCompare/sessions/465f9999-2007-4211-a6b4-2c07377b055d Co-authored-by: drebrez <1611547+drebrez@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TiCodeX/SQLSchemaCompare/sessions/e409ea33-8299-4bf6-8f5d-ace71f838c03 Co-authored-by: drebrez <1611547+drebrez@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.