mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
committed by
Jan Höppner
parent
c459ec08c6
commit
9fdfd1a6dc
2
.gitignore
vendored
2
.gitignore
vendored
@@ -98,6 +98,8 @@ libutil/*_example
|
|||||||
libvmcp/vmcp_example
|
libvmcp/vmcp_example
|
||||||
libzds/libzds.a
|
libzds/libzds.a
|
||||||
lsstp/lsstp
|
lsstp/lsstp
|
||||||
|
lsstp/_lsstp
|
||||||
|
lsstp/lsstp.bash
|
||||||
mon_tools/mon_fsstatd
|
mon_tools/mon_fsstatd
|
||||||
mon_tools/mon_procd
|
mon_tools/mon_procd
|
||||||
opticsmon/opticsmon
|
opticsmon/opticsmon
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
include ../common.mak
|
include ../common.mak
|
||||||
|
|
||||||
|
zsh-completions = _lsstp
|
||||||
|
bash-completions = lsstp.bash
|
||||||
|
|
||||||
|
include ../common_autocomp.mak
|
||||||
|
|
||||||
libs = $(rootdir)/libutil/libutil.a
|
libs = $(rootdir)/libutil/libutil.a
|
||||||
all: lsstp
|
all: lsstp
|
||||||
|
|
||||||
|
|||||||
16
lsstp/autocompletion_generator_host.c
Normal file
16
lsstp/autocompletion_generator_host.c
Normal 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;
|
||||||
|
}
|
||||||
@@ -22,6 +22,8 @@
|
|||||||
#include "lib/util_prg.h"
|
#include "lib/util_prg.h"
|
||||||
#include "lib/util_path.h"
|
#include "lib/util_path.h"
|
||||||
|
|
||||||
|
#include "lsstp_cli.h"
|
||||||
|
|
||||||
static const struct util_prg prg = {
|
static const struct util_prg prg = {
|
||||||
.desc = "Display STP system information",
|
.desc = "Display STP system information",
|
||||||
.args = "",
|
.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 {
|
struct stp_parms {
|
||||||
uint64_t ctn_id;
|
uint64_t ctn_id;
|
||||||
unsigned int online;
|
unsigned int online;
|
||||||
|
|||||||
18
lsstp/lsstp_cli.h
Normal file
18
lsstp/lsstp_cli.h
Normal 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
|
||||||
Reference in New Issue
Block a user