summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/oh-parsechangelog.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/oh-parsechangelog.sh b/src/oh-parsechangelog.sh
index 1b72ce3..9935d8b 100644
--- a/src/oh-parsechangelog.sh
+++ b/src/oh-parsechangelog.sh
@@ -19,27 +19,33 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. @@LIBDIR@@/opkhelper/changelog
-
-print_usage()
-{
- printf 'Usage: %s\n' "${1}"
-}
+. @@LIBDIR@@/messages
+. @@LIBDIR@@/locale
+. @@LIBDIR@@/changelog
main()
{
- oh_changelog_parse changelog output
+ oh_locale_set
- return 0
+ if [ "${#}" -ne 0 ]; then
+ oh_usage
+ exit 1
+ fi
+
+ oh_changelog_parse changelog output
}
output()
{
+ # These strings are machine-readable output and should not be localized or
+ # printed with oh_info().
+
printf 'Source: %s\nVersion: %s\nDistribution: %s\n' \
"${OH_CHANGELOG_SOURCE}" "${OH_CHANGELOG_VERSION}" \
"${OH_CHANGELOG_DISTRIBUTION}"
printf 'Maintainer: %s\nDate: %s\n' \
"${OH_CHANGELOG_MAINTAINER}" "${OH_CHANGELOG_DATE}"
+
printf 'Changes:\n'
while IFS= read -r line; do
if [ -z "${line}" ]; then
@@ -54,4 +60,4 @@ EOF
return 1
}
-main
+main "${@}"