AutoYADM commit: 2025-03-29 22:00:07

This commit is contained in:
Daniel Fichtinger 2025-03-29 22:00:07 -04:00
parent b1dffe01c0
commit f86e3d800e

View file

@ -29,6 +29,19 @@ function pb --description 'Upload a paste to sr.ht'
string split ' ' (hut meta show)[1][1] string split ' ' (hut meta show)[1][1]
end end
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 cmd $argv[1]
set -l args $argv[2..] set -l args $argv[2..]
switch $cmd switch $cmd
@ -59,7 +72,6 @@ function pb --description 'Upload a paste to sr.ht'
return 1 return 1
end end
hut paste delete $hash hut paste delete $hash
echo $hash 'deleted successfully!'
case show case show
set -l hash (select_paste; or 1) set -l hash (select_paste; or 1)
if test hash = 1 if test hash = 1
@ -69,8 +81,14 @@ function pb --description 'Upload a paste to sr.ht'
hut paste show $hash hut paste show $hash
case id case id
select_paste; or return 1 select_paste; or return 1
case list
hut paste list
case --
hut paste $args
case '*' 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 return 1
end end
end end