| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_printActionPreamble { |
| |
| |
| local ARGSS='' |
| |
| |
| local ARGSL='to-create,to-delete,to-locale,to-edit' |
| |
| |
| |
| local ARGUMENTS='' |
| |
| |
| local MESSAGE='' |
| |
| |
| local OPTION='' |
| |
| |
| |
| |
| local FILE='' |
| |
| |
| cli_parseArgumentsReDef "$@" |
| |
| |
| cli_parseArguments |
| |
| |
| eval set -- "$ARGUMENTS" |
| |
| |
| local FILES=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') |
| |
| |
| local COUNT=$(echo $FILES | wc -l) |
| |
| |
| while true;do |
| |
| case "$1" in |
| |
| --to-create ) |
| if [[ $FILES == '--' ]];then |
| MESSAGE="`gettext "There is no entry to create."`" |
| OPTION='--as-error-line' |
| else |
| MESSAGE="`ngettext "The following entry will be created" \ |
| "The following entries will be created" $COUNT`:" |
| OPTION='' |
| fi |
| shift 2 |
| break |
| ;; |
| |
| --to-delete ) |
| if [[ $FILES == '--' ]];then |
| MESSAGE="`gettext "There is no file to delete."`" |
| OPTION='--as-error-line' |
| else |
| MESSAGE="`ngettext "The following entry will be deleted" \ |
| "The following entries will be deleted" $COUNT`:" |
| OPTION='' |
| fi |
| shift 2 |
| break |
| ;; |
| |
| --to-locale ) |
| if [[ $FILES == '--' ]];then |
| MESSAGE="`gettext "There is no file to locale."`" |
| OPTION='--as-error-line' |
| else |
| MESSAGE="`ngettext "Translatable strings will be retrived from the following entry" \ |
| "Translatable strings will be retrived from the following entries" $COUNT`:" |
| OPTION='' |
| fi |
| shift 2 |
| break |
| ;; |
| |
| --to-edit ) |
| if [[ $FILES == '--' ]];then |
| MESSAGE="`gettext "There is no file to edit."`" |
| OPTION='--as-error-line' |
| else |
| MESSAGE="`ngettext "The following file will be edited" \ |
| "The following files will be edited" $COUNT`:" |
| OPTION='' |
| fi |
| shift 2 |
| break |
| ;; |
| |
| -- ) |
| if [[ $FILES == '--' ]];then |
| MESSAGE="`gettext "There is no file to process."`" |
| OPTION='--as-error-line' |
| else |
| MESSAGE="`ngettext "The following file will be processed" \ |
| "The following files will be processed" $COUNT`:" |
| OPTION='' |
| fi |
| shift 1 |
| break |
| ;; |
| esac |
| done |
| |
| |
| cli_printMessage "${MESSAGE}" "${OPTION}" |
| for FILE in $FILES;do |
| cli_printMessage "$FILE" --as-response-line |
| done |
| cli_printMessage "`gettext "Do you want to continue"`" --as-yesornorequest-line |
| |
| } |