Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
idank
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
61.
▲
by
idank
13y ago
You've hit the two top things on my to do list.. command substitution and control flows. It says on the top of the home page that they're not implemented yet.
62.
▲
by
idank
13y ago
Thanks! I work full-time right now, so money isn't really an issue. I'll gladly accept commits though! ;)
63.
▲
by
idank
13y ago
Yes, you can parse without executing. I think shell is easier to parse than it seems, there are definitely some nuances that might be tricky to emulate, but I guess it's a matter of effort and how far you're willing to go. For syn
64.
▲
by
idank
13y ago
True, it doesn't figure out that some commands should be matched recursively since their arguments are other commands, xargs is also in the same boat. There might be an open bug for this already. I only scanned sections 1 and 8 of the
65.
▲
by
idank
13y ago
I'm tempted to add a place holder for all the variations of this forkbomb, until I teach the parser about functions. You'll be amazed how many people try this (or other 'malicious' commands), presumably thinking I'm
66.
▲
by
idank
13y ago
I think it'll be hard to match portions of the command to their boxes if there were no lines at all. How would you know that the `v` in `tar xzvf foo` matches the 4th box? Having a single line when you hover could help, but sounds conf
67.
▲
by
idank
13y ago
I had something similar in mind. But this format means that repeated arguments that aren't adjacent will have their help text repeated. Feel free to open a bug and we can discuss the options there.
68.
▲
by
idank
13y ago
It's definitely doable to add dedicated parsers for options of awk, sed, et al. But it's a lot of work... I doubt someone will go through the trouble of writing a parser for awk, just for this.. What is possible and quite easy is
69.
▲
by
idank
13y ago
I can scan the access logs for the top explained commands, and show those on the home page (although that will probably only further increase their popularity ;).
70.
▲
by
idank
13y ago
Thanks for the incentive, but it's not needed and if I do get around to it, it'll of course be open source. The main difficulty I had with writing a command line utility is figuring out the UI in a console. Suggestions are welcome
71.
▲
by
idank
13y ago
Yes, I had this suggested on numerous occasions and gave it a go a while ago and it's indeed not trivial. If a JS wiz would like to hack on this I'll gladly help and accept it.
72.
▲
by
idank
13y ago
I agree it's a little counter-intuitive. But if it's top to bottom then all the lines would cross each other which would ruin the UI. If there's a way to make it top to bottom while keeping the UI useful, I'd love to hea
73.
▲
by
idank
13y ago
Thanks, that's really fun to hear. ACK on the command substitution not working, with the current lexer that I have in place fixing this isn't easy and might take a while. But it's definitely up there on my todos. Yeah, long p
74.
▲
by
idank
13y ago
Hi! Happy to see explainshell on HN again, thanks for all the compliments! I agree about large commands being hard to follow. I tried solving this by adding the ability to navigate between commands. Right now clicking the command takes you
75.
▲
by
idank
13y ago
And what do you do if the dpkg'd version is a year older than the one you'd like to use and is available in pypi? Install just that one via pip? But what if that package has dependencies newer than what's installable with apt
76.
▲
by
idank
13y ago
Does join scan the entire input to know the exact size and allocate that at the start? Doesn't it do the usual thing for resizing and that is to double the capacity? A generator will save a temporary list, it will however result in a l
77.
▲
by
idank
13y ago
Code is now on github: https://github.com/idank/explainshell
78.
▲
by
idank
13y ago
Which open source license would you recommend I use?
79.
▲
by
idank
13y ago
This regex is the one I used to extract options from man pages, not to parse the command line (which is simply a wrapper around Python's shlex).
80.
▲
by
idank
13y ago
It's possible, but I'm not sure how robust it will be. There are a lot of heuristics being used to guess what the options are, if they expect an argument, etc. So when feeding it with a command that was typed by someone, which is
81.
▲
by
idank
13y ago
The regex is already getting out of hand ;) https://gist.github.com/idank/6382427 At some point I wanted to convert it to a DFA because I thought it will give me more control and flexibility and be more maintainable ov
82.
▲
by
idank
13y ago
Ha, cute! I'll add an API soon enough to return some JSON, so command line tools could wrap it more conveniently.
83.
▲
by
idank
13y ago
Thanks for reviewing it. I definitely went into this with a 'let's start with something good and useful for as many commands as possible', so I haven't focused on accuracy for those edge cases. But from what I played wit
84.
▲
by
idank
13y ago
Yes they are, and most of the time require manual tagging. I fixed 'tr', try again ;).
85.
▲
by
idank
13y ago
An argument to an option without a space does work. When they don't it's because the option was incorrectly analyzed as having no arg.
86.
▲
by
idank
13y ago
The order of help blocks is determined by their position in the command and if they're on the left or right side of the lines. If you always keep the order, lines would have to cross each other which looks less pretty and pretty confus
87.
▲
by
idank
13y ago
I don't have a Mac but I hope once the code is open someone will jump on it. Re other flavors: do you know if there are easy ways to get a dump of all man pages, similar to Ubuntu's man page archive?
88.
▲
by
idank
13y ago
Will do, thanks!
89.
▲
by
idank
13y ago
I actually experimented with that but getting the lines to display correctly when scrolling was tricky.
90.
▲
by
idank
13y ago
Hi, I'll open source the code sometime in the future so github would be the place for bug reports. As for long commands, yeah they're a bit crazy right now since they get wrapped. I'm still trying to figure out the best way t
More ›