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: command processors #332

Open
TorchedSammy opened this issue Dec 18, 2024 · 0 comments
Open

feat: command processors #332

TorchedSammy opened this issue Dec 18, 2024 · 0 comments

Comments

@TorchedSammy
Copy link
Member

to facilitate features like #246 (and maybe autocd opt) some sort of "command processing" pipeline can be implemented. these are distinct from runners since they arent meant to actually run commands, theyre just meant to turn 1 command input into another. it will need context on the current runner in use though.

a processor function signature will look like:

function processor(command)
	return {
		continue = true,
		command = ''
	}
end
  • continue determines whether hilbish should continue with command execution (to pass it to a runner) or not. commands not continued will not be saved to history. this is the only required return value in the table.
  • command if present will be the command string passed to the runner. if it is not present, it will use the same command string passed to the processor.

when defining processors, it will work with a number based priority system. the lower the number, the earlier it runs.
2 processors, one with a priority value of -10 and another with a priority value of 3, the processor with -10 priority will run first, and then be passed to the next processor. this means early priority processors determine if further processing and execution happens. default processors will have documented and stable default priority values.

@TorchedSammy TorchedSammy added this to the v2.4 (Moonflower) milestone Dec 18, 2024
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

No branches or pull requests

1 participant