| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_printCopyrightInfo { |
| |
| |
| local ARGSL='' |
| |
| |
| local ARGSL='license,license-url,coyright,copyright-year,copyright-year-last,copyright-year-first,copyright-year-list,copyright-year-range,copyright-holder' |
| |
| |
| |
| local ARGUMENTS='' |
| |
| |
| cli_parseArgumentsReDef "$@" |
| |
| |
| cli_parseArguments |
| |
| |
| eval set -- "$ARGUMENTS" |
| |
| |
| while true; do |
| |
| case "$1" in |
| |
| --license ) |
| |
| |
| |
| |
| echo "Creative Common Attribution-ShareAlike 3.0" |
| shift 2 |
| break |
| ;; |
| |
| --license-url ) |
| |
| |
| |
| |
| cli_printUrl --cc-sharealike |
| shift 2 |
| break |
| ;; |
| |
| --copyright-year-first ) |
| |
| |
| |
| |
| |
| echo '2009' |
| shift 2 |
| break |
| ;; |
| |
| --copyright-year|--copyright-year-last ) |
| |
| |
| |
| |
| |
| |
| date +%Y |
| shift 2 |
| break |
| ;; |
| |
| --copyright-year-range ) |
| |
| local FIRST_YEAR=$(cli_printCopyrightInfo '--copyright-year-first') |
| local LAST_YEAR=$(cli_printCopyrightInfo '--copyright-year-last') |
| echo "${FIRST_YEAR}-${LAST_YEAR}" |
| shift 2 |
| break |
| ;; |
| |
| --copyright-year-list ) |
| |
| local FIRST_YEAR=$(cli_printCopyrightInfo '--copyright-year-first') |
| local LAST_YEAR=$(cli_printCopyrightInfo '--copyright-year-last') |
| |
| |
| |
| local FULL_YEAR=$(\ |
| while [[ ${FIRST_YEAR} -le ${LAST_YEAR} ]];do |
| echo -n "${FIRST_YEAR}, " |
| FIRST_YEAR=$(($FIRST_YEAR + 1)) |
| done) |
| |
| |
| echo "${FULL_YEAR}" | sed 's!, *$!!' |
| shift 2 |
| break |
| ;; |
| |
| --copyright-holder ) |
| |
| |
| echo "The CentOS Artwork SIG" |
| shift 2 |
| break |
| ;; |
| |
| --copyright ) |
| |
| local YEAR=$(cli_printCopyrightInfo '--copyright-year-last') |
| local HOLDER=$(cli_printCopyrightInfo '--copyright-holder') |
| echo "Copyright © $YEAR $HOLDER" |
| shift 2 |
| break |
| ;; |
| |
| -- ) |
| cli_printMessage "`gettext "At least one option is required."`" --as-error-line |
| shift 1 |
| break |
| ;; |
| |
| esac |
| |
| done |
| |
| } |