lsstp: Implement zsh and bash autocompletion

Add generation of shell autocompletion scripts.

Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Szabina Korbai <szkorbai@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Szabina Korbai
2026-03-06 14:15:41 +01:00
committed by Jan Höppner
parent c459ec08c6
commit 9fdfd1a6dc
5 changed files with 43 additions and 6 deletions

2
.gitignore vendored
View File

@@ -98,6 +98,8 @@ libutil/*_example
libvmcp/vmcp_example
libzds/libzds.a
lsstp/lsstp
lsstp/_lsstp
lsstp/lsstp.bash
mon_tools/mon_fsstatd
mon_tools/mon_procd
opticsmon/opticsmon

View File

@@ -1,5 +1,10 @@
include ../common.mak
zsh-completions = _lsstp
bash-completions = lsstp.bash
include ../common_autocomp.mak
libs = $(rootdir)/libutil/libutil.a
all: lsstp

View File

@@ -0,0 +1,16 @@
/*
* SPDX-License-Identifier: MIT
*
* Copyright IBM Corp.
*/
#include "lib/util_autocomp.h"
#include "lsstp_cli.h"
int main(void)
{
generate_autocomp(opt_vec, "lsstp");
return 0;
}

View File

@@ -22,6 +22,8 @@
#include "lib/util_prg.h"
#include "lib/util_path.h"
#include "lsstp_cli.h"
static const struct util_prg prg = {
.desc = "Display STP system information",
.args = "",
@@ -34,12 +36,6 @@ static const struct util_prg prg = {
}
};
static struct util_opt opt_vec[] = {
UTIL_OPT_HELP,
UTIL_OPT_VERSION,
UTIL_OPT_END
};
struct stp_parms {
uint64_t ctn_id;
unsigned int online;

18
lsstp/lsstp_cli.h Normal file
View File

@@ -0,0 +1,18 @@
/*
* SPDX-License-Identifier: MIT
*
* Copyright IBM Corp.
*/
#ifndef LSSTP_CLI_H
#define LSSTP_CLI_H
#include "lib/util_opt.h"
static struct util_opt opt_vec[] = {
UTIL_OPT_HELP,
UTIL_OPT_VERSION,
UTIL_OPT_END
};
#endif