#!/bin/sh
# SPDX-FileCopyrightText: 2026 TrenSoft
# SPDX-License-Identifier: GPL-3.0-or-later

# The short command of the installed package: it starts the background service and opens the
# settings window. "slideshowlock [args...]" is "slideshow-lock control [args...]"; the other
# programs stay with slideshow-lock (service, settings, preview). "slideshowlock autostart" is what
# the autostart entry runs at login. Only -h and --help are answered here, so that they name this
# command. Anything else goes on to slideshow_lock.control, so "slideshowlock help" is an argparse
# error (exit status 2), whereas "slideshow-lock help" works.
case "${1:-}" in
    -h | --help)
        printf '%s\n' \
            'usage: slideshowlock [autostart] [--debug]' \
            '' \
            'Starts the Slideshow Lock service and opens the settings window. The same as:' \
            'slideshow-lock control. "autostart" is for the login start: the service is started' \
            'and the window opens only the first time, when no picture folder is chosen.' \
            '--debug logs every step. The service and the preview are started with' \
            'slideshow-lock service and slideshow-lock preview (slideshow-lock --help).'
        exit 0
        ;;
esac
exec /usr/bin/slideshow-lock control "$@"
