-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
[BUG] inconsistent uses of -o
flag in some commands
#1656
Comments
Waiting for issue approval by maintainers. Please assign me the issue. |
Please explain me if I am missing something and understanding something wrong. |
-o
flag in some commands-o
flag in some commands
@AayushSaini101 Sir, any updates on this issue? I understand that you might be busy, but I believe this is a imp bug and need to be solve. Additionally, I would like to discuss potential options for the new override flag. Looking forward to your thoughts. |
Describe the bug.
In some commands like
asyncapi bundle
,asyncapi format
etc the -o flag is written explicitly in flags file while in below 3 commands it is used fromvalidationFlags()
.According to the code the output flag inside
validationFlags()
is responsible to write any diagnostics (if present) in file but the description of this flag is - 'The output file name. Omitting this flag the result will be printed in the console.' which might confuse user with other commands output flags.asyncapi diff OLD NEW
- In this command we have 2 flags with -o-o, --output= The output file name. Omitting this flag the result will be printed in the console.
-o, --overrides= path to JSON file containing the override properties
Case 1 - Write only -o
It is assuming that I am trying to use --overrides
Case 2 - Provide --output as flag
It is printing correct output in logs but no file was created.
asyncapi validate [SPEC-FILE] [PROXYHOST] [PROXYPORT]
-In this command if we use -o flag than if their are any diagnostics than it will be printed in file otherwise file will be empty
Case 1 : Empty File
Case 2: If Diagnostics present than shown in output
So command is working fine but in documentation it is written:
-o, --output= The output file name. Omitting this flag the result will be printed in the console.
But about validation of file is still written in logs only because of
logGovernanceMessage()
in filesrc\core\parser.ts
asyncapi generate models LANGUAGE FILE
The usage of -o flag in this command is working absolutely fine a folder is created and which contains model file.
But this is created because of
ModelinaFlags
it also has output flag and was not created with help ofvalidationFlags
function.Expected behavior
Solutions I am thinking to fix the issues -
I think we should change field
output
insidevalidationFlags
tooutput-diagnostics
and flag from-o
to--output-diagnostics
so user dont get confuse.For
asyncapi diff OLD NEW
command we will have 3 flags--output-diagnostics
for write diagnostics in file ,-o
for writing console print inside file and-O
(maybe some other flag becuase all flags are in lowercase we can discuss) for override operation.For
asyncapi validate [SPEC-FILE] [PROXYHOST] [PROXYPORT]
command the output print in console is simple and we don't require it to copy in file so this command will have only--output-diagnostics
flag (which is currently present with-o
).For
asyncapi generate models LANGUAGE FILE
command -o is working correctly because ofModelinaFlags
so if we just do above changes it will also have 2 different flags-o
and--output-diagnostics
.Screenshots
Provided above.
How to Reproduce
Already mention above.
🥦 Browser
Google Chrome
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes
The text was updated successfully, but these errors were encountered: