Skip to content

enhance: add green color to tool call names #182

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

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

g-linville
Copy link
Member

@g-linville g-linville commented Mar 25, 2024

related to #13

When scanning through the output of gptscript, I am usually most interested in finding the tool calls. I figured that making the tool names green would make it easier.

We could easily add more colors to the output as well, but I wasn't really sure what else to do.

Here's an example of what it looks like:
image

Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

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

One nit, otherwise lgtm

@@ -34,6 +35,7 @@ type GPTScript struct {
CacheOptions
OpenAIOptions
DisplayOptions
Color *bool `usage:"Use color in output (default true)" default:"true"`
Copy link
Member

Choose a reason for hiding this comment

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

nit: can this just be a bool instead of *bool?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was following the example of the --cache flag, which you can see here:

Cache *bool `usage:"Disable caching" default:"true"`

It uses a bool pointer. I noticed that when I had just a bool, the default:"true" struct tag didn't do anything, but it worked as soon as I made it a pointer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also I just noticed that the description for --cache is the opposite of what it's supposed to be, lol

@g-linville g-linville merged commit 65e1e09 into gptscript-ai:main Mar 25, 2024
@g-linville g-linville deleted the colors branch March 25, 2024 14:50
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.

3 participants