cli-microsoft365: Modify help output in case of error

This issue is a follow up form the #5182. Let’s discuss here if and how we could adapt the help mode output in case of error. In the related issue @martinlingstuyl suggested that the printed help in case of errors only shows the description of the command, combined with a message about how to get the full version. This is an interesting idea for maybe a totally new help mode we could support.

Specs

In case of errors we currently show the help page. This issue is about changing that to a single line of text that instructs the user how to get help:

Run (command name) -h for help.

The current command should be included in the message. For example:

Run 'm365 spo site list -h' for help.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 21 (21 by maintainers)

Most upvoted comments

Can I work on this?

Grammar police, let’s start with a capital letter and put a period at the end 🙂

E.g. Run 'm365 spo site list -h' for help.

Other than that, looks good to me!

Like @martinlingstuyl said, right now people are mind-blown with the whole help page we throw in their faces. They are not noticing the error message on top of the output. As mentioned before I’ve had a bunch of people reaching out to me. They didn’t understand what happened. I like the idea of letting them decide whether they need the help page or not. We can just print the error and tell them, if you need help, do this.

Printing the entire command page isn’t always that useful. Most of the time, the error is clear enough especially when it’s a validation error from the CLI.

This is the kind of thing we’re talking about @waldekmastykarz. Excellent idea. I don’t care what’s shown, as long as it’s short and points the user to how he can get help.

Alternative idea. What if:

  • we don’t show help by default
  • instead, by default, in case of an error we show something like: run (command name) -h for help

If you made a typo that you can easily fix, you don’t get a wall of text. If you need help, you know how. You don’t get to see help that’s not helpful (ie. too little information).

Yeah, so the point is the default behavior should point towards using the help, but not force it down your throat. Disabling it by default would not be preferred behavior. Showing a minimal pointer would in my opinion. You can discuss about what the minimal pointer contains, but at the least it should be minimal…

I think it helps a bit, but even the options mode prints quite a long piece of text.

I agree with @milanholemans on this and still feel that we should print a very minimal message (with instructions to get the full) by default when people run into errors.

The point is that you want to give people a helicopter view: the clean error and the way to possibly get help. They’ll decide themselves if they want more details.

It communicates enough and people would know where to find the help and are not blocked because we print a lot of text unasked for.