diff --git a/.gitignore b/.gitignore index 65f46a51..9b126a70 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/zconf/scm/Makefile b/zconf/scm/Makefile index 12faf447..5149d44b 100644 --- a/zconf/scm/Makefile +++ b/zconf/scm/Makefile @@ -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 diff --git a/zconf/scm/autocompletion_generator_host.c b/zconf/scm/autocompletion_generator_host.c new file mode 100644 index 00000000..827ea2a5 --- /dev/null +++ b/zconf/scm/autocompletion_generator_host.c @@ -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; +} diff --git a/zconf/scm/lsscm.c b/zconf/scm/lsscm.c index 2cf18522..98087190 100644 --- a/zconf/scm/lsscm.c +++ b/zconf/scm/lsscm.c @@ -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 * diff --git a/zconf/scm/lsscm_cli.h b/zconf/scm/lsscm_cli.h new file mode 100644 index 00000000..44a7a177 --- /dev/null +++ b/zconf/scm/lsscm_cli.h @@ -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