From e86bc7ca888403e250140b8c8739f357517d79b4 Mon Sep 17 00:00:00 2001 From: Marley Rae Date: Mon, 29 Jan 2024 21:31:09 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Mergepdf=20function=20that=20I=20ca?= =?UTF-8?q?n't=20actually=20use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fish/functions/mergepdf.fish.symlink | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 fish/.config/fish/functions/mergepdf.fish.symlink 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