mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-19 06:40:08 +01:00
Add new argument type CRYPT_ARG_ALIAS.
It can be used to easily define option aliases for command line utilities.
This commit is contained in:
@@ -3105,6 +3105,15 @@ static void basic_options_cb(poptContext popt_context,
|
||||
}
|
||||
}
|
||||
|
||||
static void cryptsetup_init_arg_aliases(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 1; i < ARRAY_SIZE(tool_core_args); i++)
|
||||
if (tool_core_args[i].type == CRYPT_ARG_ALIAS)
|
||||
ARG_INIT_ALIAS(i);
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
static struct poptOption popt_help_options[] = {
|
||||
@@ -3131,6 +3140,9 @@ int main(int argc, const char **argv)
|
||||
const char *aname, *error_message;
|
||||
int r;
|
||||
|
||||
/* initialize aliases */
|
||||
cryptsetup_init_arg_aliases();
|
||||
|
||||
crypt_set_log_callback(NULL, tool_log, &log_parms);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
Reference in New Issue
Block a user