-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CLI runtime: define option output
with the default type
#3445
Comments
Good catch! I wonder if the best way around it would be, to set the output to the default output in the CLI runtime, if no output type has been specified. That way, in each command we'd have the output option set and would correctly evaluate the condition. Basically, we'd update this line and replace at the end cli-microsoft365/src/cli/Cli.ts Line 202 in 5a6c547
|
That's even a beter idea, This way we don't need to check if the |
output
output
with the default type
@waldekmastykarz: I am with your suggestion. I think updating the default output to JSON there should do the trick. |
Currently, we use several different ways to check if a certain output type is requested. With the change of v4, the default output type has been changed from
text
tojson
. This "breaks" several commands that check if the output type is a certain value. I am using quotes here because it doesn't reject the command but doesn't use correct the condition. e.g. of the commandm365 planner task checklistitem add
.Notice here the Id value. When I pass the option
-o json
. I would expect to get the same response as the first image, but this isn't the case. The command usesif (args.options.output === 'json')
to check if the output type isjson
. Here we don't take into consideration what the default output type is.This also relates to a recently found bug #3400 which caused an option to be unavailble without an explicit ouput type.
With this all in mind, I would suggest to create a new utils function that can validate if the output is a certain type. This new function would take in mind the current default output type and can be used in the following commands.
All of these commands ignore the default output type, so they need to be adjusted to take this into consideration.
The text was updated successfully, but these errors were encountered: