mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
libutil: Implement zsh and bash autocompletion
Add functionality for generating autocompletion scripts, allowing for tab completion of tool options for bash and zsh. This functionality relies on reading the available options from the util_opt struct at runtime. The script generation happens on the build system. Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Szabina Korbai <szkorbai@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
70157462d8
commit
638cbbe332
22
include/lib/util_autocomp.h
Normal file
22
include/lib/util_autocomp.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* autocomp - command line autocompletion
|
||||
*
|
||||
* Generating autocompletion scripts for bash and zsh
|
||||
* based on util_opt struct
|
||||
*
|
||||
* Copyright IBM Corp. 2025
|
||||
*
|
||||
* s390-tools is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LIB_UTIL_AUTOCOMP_H
|
||||
#define LIB_UTIL_AUTOCOMP_H
|
||||
|
||||
#include "lib/util_opt.h"
|
||||
|
||||
void generate_autocomp(struct util_opt *opt_vec, char *tool_name);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user