HalosGhost / pbpst

A command-line libcurl C client for pb deployments
GNU General Public License v2.0
44 stars 9 forks source link

UUID #83

Closed p1839251 closed 7 years ago

p1839251 commented 7 years ago

Hello, Is it possible to obtain UUIDs easily? --verbose flag is just ... too verbose.

Without any option, pbpst only tells the link $pbpst -S -f ./example.file https://ptpb.pw/example

I could do with a UUID info

HalosGhost commented 7 years ago

There's no other way to have the UUID listed when the paste is created. However, -Dq exists for you to query the pastes you have created so you can manage them. Also note, if you use bash or zsh, pbpst ships with tab completions which will work to complete UUIDs for the options that expect them.

If you use a different shell for which we do not ship tab completions, and would like to contribute them, let me know!

p1839251 commented 7 years ago

Thank you. I use bash, tab completion works good. It tells uuids, I just don't know which is which but I guess that's what the -Dq is for. Just to make sure $pbpst -Dq ./already_uploaded_file right? and not $pbpst -Dq https://ptpb.pw/link or anything else

In the case that my first command is right and I lose the original file, I'm messed up, aren't I?

HalosGhost commented 7 years ago

-Dq allows you to search based on all stored fields in the database. You can search by the file name (or whatever message you used in -m when creating the paste), by the uuid, by the sunset or by the paste id (either the long id or the vanity label if one exists).

Also note that searches can be partial, so pbpst -Dq 't' will print all results from the db where t was part of any field.

Finally, -Dq only searches, it does not do anything destructive. You would use it only to get the uuid to pass to -Ru (or -Dd if you do not care about its removal on the provider).

HalosGhost commented 7 years ago

Please also consider reading the manual page (man pbpst); we spent a considerable amount of time trying to make the documentation pretty good.

p1839251 commented 7 years ago

Thank you HalosGhost,

Being a good Arch user, I had tried to read the manual before I asked the question.

"Search each paste in the pastes object for text matching STR. Matches will be printed to stdout with the form \t/\t\t where is either the long id or a vanity label if one exists. "

This wasn't clear enough for me to fully understand the usage. Thank you for taking your time and clarifying it!

HalosGhost commented 7 years ago

@p1839251, Happy to do it! Can you suggest an alternate phrasing or some clarification that I could add to the page which would have helped you? I would be glad to add it!

p1839251 commented 7 years ago

The phrasing is probably good. Once you understand it, everything makes sense then. Definitions are usually written by such people who know the subject inside out. Therefore they are well written, although they are sometimes incomprehensible and might be hard to understand or even learn from them. My problem was that I had never thought pbpst was so advanced. You can fundamentally type anything after -Dq, pbpst will find it.

However, this line is kind of messy in the manual: \t/\t\t Those \t-s are rather confusing and I still don't know what they are supposed to mean.

So, I personally love examples. It's oftentimes easier to learn from them than definitions. If I'm not mistaken there are 5 main operations. Each operation has an example but database. I really missed that. (Okay there's a 'for' command which contains database operations but it's definitely not for dummies. I don't know what's going on there). Every important operation should have an example that could help dispel the myths and doubts. The more, the better. By the way, obtaining UUIDs are important because I think they are needed in order to modify an uploaded content. I incorrectly thought pbpst got the UUIDs from links, so I insisted on them and since there was no output after launching $pbpst -Dq https://ptpb.pw/34Cb I didn't know what went wrong.

To sum up, more examples, especially a database example would increase the manual's value. As you wrote, for example: "pbpst -Dq 't' will print all results from the db where t was part of any field"

HalosGhost commented 7 years ago

Ahh, I see. \t is the backslash-escape representation of a tab character. I found it important to specify so that the user could predictably parse the output of -Dq.

Having a simpler example of -D makes sense to me; I will include that!

HalosGhost commented 7 years ago

@p1839251, I've added a simpler example for -Dq and tried to expand on the documentation for how it operates. Let me know if you can think of anything else that would help!

p1839251 commented 7 years ago

I've checked it and I have to tell you it's pretty good! It's quite straight forward. Good job!

Maybe one more example could be added to the manual. People mainly use pbpst to upload content, don't they? There's already an example how to upload a file but there isn't any about how to upload a command output. I know there's a note about this at 'Sync Options'. Although this topic not as vague as the previous one, it's might worth adding one, for instance how to upload the output of $uname -a, in case someone does $uname -a > /tmp/output ; pbpst -Sf /tmp/output

Keep up the good work!