mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
lsscm: 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
f70991ab1e
commit
6dbc5646f9
2
.gitignore
vendored
2
.gitignore
vendored
@@ -134,6 +134,8 @@ zconf/qeth/lsqeth
|
||||
zconf/qeth/_lsqeth
|
||||
zconf/qeth/lsqeth.bash
|
||||
zconf/scm/lsscm
|
||||
zconf/scm/_lsscm
|
||||
zconf/scm/lsscm.bash
|
||||
zconf/zcrypt/chzcrypt
|
||||
zconf/zcrypt/lszcrypt
|
||||
zconf/zcrypt/zcryptctl
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
include ../../common.mak
|
||||
|
||||
zsh-completions = _lsscm
|
||||
bash-completions = lsscm.bash
|
||||
|
||||
include ../../common_autocomp.mak
|
||||
|
||||
all: lsscm
|
||||
|
||||
libs = $(rootdir)/libutil/libutil.a
|
||||
|
||||
16
zconf/scm/autocompletion_generator_host.c
Normal file
16
zconf/scm/autocompletion_generator_host.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright IBM Corp.
|
||||
*/
|
||||
|
||||
#include "lib/util_autocomp.h"
|
||||
|
||||
#include "lsscm_cli.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
generate_autocomp(opt_vec, "lsscm");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "lib/util_scandir.h"
|
||||
#include "lib/zt_common.h"
|
||||
|
||||
#include "lsscm_cli.h"
|
||||
|
||||
/*
|
||||
* Program configuration
|
||||
*/
|
||||
@@ -34,15 +36,6 @@ const struct util_prg prg = {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Configuration of command line options
|
||||
*/
|
||||
static struct util_opt opt_vec[] = {
|
||||
UTIL_OPT_HELP,
|
||||
UTIL_OPT_VERSION,
|
||||
UTIL_OPT_END
|
||||
};
|
||||
|
||||
/**
|
||||
* Print all attributes of one device
|
||||
*
|
||||
|
||||
21
zconf/scm/lsscm_cli.h
Normal file
21
zconf/scm/lsscm_cli.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright IBM Corp.
|
||||
*/
|
||||
|
||||
#ifndef LSSCM_CLI_H
|
||||
#define LSSCM_CLI_H
|
||||
|
||||
#include "lib/util_opt.h"
|
||||
|
||||
/*
|
||||
* Configuration of command line options
|
||||
*/
|
||||
static struct util_opt opt_vec[] = {
|
||||
UTIL_OPT_HELP,
|
||||
UTIL_OPT_VERSION,
|
||||
UTIL_OPT_END
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user