You could store the arguments in an array:
args=(
InputFiles # This is the comment for the 1st line
--option1 arg1 # This is the comment for the 2nd line
--option2 arg2 # This is the comment for the 3nd line
#--deprecated-option # Option disabled
)
CommandName "${args[@]}"
and you can even add blank lines to enhance readability:
args=(
# This is the comment for the 1st line
InputFiles
# This is the comment for the 2nd line
--option1 arg1
# This is the comment for the 3nd line
--option2 arg2
# Option disabled
#--deprecated-option
)
CommandName "${args[@]}"
If you need to use other shell operators, such as booleans and pipes, you cannot place them inside the array(s) but you can "glue" them together when you execute:
args1=(
InputFiles # This is the comment for the 1st line
--option1 arg1 # This is the comment for the 2nd line
--option2 arg2 # This is the comment for the 3nd line
#--deprecated-option # Option disabled
)
args2=(
--option arg # Another comment
example.config
)
success=(
# Put the command in the array if it is clearer
notify-send
Hooray
'The thing is done'
)
fail=(
notify-send
'Uh oh'
"The thing didn't work"
)
CommandName1 "${args1[@]}" | CommandName2 "${args2[@]}" 2>> error.log && "${success[@]}" || "${fail[@]}"