Command-line history logging utilities
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.

27 lines
583 B

  1. #!/usr/bin/env bash
  2. # This is a wrapper for commandlog, a tool for logging command-line history
  3. function print_help() {
  4. echo "Usage: $0 [command] [args]"
  5. echo " $0 add Add a log entry"
  6. echo " $0 log Show log entries"
  7. echo " $0 pause Pause logging"
  8. echo " $0 resume Resume logging"
  9. echo " $0 -h Print this help message"
  10. echo
  11. echo "You must specify a command."
  12. exit 1
  13. }
  14. if [[ $# -lt 1 ]]; then
  15. print_help
  16. fi
  17. if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]]; then
  18. print_help
  19. fi
  20. SUBPROG="commandlog-$1"
  21. shift
  22. exec "$SUBPROG" "$@"