Make dotnet project convert interactive#49660
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR makes dotnet project convert interactive by adding a --keep-source option and prompting users to confirm or specify output when not provided.
- Introduces shared
InteractiveConsolehelpers and an interactive option in common options. - Adds
KeepSourceOptionand wires interactive logic into the parser and command implementation. - Updates shell completions, tests, and localization/resx to cover the new interactive behavior.
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Cli/dotnet/InteractiveConsole.cs | New helper for interactive prompts (Confirm/Ask) |
| src/Cli/dotnet/CommonOptions.cs | Cache and expose a reusable --interactive option |
| src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommandParser.cs | Add --keep-source option |
| src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs | Implement interactive flow and copy/move logic for keep-source |
| test/dotnet.Tests/CompletionTests/snapshots/.verified. | Update zsh/bash/pwsh completion snapshots for new options |
| test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs | Add and update tests for --keep-source and interactive cases |
| src/Cli/dotnet/Commands/CliCommandStrings.resx | Add new CLI string entries for interactive prompts |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.*.xlf | Add localization entries for interactive prompts |
Comments suppressed due to low confidence (2)
test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh:678
- Zsh completion suggests capitalized
False/True, but the CLI expects lowercasefalse/true. Update to suggest lowercase values to match actual accepted arguments.
'--keep-source=[Whether to keep source files intact (otherwise, they are deleted after conversion).]: :((False\:"False" True\:"True" ))' \
test/dotnet.Tests/CompletionTests/snapshots/bash/DotnetCliSnapshotTests.VerifyCompletions.verified.sh:1190
- Bash completion suggests
False/Truebut the--keep-sourceoption expects lowercasefalse/true, so the suggestions should be updated accordingly.
COMPREPLY=( $(compgen -W "False True" -- "$cur") )
|
Amazing, I was genuinely going to ask for this but thought.. "it's the wrong point in the dev cycle..it's out of left field..etc." Then suddenly here it is. |
|
@jjonescz after reading your comment on the issue, I tweaked the option name and choices to better allow for a future where we ask about other items besides source. Interested in your thoughts on the wording in the updated proposal. I think I prefer the new wording and choices? |
|
@dotnet/run-file for reviews, thanks |
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Outdated
Show resolved
Hide resolved
test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs
Outdated
Show resolved
Hide resolved
RikkiGibson
left a comment
There was a problem hiding this comment.
LGTM modulo some minor suggestions
|
After discussing with Damian, to simplify things, we are going to make |
And allow users to specify whether the files should be copied or moved.
Resolves #49624.