#!/bin/bash
# core/license - software license support
#
# The `core/license` library provides functions to display the licensing
# information for the package. The actual license details are encoded in
# the `core/license-parts` library.
set -e
lib_load 'core/license-parts'
######
# Internal Functions
# license_check_func() - Checks for a function that has the same root name as
# its caller and with a suffix of `_print`. Those functions are provided by
# the `core/license-parts` library and will only be present when the relevant
# portion of the license was provided by the developer.
license_check_func() {
local name="${FUNCNAME[1]}_print"
is_function "$name" || error "$name: license function not found"
}
######
# Public Interface
license_full_blurb() {
echo "Run '$script_name --license full' to read the full license."
}
# license_blurb() - Prints a short license message for the package.
license_blurb() {
license_check_func
local package_year=${package_build_date%%-*}
echo "Copyright (C) 2016-$package_year $package_author"
license_blurb_print
echo "Run '$script_name --license warranty' for warranty details."
license_full_blurb
}
# license_warranty() - Prints the warranty information for the package.
license_warranty() {
license_check_func
license_warranty_print
license_full_blurb
}
# license_full() - Prints the full license for the package.
license_full() {
license_check_func
local tmp=$(cmd_tempfile)
license_full_print >$tmp
${PAGER:-less} "$tmp"
}
Generated on Fri Jul 28 14:34:59 PDT 2017 by mcsh d14 v0.23.0.