Files
dotwryn/scwrypts/media/cloud/zshparse/actions.module.zsh
T

38 lines
727 B
Bash
Raw Normal View History

2025-02-19 21:58:15 -07:00
${scwryptsmodule}() {
# local ACTION
local PARSED=0
case $1 in
( --action )
PARSED=2
ACTION="$2"
;;
esac
return $PARSED
}
#####################################################################
${scwryptsmodule}.usage() {
USAGE__options+="
--action <string> a media sync action:
push
pull
push-first-synchronize
pull-first-synchronize
"
}
${scwryptsmodule}.validate() {
case "${ACTION}" in
( push | pull | pull-first-synchronize | push-first-synchronize ) ;;
( '' )
2026-08-14 08:12:39 -06:00
echo.error 'must specify a media sync action'
2025-02-19 21:58:15 -07:00
;;
( * )
2026-08-14 08:12:39 -06:00
echo.error "invalid media sync action '${ACTION}'"
2025-02-19 21:58:15 -07:00
;;
esac
}