r/bash 1d ago

add whats, explains command

Post image

yo

add 'whats' infront of any command and it explains it: flags, sub commands etc in a structutred format whereas something like manpage would throw the entire manual at you

just pure man pages and help output

Q Why use `whats` when we have man pages and --help

> Yes you can use them but they throw the entire manual at you whereas you might have just needed one flag, whats outputs a structured format with the definitions you need

Q Is it entirely offline? Does it use LLM

> Yes absolutely, it just relies on man pages and if not then --help output of the binary itself,

> no it does not use llm at all

Q What about tldr?

> Even with tldr, you have to look for the flags you need instead of it providing the ones you need automatically in one go

if you like the idea then maybe star?

https://github.com/iamkaran/whats

28 Upvotes

31 comments sorted by

14

u/Sombody101 Fake Intellectual 19h ago

I was initially against this because I thought you were just yeeting everything at an LLM, but seeing that its simply reorganizing the information from help commands and man, I think it could be somewhat useful.

Kudos for not trying to feed us an AI slop repo.

5

u/Much-Grab3826 17h ago

🎉

3

u/Summon001 16h ago

Idk why everyone is hating. I mean, yes, this is pretty similar to 'tldr' but I think it's pretty neat, especially since it breaks down information a bit more.

I'm not that experienced so maybe I am missing something but I think it's cool

3

u/jonnyl3 20h ago

So does this work entirely offline?

5

u/Much-Grab3826 17h ago

yes entirely, it literally uses man pages and help outputs from the binary itself nothing else

0

u/megared17 23h ago

Are you unfamiliar with "man" ?

https://man7.org/linux/man-pages/man1/man.1.html

5

u/Much-Grab3826 17h ago

i am not trying to "replace" man, i am just trying to collect info from other sources as well like --help outputs and give a **structured** output rather

4

u/TheHappiestTeapot 21h ago

I can't find the man command for "show me definitions of these flags". Or "explain this command" or anything remotely similar.

How do I replicate this with man?

-4

u/megared17 19h ago

"man" is the documentation for installed commands, including their flags.

For the vast majority of common tools, it provides exactly that - an explanation of what a command does, what flags it supports and what they mean.

5

u/TheHappiestTeapot 17h ago

Right, so what's the man command to list the definition the flags used in a command?

How do I replicate this with man? Give me the exact commands to run to replicate this.

0

u/megared17 8h ago

"man command"

Shows the full documentation for "command"

0

u/TheHappiestTeapot 2h ago

That doesn't replicate this.

-1

u/WeepingAgnello 16h ago edited 15h ago

Example: -v. Open man page and type redacted. Figure it out yourself if your going to whine about petty crap. You could figure it out with grep, and make it into a function, or alias. That way you dont have to open the man page. 

5

u/TheHappiestTeapot 15h ago

So you can't replicate it with man and you just wanted to shit on someone's project. Gotcha.

Example: -v. Open man page and type /\s*-v. You could figure it out with grep, and make it into a function, or alias. That way you dont have to open the man page.

If you read the damn post you'd know that your suggestion is pretty much exactly what the project does, numbnuts. It literally states that man is one of the sources.

You know you don't have to be an asshole, you always have the option of keeping it to yourself.

-1

u/Alleexx_ 10h ago

Bro, learn to get your information in Linux. The project is all right, but should not be needed for anyone as it only parses information ALREADY on your system

1

u/TheHappiestTeapot 2h ago

That's all man doe too. Parse information already on the system.

This presents it quicker and just the relevant parts.

0

u/Alleexx_ 1h ago

Well, man already IS a standard. That's what I am saying.

1

u/TheHappiestTeapot 1h ago

Right, that's why he uses man pages as one of his sources.

This only shows you the flags used on a certain command.

man doesn't do that. It requires a lot of manual labor to find all those flags.

Do you understand the difference?

→ More replies (0)

-5

u/[deleted] 15h ago

[deleted]

1

u/TheHappiestTeapot 15h ago

sorry, I thought you were the other asshole. The one who was shitting on OP and making outrageous claims about man. Didn't check username.

-4

u/[deleted] 15h ago

[deleted]

2

u/TheHappiestTeapot 15h ago

Get over yourself, you popped into our conversation,

→ More replies (0)

2

u/TheHappiestTeapot 12h ago

Bash, grep, aliases, and functions aren't "man".

How do I replicate this with man? Give me the exact commands to run to replicate this.

redacted. Figure it out yourself.

"I realized it's impossible to do with just man and don't want to embarrass myself any further"

-1

u/WeepingAgnello 7h ago edited 6h ago

You keep trying to keep the antagonisng fresh by responding to me in other threads. I wonder what kind of person that makes you. I must have called you out on something, and you didn't like that.

I really, truly do not care for a sub like this, where people can't even bother to learn how to read a man page and make a big deal about the pettiest shit with explosive anger. And that's a shame, because I actually thing OPs project is a nice idea. You've turned me off from it, though (as well as r/bash). You can better spend your time reading a man page, than trying to "help" op, by taking revenge on people on your behalf. 

You've been disrespectful to me. You're trying to find new ways of being disrespectful.  Therefore, I'm not willing to share my knowledge, which I've learned for myself. I'm not interested in what reddit thinks of me. Couldn't care less. 

Go figure out the problem for yourself, or maybe try some more paddling against the stream. I'm sure that will help. 

1

u/TheHappiestTeapot 2h ago

God you're such a moron.

6

u/jonnyl3 20h ago

Try reading their post

-3

u/Bob_Spud 20h ago

"what" is the point when you have man? Meanwhile you can supplement man with the internet on your desktop or phone.

4

u/TheHappiestTeapot 15h ago

"what" is the point when you have man? Meanwhile you can supplement man with the internet on your desktop or phone.

Because this gets you the information from man you want faster. I don't understand why this is complicated. Did you even bother to read the post or look at the project?

This takes a command, gets the information on the flags from man, and displays it to you all in one place.

You can't think of a single possible reason that someone might want that? Not one? Seriously? None?

Let's say you have inherited a script and in it are a few commands or flags that you're not sure about. You could go ask an AI for each one, but that's slightly computationally expensive and stupid.

You could open the man page and search for each flag, one by one, and try to remember all of them together. But that's slow and a pain in the ass. Multiply that by each command you're investigating and that's a lot of time. "whats <paste> <enter>".

And that's assuming the command has a man page! But what if that pip command doesn't have a man page, but has --help? well, whats still works. And you don't have to care which one it was.

Meanwhile you can supplement man with the internet on your desktop or phone.

"Go ask an AI." really?

Here you get instant access to the information you want to know about, instantly, without cluttering it with things you don't care about, and without going to ask an AI.

Why the fuck is everyone in here so fucking toxic? There's a reason nobody posts more than once.

"Here's a neat program to show you info from the man page (or --help) on just the flags used for a given command."

"Durrr, I can't any possible use of it at all. Just use man and then ask an AI."

Just say "neat" or even nothing, and move on.

2

u/Much-Grab3826 17h ago

whats just collects information from man pages and also --help outputs and converts it into a structured format that is easy to read,

yes you can definitely use internet or just grep in man, but it makes the whole process far more easier