Skip to content

Improve command aliasing #1167

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

Open
fmbenhassine opened this issue Apr 24, 2025 · 1 comment · May be fixed by #1170
Open

Improve command aliasing #1167

fmbenhassine opened this issue Apr 24, 2025 · 1 comment · May be fixed by #1170
Labels
type/feature Is a feature request

Comments

@fmbenhassine
Copy link
Contributor

As of v3.4, creating an alias for a command is done as follows:

CommandRegistration commandRegistration() {
	return CommandRegistration.builder()
		.command("mycommand")
		// define alias as myalias
		.withAlias()
			.command("myalias")
			.and()
		// define alias as myalias1 and myalias2
		.withAlias()
			.command("myalias1", "myalias2")
			.and()
		.build();
}

The DSL methods command("alias").and() are repetitive. I suggest to shorten them as follows:

CommandRegistration commandRegistration() {
	return CommandRegistration.builder()
		.command("mycommand")
		// define a single alias
		.withAlias("myalias")
		// or define multiple ones at once
		.withAlias("myalias1", "myalias2")
		.build();
}
@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Apr 24, 2025
@fmbenhassine fmbenhassine added type/feature Is a feature request and removed status/need-triage Team needs to triage and take a first look labels Apr 24, 2025
@fmbenhassine
Copy link
Contributor Author

Might be related to #1127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Is a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant