Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

[REPL] Help improvements for repl #478

Merged
merged 2 commits into from
Sep 7, 2018
Merged

[REPL] Help improvements for repl #478

merged 2 commits into from
Sep 7, 2018

Conversation

glennc
Copy link
Member

@glennc glennc commented Aug 30, 2018

Wanted to get a PR out with the help improvements that the version we showed Damian had:

image

image

@glennc glennc requested a review from mlorbetske August 30, 2018 17:19
shellState.ConsoleManager.WriteLine(help);

var structuredCommand = command as CommandWithStructuredInputBase<HttpState, ICoreParseResult>;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is an attempt to provide a consistent options help section for everything that needs it. Though I don't know that it's the best approach. Looking for ideas from you @mlorbetske.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a reasonable way of going about this. I'm not a huge fan of this only working for things that derive from CommandWithStructuredInputBase<HttpState, ICoreParseResult>, but I don't see us adding additional commands that don't derive from that - making InputSpec public doesn't feel the best either, but I don't think it hurts anything.

We could add a method to get the options help to ICommand<,> and implement it in CommandWithStructuredInputBase<,> with the logic below - this would allow InputSpec to become protected again and lift the base type restriction, but it probably doesn't matter too much.

helpText.AppendLine("Your default editor will be opened with a sample body if no options are provided.");
}

return helpText.ToString();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to set these to a particular color from preferences?

Copy link
Contributor

@mlorbetske mlorbetske left a comment

Choose a reason for hiding this comment

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

Couple minor comments, but looks good

@glennc glennc merged commit 4bcfbe4 into release/2.2 Sep 7, 2018
@natemcmaster natemcmaster deleted the glennc/help branch November 20, 2018 01:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants