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

REGRESSION: Fix console command completion help #5040

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

dhthwy
Copy link
Contributor

@dhthwy dhthwy commented Nov 23, 2024

Console command completion help was inadvertently broken in a prior commit. This PR should resolve the issue. Tested on posix console.

This could probably use a test, if I can figure out a proper way to do it.

@dhthwy dhthwy changed the title Fill in commands list for console command completion REGRESSION: Fix console command completion help Nov 23, 2024
Copy link
Member

@lethosor lethosor left a comment

Choose a reason for hiding this comment

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

works on my end too

@lethosor
Copy link
Member

This actually would not be that hard to test from Lua:

[lua]# ~dfhack.internal.runCommand('autodum')[1]
table: 0x7fff98822d50
1                        = 12
2                        = autodum is not recognized. Possible completions: autodump autodump-destroy-here autodump-destroy-item

but I'm not sure how to best make it robust to new tools being added, because the current logic gives no completions if there are too many possibilities:

[lua]# ~dfhack.internal.runCommand('aut')[1]
table: 0x7fff985387d0
1                        = 12
2                        = aut is not a recognized command.

@quietust
Copy link
Member

Looks like this broke way back in 2022 with commit e926e11.

@dhthwy
Copy link
Contributor Author

dhthwy commented Nov 24, 2024

if helpdb handled command aliases we could make some nonsense alias to a command and do it that way. Otherwise we'd have to construct a new one - and I don't know how to do that in a test.

There aren't that many commands, the limit of 8 should be much higher. Maybe even no limit provided that the list of possibles isn't the full command set.

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