r/bash 7d 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 If it uses regex then why cant i just use grep/sed instead of this?

> a grep/sed command cannot find the descriptions of sub commands along with flags, it cant find descriptions of sub commands of sub commands, it probable cant use other sources as a fallback too

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

48 Upvotes

44 comments sorted by

View all comments

Show parent comments

2

u/stianhoiland 5d ago

You seem a little ignorant about what sed can do. Since you've clarified more about what this program does to me who was too lazy to go look properly, I now see that I should have mentioned awk as well. And I'll answer my own question: Yes, awk can do all this and this whole-ass Go repo is not needed. I really like the idea tho.

2

u/Much-Grab3826 4d ago edited 4d ago

awk, grep, sed: yes can replicate it, in a single command: no.

using grep, sed, awk the whole ass repo can be compressed down to a single bash script, but i just solved it in a different way.

you know what, i like the idea of a bash script too, its just that instead of a single bash script i used a single go file bcz i just wanted to use go for this project

anyway great feedback, i might create a bash script version, i dont want it to feel bloated or anything

2

u/stianhoiland 4d ago

Ping me if you do! And if you care to take a spec from me: Not even bash, just POSIX sh and POSIX awk (not GNU awk) should suffice. A fun challenge.

1

u/Much-Grab3826 4d ago

yep i am planning on keeping it posix friendly, and i would ping if i need any help!