pet icon indicating copy to clipboard operation
pet copied to clipboard

Print Command Snippet For other Uses

Open Rahulsharma0810 opened this issue 4 years ago • 3 comments

Feature Request

This is a wonderful tool, But it works only in local system terminal. It would be great to print or copy a snippet in the clipboard to use with other programs.

We all use SSH and save our snippet locally, But when it comes to run that on the server, I have to go to pet edit and manually copy that command.

image

A sample tool for this functionality is https://www.renfei.org/snippets-lab/

Regards, Rahul Sharma

Rahulsharma0810 avatar May 29 '20 15:05 Rahulsharma0810

I would really like something like this as well. It seems like there could be another subcommand, something like "pet print" where it lets you search your snippets and if you make a selection it just echos the output to the shell where you can then copy it or modify it and run it.

czeigler avatar Jun 05 '20 21:06 czeigler

pet search does that - it prints the selected command without executing it

iAugur avatar Aug 12 '20 12:08 iAugur

Sure, pet search do it, as resquested. However, my workflow is :

  • type pet search
  • copy with the mouse the result
  • paste the command

It will be great if pet search can have an option to copy directly in the clipboard. Or another command likes pet clip

I use this work around on MS Windows

@echo off
if "%1" == "clip" (
c:\pet\pet.exe search|sfk toclip -nolines
) else (
c:\pet\pet.exe %1
)

Edit: sfk toclip only exist for windows, on linux you can use xclip

crile avatar Nov 27 '20 10:11 crile

Supported!

RamiAwar avatar Feb 19 '24 08:02 RamiAwar