File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,9 @@ exec_help(int argc, char **argv)
222222 bool plugins_enabled = false;
223223 struct plugcmd * c ;
224224 unsigned int i ;
225+ const pkg_object * all_aliases ;
226+ const pkg_object * alias ;
227+ pkg_iter it = NULL ;
225228
226229 if ((argc != 2 ) || (strcmp ("help" , argv [1 ]) == 0 )) {
227230 usage_help ();
@@ -264,6 +267,15 @@ exec_help(int argc, char **argv)
264267 return (0 );
265268 }
266269
270+ /* Try aliases */
271+ all_aliases = pkg_config_get ("ALIAS" );
272+ while ((alias = pkg_object_iterate (all_aliases , & it ))) {
273+ if (strcmp (argv [1 ], pkg_object_key (alias )) == 0 ) {
274+ printf ("`%s` is an alias to `%s`\n" , argv [1 ], pkg_object_string (alias ));
275+ return (0 );
276+ }
277+ }
278+
267279 /* Command name not found */
268280 warnx ("'%s' is not a valid command.\n" , argv [1 ]);
269281
You can’t perform that action at this time.
0 commit comments