From f86e3d800ef03b82523eebdad0eca8ce56410784 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sat, 29 Mar 2025 22:00:07 -0400 Subject: [PATCH] AutoYADM commit: 2025-03-29 22:00:07 --- .config/fish/functions/pb.fish | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.config/fish/functions/pb.fish b/.config/fish/functions/pb.fish index 07b8f021..8ce1476c 100644 --- a/.config/fish/functions/pb.fish +++ b/.config/fish/functions/pb.fish @@ -29,6 +29,19 @@ function pb --description 'Upload a paste to sr.ht' string split ' ' (hut meta show)[1][1] end end + if test (count $argv) -lt 1 + echo "Utility for working with sr.ht pastes. +All paste selection is interactive via fzf. +Use -- followed by arguments to pass directly to hut paste. + +The following commands are available: +create - [file_path] create a paste +copy - copy a paste's URL to your clipboard +delete - delete a paste +show - view a paste +id - select a paste and print its id" + return + end set -l cmd $argv[1] set -l args $argv[2..] switch $cmd @@ -59,7 +72,6 @@ function pb --description 'Upload a paste to sr.ht' return 1 end hut paste delete $hash - echo $hash 'deleted successfully!' case show set -l hash (select_paste; or 1) if test hash = 1 @@ -69,8 +81,14 @@ function pb --description 'Upload a paste to sr.ht' hut paste show $hash case id select_paste; or return 1 + case list + hut paste list + case -- + hut paste $args case '*' - echo 'Unknown arguments!' + echo 'Unknown argument!' + echo 'Must be one of: create, copy, delete, show, or id!' + echo 'use -- as argument to pass through to hut paste!' return 1 end end