sequencer - correct indentation using .editorconfig

This commit is contained in:
2022-03-14 21:31:53 +01:00
parent 71612aef94
commit 992868b14d

View File

@@ -144,15 +144,15 @@ sequencer.sh global variables:
sequencer.sh build-in functions: sequencer.sh build-in functions:
USAGE_API USAGE_API
echo -e "${GREEN} exe [COMMANDLINE]${NC}" echo -e "${GREEN} exe [COMMANDLINE]${NC}"
cat <<USAGE_API cat <<USAGE_API
Execute command line without pipes or redirects (>,<,|). Execute command line without pipes or redirects (>,<,|).
Supporting: dry-run (-d): only print command without execution Supporting: dry-run (-d): only print command without execution
verbose (-v): print command before execution verbose (-v): print command before execution
USAGE_API USAGE_API
echo -e "${GREEN} exep \"[COMMAND STRING(s)]\"${NC}" echo -e "${GREEN} exep \"[COMMAND STRING(s)]\"${NC}"
cat <<USAGE_API cat <<USAGE_API
See exe, but support for pipes or redirects. See exe, but support for pipes or redirects.
e.g.: exep echo hello world \\> \\'out put.log\\' e.g.: exep echo hello world \\> \\'out put.log\\'
exep echo hello world \\> out\\\\ put.log exep echo hello world \\> out\\\\ put.log
@@ -163,14 +163,14 @@ cat <<USAGE_API
- All apostrophes need to be esacped since the command line is given as string. - All apostrophes need to be esacped since the command line is given as string.
USAGE_API USAGE_API
echo -e "${GREEN} escpath <PATH>${NC}" echo -e "${GREEN} escpath <PATH>${NC}"
cat <<USAGE_API cat <<USAGE_API
Escaping non-printable characters with the proposed POSIX $'' syntax Escaping non-printable characters with the proposed POSIX $'' syntax
e.g. \$(escpath /my own/ho me/path) = $(escpath /my own/ho me/path) e.g. \$(escpath /my own/ho me/path) = $(escpath /my own/ho me/path)
USAGE_API USAGE_API
echo -e "${GREEN} initSeqConfig [OPTION] <NAME> [TEMPLATE]${NC}" echo -e "${GREEN} initSeqConfig [OPTION] <NAME> [TEMPLATE]${NC}"
cat <<USAGE_API cat <<USAGE_API
Create a configuration file in $SEQ_CONFIG_HOME/ and source it if already existent. Create a configuration file in $SEQ_CONFIG_HOME/ and source it if already existent.
[OPTION] [OPTION]
-p : Use profiles -p : Use profiles
@@ -184,8 +184,8 @@ cat <<USAGE_API
3 : No configuration created 3 : No configuration created
USAGE_API USAGE_API
echo -e "${GREEN} addConf <OPTIONS> [SOURCE TYPE] <SOURCE> <DESTINATION FILE>${NC}" echo -e "${GREEN} addConf <OPTIONS> [SOURCE TYPE] <SOURCE> <DESTINATION FILE>${NC}"
cat <<USAGE_API cat <<USAGE_API
Trying to write or append text or a file (<SOURCE>) to a destination file. Trying to write or append text or a file (<SOURCE>) to a destination file.
If the CONFIGFILE exists, a backup (name_%Y%m%d-%H%M%S.bck) is saved at the same location. If the CONFIGFILE exists, a backup (name_%Y%m%d-%H%M%S.bck) is saved at the same location.
If -s fails or -m, "$(realpath "$MISSING_CONF")" is created with the conflicts If -s fails or -m, "$(realpath "$MISSING_CONF")" is created with the conflicts
@@ -203,65 +203,65 @@ cat <<USAGE_API
Target file to be created or modified. Target file to be created or modified.
USAGE_API USAGE_API
echo -e "${GREEN} step <STEP NUMBER OR ALIAS>${NC}" echo -e "${GREEN} step <STEP NUMBER OR ALIAS>${NC}"
cat <<USAGE_API cat <<USAGE_API
Executes a single step also by alias. Useful if step numbers get reorganized. Executes a single step also by alias. Useful if step numbers get reorganized.
dry-run is not applied in this function! The executed step is responsible. dry-run is not applied in this function! The executed step is responsible.
USAGE_API USAGE_API
echo -e "${GREEN} outColor [FOREGROUND COLOR] [BACKGROUND COLOR]${NC}" echo -e "${GREEN} outColor [FOREGROUND COLOR] [BACKGROUND COLOR]${NC}"
cat <<USAGE_API cat <<USAGE_API
Set output color permanently until reset. Set output color permanently until reset.
No argument or unknown foreground color restores shell default (reset). No argument or unknown foreground color restores shell default (reset).
Color reset happens after every step and step_info function call. Color reset happens after every step and step_info function call.
[COLOR]: black, red, green, yellow, blue, magenta, cyan, white [COLOR]: black, red, green, yellow, blue, magenta, cyan, white
USAGE_API USAGE_API
echo -e "${GREEN} echoerr [...]${NC}" echo -e "${GREEN} echoerr [...]${NC}"
cat <<USAGE_API cat <<USAGE_API
echo to stderr echo to stderr
[...] : all parameter are forwarded to echo [...] : all parameter are forwarded to echo
USAGE_API USAGE_API
echo -e "${GREEN} echoseq [...]${NC}" echo -e "${GREEN} echoseq [...]${NC}"
cat <<USAGE_API cat <<USAGE_API
echo to stdout if sequencer output is not suppressed echo to stdout if sequencer output is not suppressed
[...] : all parameter are forwarded to echo [...] : all parameter are forwarded to echo
USAGE_API USAGE_API
echo -e "${GREEN} echoinfo [...]${NC}" echo -e "${GREEN} echoinfo [...]${NC}"
cat <<USAGE_API cat <<USAGE_API
echo additional correctly indented line to step info echo additional correctly indented line to step info
[...] : all parameter are forwared to echo [...] : all parameter are forwared to echo
USAGE_API USAGE_API
echo -e "${GREEN} echoinfoArgs [...]${NC}" echo -e "${GREEN} echoinfoArgs [...]${NC}"
cat <<USAGE_API cat <<USAGE_API
echo argument description after step number or alias. echo argument description after step number or alias.
This must be called first in the step info function. This must be called first in the step info function.
Does not add a newline at the end. Does not add a newline at the end.
[...] : no parameter are forwared to echo [...] : no parameter are forwared to echo
USAGE_API USAGE_API
echo -e "${GREEN} endCheckEmpty <VARIABLENAME> [DESCRIPTION]${NC}" echo -e "${GREEN} endCheckEmpty <VARIABLENAME> [DESCRIPTION]${NC}"
cat <<USAGE_API cat <<USAGE_API
exit 666 if variable is empty exit 666 if variable is empty
<VARIABLENAME> : Name used within eval <VARIABLENAME> : Name used within eval
[DESCRIPTION] : Additional text for error output [DESCRIPTION] : Additional text for error output
USAGE_API USAGE_API
echo -e "${GREEN} saveReturn [ERRORCODE]${NC}" echo -e "${GREEN} saveReturn [ERRORCODE]${NC}"
cat <<USAGE_API cat <<USAGE_API
Save ERRORCODE if it is != 0 for later use with endReturn Save ERRORCODE if it is != 0 for later use with endReturn
USAGE_API USAGE_API
echo -e "${GREEN} getReturn${NC}" echo -e "${GREEN} getReturn${NC}"
cat <<USAGE_API cat <<USAGE_API
Return last saved error code Return last saved error code
USAGE_API USAGE_API
echo -e "${GREEN} endReturn [OPTIONS] [MESSAGE]${NC}" echo -e "${GREEN} endReturn [OPTIONS] [MESSAGE]${NC}"
cat <<USAGE_API cat <<USAGE_API
Notifys user that there was an error (previously saved by saveReturn, Notifys user that there was an error (previously saved by saveReturn,
or -o [ERRORCODE]) and asks to continue or end the sequence. or -o [ERRORCODE]) and asks to continue or end the sequence.
Always exits with evaluated error code. Always exits with evaluated error code.
@@ -272,8 +272,8 @@ cat <<USAGE_API
String which is displayed in the error output String which is displayed in the error output
USAGE_API USAGE_API
echo -e "${GREEN} exitIfRunning${NC}" echo -e "${GREEN} exitIfRunning${NC}"
cat <<USAGE_API cat <<USAGE_API
End sequence if an instance of it is still running End sequence if an instance of it is still running
USAGE_API USAGE_API
@@ -281,10 +281,10 @@ USAGE_API
# check if there is another PID other than this one # check if there is another PID other than this one
exitIfRunning() { exitIfRunning() {
if pidof -o %PPID -x "${0##*/}">>/dev/null; then if pidof -o %PPID -x "${0##*/}">>/dev/null; then
echoseq " [E] Sequence already running" echoseq " [E] Sequence already running"
exit 1 exit 1
fi fi
} }
# Echo only if not -qq ($QUIET -ne 2) # Echo only if not -qq ($QUIET -ne 2)