AutoYADM commit: 2025-03-29 22:00:07
This commit is contained in:
parent
b1dffe01c0
commit
f86e3d800e
1 changed files with 20 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue