[BUG] inconsistent uses of `-o` flag in some commands
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 from validationFlags() .
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=logGovernanceMessage() in file src\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 of validationFlags function.
Expected behavior
Solutions I am thinking to fix the issues -
-
I think we should change field
outputinsidevalidationFlagstooutput-diagnosticsand flag from-oto--output-diagnosticsso user dont get confuse. -
For
asyncapi diff OLD NEWcommand we will have 3 flags--output-diagnosticsfor write diagnostics in file ,-ofor 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-diagnosticsflag (which is currently present with-o). -
For
asyncapi generate models LANGUAGE FILEcommand -o is working correctly because ofModelinaFlagsso if we just do above changes it will also have 2 different flags-oand--output-diagnostics.
Screenshots
Provided above.
How to Reproduce
Already mention above.
🥦 Browser
Google Chrome
👀 Have you checked for similar open issues?
- [x] I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- [x] I have read the Contributing Guidelines
Are you willing to work on this issue ?
No
Waiting for issue approval by maintainers. Please assign me the issue.
Please explain me if I am missing something and understanding something wrong.
@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. thanks : )
Is this fixed? I still have the same issue in 3.1.1
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
Same issue with the diff command, when running the help command it says two options for -o
-f, --format=<option>
[default: yaml] format of the output
<options: json|yaml|yml|md>
-h, --help
Show CLI help.
-o, --output=<value>
The output file name. Omitting this flag the result will be printed in the
console.
-o, --overrides=<value>
path to JSON file containing the override properties
-t, --type=<option>
[default: all] type of the output
<options: breaking|non-breaking|unclassified|all>
-w, --watch
Enable watch mode
--diagnostics-format=<option>
[default: stylish] format to use for validation diagnostics
<options: json|stylish|junit|html|text|teamcity|pretty>
--fail-severity=<option>
[default: error] diagnostics of this level or above will trigger a failure
exit code
<options: error|warn|info|hint>
--[no-]log-diagnostics
log validation diagnostics or not
--markdownSubtype=<option>
the format of changes made to AsyncAPI document. It works only when diff is
generated using md type. For example, when you specify subtype as json, then
diff information in markdown is dumped as json structure.
<options: json|yaml|yml>
--no-error
don't show error on breaking changes
DESCRIPTION
Find diff between two asyncapi files
Sorry for taking too long to circle back on this issue. Yes, this is a very important issue. Please go ahead with creating a PR @Adi-204.
@Shurtu-gal I believe this is a very important issue. Unfortunately, I won’t be able to work on it over the next few days due to other commitments. It would be great if another contributor could take it up, or ideally, if one of the maintainers could address it, as I recall it being a bit complex. thanks :)
Unfortunately, I won’t be able to work on it over the next few days due to other commitments. It would be great if another contributor could take it up, or ideally, if one of the maintainers could address it, as I recall it being a bit complex. thanks :)
I can take this up @Shurtu-gal . No problem.
Sure @neoandmatrix Thanks 🫂
A possible name could be --config-overrides probably.
WDYT @AayushSaini101 @Souvikns ?