repman 0.7.13

repman helps to manage custom repositories for Arch Linux packages
#!/usr/bin/env bash

# At least one argument is required
if [[ -z $1 ]]; then
    echo "repman-all must be called with at least one argument" 
    exit 1
fi    

# Print help
if [[ $1 == "-h" || $1 == "--help" || $1 == "help" ]]; then
    cat << EOF
repman (Custom Repository Management) 
Copyright (C) 2022-2026 Michael Picht <https://codeberg.org/mipi/repman>

repman helps to manage custom repositories for Arch Linux packages

Execute a repman command for all configured repositories

Usage:
  repman-all {repman-command | -h | --help | help}

Example:
    repman-all clear --chroot
EOF

    exit 0
fi

# Print version
if [[ $1 == "--version" ]]; then
    repman --version
    exit 0
fi

# Extract repman command
cmd=$1
shift

# Execute repman command for all repositories
for repo in $( repman lsrepos ); do
    repman $cmd -r $repo $@
done