diff --git a/fish/.config/fish/functions/mergepdf.fish.symlink b/fish/.config/fish/functions/mergepdf.fish.symlink new file mode 100644 index 0000000..906b67e --- /dev/null +++ b/fish/.config/fish/functions/mergepdf.fish.symlink @@ -0,0 +1,24 @@ +#!/usr/bin/env fish + +function mergepdf -d "Merge PDF files, preserving hyperlinks" + argparge 'h/help' -- $argv + + if set -q _flag_h + printf '%b' \ + "Merge PDF files, preserving hyperlinks.\n" \ + "\n" \ + "Usage: mergepdf [-h|--help] [input.pdf ...]\n" \ + "\n" \ + "Options:\n" \ + "-h|--help: Show this message.\n" + + return + end + + if [ "$(uname)" != "Darwin" ] + echo "Sorry, this script is only for macOS!" + return + end + + gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=_merged.pdf $argv +end