Skip to content
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

feat: support command-specific help and improve display quality #52

Merged
merged 10 commits into from
Aug 26, 2021
Merged

feat: support command-specific help and improve display quality #52

merged 10 commits into from
Aug 26, 2021

Conversation

Souvikns
Copy link
Member

Description

  • Creating support for root and command level help components.
  • Using ink to create beautiful help components.

Related issue(s)

Fixes #22

@Souvikns
Copy link
Member Author

All help messages

asyncapi --help

image

asyncapi validate --help

image

asyncapi context --help

image

@Souvikns
Copy link
Member Author

@derberg pr is ready for review.

@derberg
Copy link
Member

derberg commented Aug 23, 2021

love it mate!

how about in such cases:

$ asyncapi validate
Unable to perform validation. Specify what AsyncAPI file should be validated.

These are your options to specify in the CLI what AsyncAPI file should be used:
- You can use --file flag to provide a path to the AsyncAPI file: asyncapi validate --file path/to/file/asyncapi.yml
- You can use --context flag to provide a name of the context that points to your AsyncAPI file: asyncapi validate 
--context mycontext
- In case you did not specify a context that you want to use, the CLI checks if there is a default context and uses 
it. To set default context run: asyncapi context use mycontext
- In case you did not provide any reference to AsyncAPI file and there is no default context, the CLI detects if in 
your current working directory you have files like asyncapi.json, asyncapi.yaml, asyncapi.yml. Just rename your file
 accordingly.

or will it followup as now you just focused on part related to help?

@derberg derberg changed the title feat: improving help command feat: support command-specific help and improve display quality Aug 23, 2021
src/help-message.tsx Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
@Souvikns
Copy link
Member Author

Not all terminals have similar support for colors, so in some terminals, it is not looking good and also have visibility issue. Like in CMD -
image

@derberg
Copy link
Member

derberg commented Aug 24, 2021

@Souvikns I think it is ok if it is not that good in windows commander, I checked in basic mac terminal and it looks good. Imho it is acceptable

src/cli.ts Show resolved Hide resolved
@derberg
Copy link
Member

derberg commented Aug 24, 2021

@Souvikns I approved but there is one more comment?

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

@Souvikns what about this comment + I see you removed the entire info about the version, but the version works fine, just problem is that only -v alias doesn't work out of the box, so please document just version

@Souvikns
Copy link
Member Author

Then let me update it in the readme and as well as in the cli messages.

@Souvikns
Copy link
Member Author

@derberg actually the way I have written the code it splits the flag alias and flag param for highlighting so it is coming something like this, does this look ok?

image

@derberg
Copy link
Member

derberg commented Aug 24, 2021

@Souvikns it would make sense to highlight --help too, so always highlight all flags imho

@Souvikns
Copy link
Member Author

ok sure then.

@Souvikns
Copy link
Member Author

The initial help message has been changed how shall we update the readme file to support this. Should I put a screenshot or just make some kind of walkthrough in the usage to how to access help messages for different commands.

@derberg
Copy link
Member

derberg commented Aug 24, 2021

make it easy now, we can beautify readme later, just screen shots of output from each help, or copy-paste of help text

@Souvikns
Copy link
Member Author

Souvikns commented Aug 24, 2021

Then should I update the readme in this PR?
I was thinking It would be good to have proper documentation of all the commands and have examples alongside it.

@derberg
Copy link
Member

derberg commented Aug 24, 2021

Yeah, just simple mupdate is needed of what we have now to reflect reality. Better docs, descriptions and some walkthrough can be done in a followup

@Souvikns
Copy link
Member Author

@derberg does this look good. I guess adding an image for the root help we would have to update the image every time we add new commands.
asyncapi-help

@derberg
Copy link
Member

derberg commented Aug 25, 2021

@Souvikns I definitely agree that at this stage doing images would be to much. We should just update CLI section though, what you see after asyncapi --help and what after asyncapi context --help and asyncapi validate --help

@derberg derberg merged commit fe64573 into asyncapi:master Aug 26, 2021
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Souvikns Souvikns deleted the help-improvement branch September 9, 2021 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvement with help command
3 participants