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

Alternative names for console command options #1693

Closed
bschmalhofer opened this issue Mar 28, 2022 · 2 comments
Closed

Alternative names for console command options #1693

bschmalhofer opened this issue Mar 28, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@bschmalhofer
Copy link
Contributor

It would be nice if alternative option names could be specified in console commands. An useful example would be the alias 'v' for the option 'verbose'.

Originally posted by @bschmalhofer in #788 (comment)

@bschmalhofer bschmalhofer added this to the Wishlist milestone Mar 28, 2022
@bschmalhofer bschmalhofer modified the milestones: Wishlist, OTOBO 11.1 Jun 23, 2024
@bschmalhofer bschmalhofer added the enhancement New feature or request label Feb 14, 2025
bschmalhofer added a commit that referenced this issue Feb 14, 2025
The CanonicalName must be specified in that case. The canonical
name must be one of the alternatives.
@bschmalhofer bschmalhofer modified the milestones: OTOBO 11.1, OTOBO 11.1.1 Feb 14, 2025
bschmalhofer added a commit that referenced this issue Feb 14, 2025
The CanonicalName must be specified in that case. The canonical
name must be one of the alternatives.
@bschmalhofer
Copy link
Contributor Author

Tested by setting up an alternative name:

 git diff
diff --git a/Kernel/System/Console/Command/Dev/Package/Build.pm b/Kernel/System/Console/Command/Dev/Package/Build.pm
index 61785b0f1f..0c1b13a1fc 100644
--- a/Kernel/System/Console/Command/Dev/Package/Build.pm
+++ b/Kernel/System/Console/Command/Dev/Package/Build.pm
@@ -38,12 +38,12 @@ sub Configure {
         ValueRegex  => qr/^\d{1,4}[.]\d{1,4}[.]\d{1,4}$/smx,
     );
     $Self->AddOption(
-        Name        => 'module-directory',
-        Description =>
-            "Specify the directory containing the module sources (otherwise the OTOBO home directory will be used).",
-        Required   => 0,
-        HasValue   => 1,
-        ValueRegex => qr/.*/smx,
+        Name          => 'module-directory|dir',
+        CanonicalName => 'module-directory',
+        Description   => "Specify the directory containing the module sources (otherwise the OTOBO home directory will be used).",
+        Required      => 0,
+        HasValue      => 1,
+        ValueRegex    => qr/.*/smx,
     );
     $Self->AddArgument(
         Name        => 'source-path',

So that the command bin/otobo.Console.pl Dev::Package::Build --version 0.0.7 --dir ../ticketicalintegration ../ticketicalintegration/TicketIcalIntegration.sopm var/opm works.

PR is merged. Closing this issue.

@stefanhaerter
Copy link
Contributor

Very cool improvement, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants