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

Commands for prompt #199

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

grcooper
Copy link

@grcooper grcooper commented Feb 1, 2024

Describe the change

This PR adds in an entirely new type to the prompt - commands.

This fulfills the ability to have an interactive shell where the user is able to input items and the console shows possible commands that they can run given the currently entered characters.

Screen.Recording.2024-02-01.at.1.00.23.PM.mov

Why are we doing this? / Benefits

This acts very similar to a single line input, but it provides hints toward what you should enter. I couldn't find a good way to do this with the current implementation so I decided to add my own. I think this is very useful in command like systems where you have a choice, but that choice also has optional or different post-fix than the selection we are actually using.

In the future I could see adding support for things like optional arguments, or different ways to color/display.

Drawbacks

Adds another system to support, the single-line input basically does this except without the suggestions, it's not a new type of input, just a new type of suggestions. Could possibly be added to single-line input instead.

Requirements

  • Tests written & passing locally?
  • Code style checked?
  • Rebased with master branch?
  • Documentation updated?
  • Changelog updated?

@@ -1539,7 +1540,7 @@ Print message(s) in green do:
prompt.ok(...)
```

#### 2.12.2 warn
#### 2.11.2 warn
Copy link
Author

Choose a reason for hiding this comment

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

Minor edit to the readme - this should be done regardless of if this PR goes through.

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.

None yet

1 participant