mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
lsqeth: 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
e9ee658492
commit
f70991ab1e
2
.gitignore
vendored
2
.gitignore
vendored
@@ -131,6 +131,8 @@ zconf/css/lscss
|
||||
zconf/css/_lscss
|
||||
zconf/css/lscss.bash
|
||||
zconf/qeth/lsqeth
|
||||
zconf/qeth/_lsqeth
|
||||
zconf/qeth/lsqeth.bash
|
||||
zconf/scm/lsscm
|
||||
zconf/zcrypt/chzcrypt
|
||||
zconf/zcrypt/lszcrypt
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
include ../../common.mak
|
||||
|
||||
zsh-completions = _lsqeth
|
||||
bash-completions = lsqeth.bash
|
||||
|
||||
include ../../common_autocomp.mak
|
||||
|
||||
all: lsqeth
|
||||
|
||||
libs = $(rootdir)/libvmcp/libvmcp.a $(rootdir)/libutil/libutil.a
|
||||
|
||||
16
zconf/qeth/autocompletion_generator_host.c
Normal file
16
zconf/qeth/autocompletion_generator_host.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright IBM Corp.
|
||||
*/
|
||||
|
||||
#include "lib/util_autocomp.h"
|
||||
|
||||
#include "lsqeth_cli.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
generate_autocomp(opt_vec, "lsqeth");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "lib/zt_common.h"
|
||||
#include "lib/vmcp.h"
|
||||
|
||||
#include "lsqeth_cli.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define ID_FORMAT "^[[:xdigit:]]{1,2}[.][[:xdigit:]][.][[:xdigit:]]{4}$"
|
||||
@@ -70,20 +71,6 @@ const struct util_prg prg = {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Command line options
|
||||
*/
|
||||
static struct util_opt opt_vec[] = {
|
||||
UTIL_OPT_SECTION("OPTIONS"),
|
||||
{
|
||||
.option = { "proc", no_argument, NULL, 'p'},
|
||||
.desc = "List all devices in the former /proc/qeth format"
|
||||
},
|
||||
UTIL_OPT_HELP,
|
||||
UTIL_OPT_VERSION,
|
||||
UTIL_OPT_END
|
||||
};
|
||||
|
||||
/*
|
||||
* Exchange content of field value via simple translation map
|
||||
*
|
||||
|
||||
26
zconf/qeth/lsqeth_cli.h
Normal file
26
zconf/qeth/lsqeth_cli.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright IBM Corp.
|
||||
*/
|
||||
|
||||
#ifndef LSQETH_CLI_H
|
||||
#define LSQETH_CLI_H
|
||||
|
||||
#include "lib/util_opt.h"
|
||||
|
||||
/*
|
||||
* Command line options
|
||||
*/
|
||||
static struct util_opt opt_vec[] = {
|
||||
UTIL_OPT_SECTION("OPTIONS"),
|
||||
{
|
||||
.option = { "proc", no_argument, NULL, 'p'},
|
||||
.desc = "List all devices in the former /proc/qeth format"
|
||||
},
|
||||
UTIL_OPT_HELP,
|
||||
UTIL_OPT_VERSION,
|
||||
UTIL_OPT_END
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user