Almost-minimal filesystem based blog.
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.

71 lines
1.9 KiB

  1. #!/bin/sh
  2. : <<=cut
  3. =pod
  4. =head1 NAME
  5. wrt - WRiting Tool, a static site/blog generator and related utilites
  6. =head1 SYNOPSIS
  7. wrt init # Initialize a wrt repository
  8. wrt display # Print HTML for entries
  9. wrt render-all # Render all defined entries to filesystem
  10. wrt addprop # Add a property to an entry
  11. wrt findprop # Find entries containing certain properties
  12. wrt -h # Print help message
  13. =head1 DESCRIPTION
  14. wrt is a small collection of utilities for authoring a simple, date-based
  15. blog or other static site.
  16. C<wrt> is a simple wrapper script which invokes other subcommands. It will
  17. pass its arguments along to any command of the form C<wrt-command>.
  18. Detailed documentation can be found in the L<App::WRT> man page or at
  19. L<https://github.com/brennen/wrt>.
  20. =head1 LICENSE
  21. wrt is free software; you can redistribute it and/or modify
  22. it under the terms of the GNU General Public License as published by
  23. the Free Software Foundation; either version 2 of the License, or
  24. (at your option) any later version.
  25. =head1 AUTHOR
  26. Brennen Bearnes
  27. =cut
  28. print_help() {
  29. echo "wrt - a writing tool"
  30. echo
  31. echo "Usage: $0 [command] [args]"
  32. echo " wrt init Initialize a wrt repository"
  33. echo " wrt display Print HTML for entries"
  34. echo " wrt render-all Render all defined entries to filesystem"
  35. echo " wrt addprop Add a property to an entry"
  36. echo " wrt findprop Find entries containing certain properties"
  37. echo " wrt -h Print this help message"
  38. echo
  39. echo "You must specify a command."
  40. exit 1
  41. }
  42. if [ $# -lt 1 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
  43. print_help
  44. fi
  45. subprog="wrt-$1"
  46. # Make sure that the command we've been given exists:
  47. command -v "$subprog" >/dev/null 2>&1 || {
  48. echo "wrt: '$1' is not a wrt command. See 'wrt -h'."
  49. exit 1
  50. }
  51. shift
  52. exec "$subprog" "$@"