8000 Make `dotnet project convert app.cs` interactive by default · Issue #49624 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content
Make dotnet project convert app.cs interactive by default #49624
@DamianEdwards

Description

@DamianEdwards

Make dotnet project convert app.cs interactive, asking the following questions:

  • output directory (default same as it is now)
  • whether to delete source files (default to be no)

Questions can be answered via named options in original invocation, thus making the command non-interactive.

Example of interactive flow followed by non-interactive invocation:

$ ls
app.cs
$ dotnet project convert --help
Description:
  Convert a file-based program to a project-based program.

Usage:
  dotnet project convert <file> [options]

Arguments:
  <file>  Path to the file-based program.

Options:
  -o, --output <output>  Path to directory to place the generated output.
  -s, --source <choice>  What to do with source files (copy/move).
  --force                Force conversion even if there are malformed directives.
  -?, -h, --help         Show command line help.

$ dotnet project convert app.cs
Converting app.cs to a project-based program:

  Specify the output directory (./app): app
  Source files action (Copy/Move): copy

Project ./app/app.csproj created successfully

$ ls
app app.cs
$ ls app
app.csproj Program.cs
$ rm -rf ../app
$ ls
app.cs
$ dotnet project convert app.cs --output MyApp --source move
Project ./MyApp/app.csproj created successfully

$ ls
MyApp
$ ls MyApp
app.csproj Program.cs
$ 

Metadata

Metadata

Assignees

Labels

Area-run-fileItems related to the "dotnet run <file>" effort

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0