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

Add a help action #29

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Add a help action #29

merged 4 commits into from
Feb 16, 2024

Conversation

xphere
Copy link
Contributor

@xphere xphere commented Feb 9, 2024

I'm trying this tool and it's amazing!
It's the piece I missed the most in the Godot ecosystem, so thank you!
The problem is that I find myself often going to the docs to remember how to use it.

I took the liberty to add a help action which shows a list with the syntax and exits.
This also shows when no action or an unknown one is supplied.
Descriptions of actions and options are copied & pasted from the README.
I hope it's helpful!

A screenshot:
image

@imjp94
Copy link
Owner

imjp94 commented Feb 14, 2024

Hey @xphere, glad that it helps!
So true, I always have to open the README to check the commands XD

But we might have to simplify this PR to make it cross platform, as print_rich doesn't works properly on Windows 10
Screenshot 2024-02-14 114814
See godotengine/godot#2308 and godotengine/godot#80031

If you wish to edit this PR, I would suggest printing the instruction with logger like logger.info() for consistency.

@xphere
Copy link
Contributor Author

xphere commented Feb 14, 2024

If you wish to edit this PR, I would suggest printing the instruction with logger like logger.info() for consistency.

Ouch, you're right! Without the colors it is a lot harder to understand, but it's still helpful. It would be nice if there's a way to keep the colors for other systems that are capable of it, maybe we can detect these capabilities and strip bbcodes for those not supporting. In fact I thought godot was doing thiat under the hood. I'll investigate a bit and fix this.

@xphere
Copy link
Contributor Author

xphere commented Feb 14, 2024

I've been playing with an old computer with Windows 10, but I can't find an easy way to detect ANSI support. I'm removing bbcodes and using logger.info instead of print_rich for better compatibility.

@imjp94
Copy link
Owner

imjp94 commented Feb 15, 2024

Suddenly have an idea to enhance the output with table-like layout(using rows & columns)
Screenshot 2024-02-15 132521

And adding help-config command to show configs documentation
Screenshot 2024-02-15 132444

Let me know if you are okay with the changes or is there anything to add.
Otherwise, I think we are ready to merge this PR =)

@xphere
Copy link
Contributor Author

xphere commented Feb 15, 2024

Suddenly have an idea to enhance the output with table-like layout(using rows & columns)

I've tried this before adding colors and descriptions wrapped easily (especially with keep-import-resource-file displacing everything to the right) but I can give it a try again now that ANSI colors are dismissed.

And adding help-config command to show configs documentation

That's a neat idea, will look into it too. 👌🏻

@imjp94
Copy link
Owner

imjp94 commented Feb 15, 2024

Oh no, I mean I already implemented those 2 features in the last 2 commits.

If you are fine with the changes I made, we can then merge this PR

@xphere
Copy link
Contributor Author

xphere commented Feb 15, 2024

Oh, nice, didn't saw your commits! Great, fine by me! :shipit: 💪🏻

Have you seen last news for Godot 4.3? https://twitter.com/HugoLocurcio/status/1757843848154206653
I'm curious if someone fixed print_rich or not 😅

@imjp94
Copy link
Owner

imjp94 commented Feb 16, 2024

Have you seen last news for Godot 4.3? https://twitter.com/HugoLocurcio/status/1757843848154206653
I'm curious if someone fixed print_rich or not 😅

Nope, it doesn't works on Windows 10...

Screenshot 2024-02-16 120030

@imjp94 imjp94 merged commit b762f28 into imjp94:master Feb 16, 2024
@imjp94
Copy link
Owner

imjp94 commented Feb 16, 2024

Thank you!

@xphere
Copy link
Contributor Author

xphere commented Feb 16, 2024

Nice, I'm glad to contribute! 🎉

FYI, I discovered a workaround if you're using git-bash or a similar terminal in Windows: you can pipe the command to cat or any other text command (head or less -R) and it re-colorizes the output.

image

@xphere xphere deleted the add-help-command branch February 16, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants