From c436b3bbf0ed5b085bb49b36fd24290b5246c2f3 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: May 02 2011 03:34:49 +0000 Subject: Update cli_getCopyrightInfo.sh: - Add `--copyright-year-list' option. - Add `--copyright-year-last' option as alias to `--copyright-year' option. --- diff --git a/Scripts/Functions/cli_getCopyrightInfo.sh b/Scripts/Functions/cli_getCopyrightInfo.sh index e2301ea..618c2b0 100755 --- a/Scripts/Functions/cli_getCopyrightInfo.sh +++ b/Scripts/Functions/cli_getCopyrightInfo.sh @@ -52,11 +52,36 @@ function cli_getCopyrightInfo { echo "http://creativecommons.org/licenses/by-sa/3.0/" ;; - '--copyright-year' ) + '--copyright-year' | '--copyright-year-last' ) # Output default copyright year. date +%Y ;; + + '--copyright-year-list' ) + + # The opening year when I (as part of The CentOS Project) + # started to consolidate The CentOS Project Corporate + # Visual Identity through the CentOS Artwork Repository. + local FIRST_YEAR='2009' + + # The last year when The CentOS Project stopped working in + # its Corporate Visual Identity through the CentOS Artwork + # Repository. That is something that shouldn't happen, so + # assume the current year as last working year. + local LAST_YEAR=$(cli_getCopyrightInfo '--copyright-year') + + # Define full copyright year string based on first and + # last year. + local FULL_YEAR=$(\ + while [[ ${FIRST_YEAR} -le ${LAST_YEAR} ]];do + echo -n "${FIRST_YEAR}, " + FIRST_YEAR=$(($FIRST_YEAR + 1)) + done) + + # Prepare full copyright year string and print it out. + echo "${FULL_YEAR}" | sed 's!, *$!!' + ;; '--copyright-holder' )