Tools for modeling links between files / URLs / etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
942 B

  1. #!/bin/sh
  2. print_help() {
  3. echo "$0 - pieces and operate on things"
  4. echo
  5. echo "Usage: pieces [command] [args]"
  6. echo " pieces add [address] - Add a thing's address to the pieces list"
  7. echo " pieces clear - Clear pieces list"
  8. echo " pieces link - Link two addresses"
  9. echo " pieces ls - List current piecess"
  10. echo " pieces ls-print0 - List current piecess, separated by NUL chars"
  11. echo " pieces remove - Remove a given URN from the pieces list"
  12. echo " pieces -h - Print this help message"
  13. echo
  14. echo "You must specify a command."
  15. exit 1
  16. }
  17. if [ $# -lt 1 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
  18. print_help
  19. fi
  20. subprog="pieces-$1"
  21. # Make sure that the command we've been given exists:
  22. command -v "$subprog" >/dev/null 2>&1 || {
  23. echo "pieces: '$1' is not a pieces command. See 'pieces -h'."
  24. exit 1
  25. }
  26. shift
  27. exec "$subprog" "$@"