Skip to content

Add UseDoubleQuoteOnArguments to UnParserSettings #371

Open
@lukefan6

Description

@lukefan6

Consider following scenario:

	public class ScaffoldCommand
	{
		[Value(0)]
		public string ConnectionString { get; set; }
                [Value(1)]
		public string Provider { get; set; }
        }

ConnectionString could be a long string that contains spaces and we usually surround them with double quotes so the CLI could recognize it, take entity framework core for example:

dotnet ef dbcontext scaffold "Data Source = xxxxxx;Database = xxxxxx; User ID=xxxxxx; Password=xxxxxx" Microsoft.EntityFrameworkCore.SqlServer

Currently public static string FormatCommandLine<T>(this Parser parser, T options, Action<UnParserSettings> configuration); does not seem to have this kind of capability, I can only generate arguments without double quotes.

I wonder if we could add something like UseDoubleQuoteOnArguments to UnParserSettings so we could configure it to generate arguments surrounded by double quotes.

Any thoughts?

Activity

nemec

nemec commented on Nov 9, 2016

@nemec
Collaborator

IMO that should be a default feature . Can you think of a reason why anyone would want to turn it off, assuming quotes are only added if there is whitespace in the value?

lukefan6

lukefan6 commented on Nov 10, 2016

@lukefan6
Author

Actually adding quotes only when there is whitespace would be better. I was not thinking straight lol.

ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nemec@lukefan6

        Issue actions

          Add UseDoubleQuoteOnArguments to UnParserSettings · Issue #371 · gsscoder/commandline