# NAME optex - General purpose command option wrapper # SYNOPSIS **optex** _command_ \[ **-M**_module_ \] ... or _command_ -> **optex** symlink, or **optex** _options_ \[ -l | -m \] ... --link, --ln create symlink --unlink, --rm remove symlink --ls list link files --rc list rc files --nop, -x disable option processing --[no]module disable module option on arguments # DESCRIPTION **optex** is a general purpose option handling wrapper utilizing Perl module [Getopt::EX](https://metacpan.org/pod/Getopt::EX). It enables user to define their own option aliases for any commands on the system, and provide module style extendible capability. Target command is given as argument: % optex command or symbolic link file linked to **optex**: command -> optex If the configuration file `~/.optex.d/`_command_`.rc` exists, it is read before execution and command arguments are pre-processed using that configuration. ## OPTION ALIASES Think of macOS's `date` command, which does not have `-I[TIMESPEC]` option. Using **optex**, these can be implemented by preparing following setting in `~/.optex.d/date.rc` file. option -I -Idate option -Idate +%F option -Iseconds +%FT%T%z option -Iminutes +%FT%H:%M%z option -Ihours +%FT%H%z option --iso-8601 -I option --iso-8601=date -Idate option --iso-8601=seconds -Iseconds option --iso-8601=minutes -Iminutes option --iso-8601=hours -Ihours Then next command will work as expected. % optex date -Iseconds If a symbolic link `date -> optex` is found in command search path, you can use it just same as standard command, but with unsupported options. % date -Iseconds Common configuration is stored in `~/.optex.d/default.rc` file, and those rules are applied to all commands executed through **optex**. Actually, `--iso-8601` option can be defined simpler as this: option --iso-8601 -I$ This works fine almost always, but fails with sole `--iso-8601` option preceding other option like this: % date --iso-8601 -u ## MACROS Complex string can be composed using macro `define`. Next example is an awk script to count vowels in the text, to be declared in file `~/.optex.d/awk.rc`. define __delete__ /[bcdfgkmnpsrtvwyz]e( |$)/ define __match__ /ey|y[aeiou]*|[aeiou]+/ define __count_vowels__ <