-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TERMINAL: Added grep #1343
TERMINAL: Added grep #1343
Conversation
Nice! |
Don't you know, I'm making my own POSIX standard, in BitBurner! BOSIX! Nah you're absolutely right 😁 . I'll give those changes a bash ASAP. What are your thoughts on the globbing behaviour with no file args passed in? Implementing I think the default "search everything" is a useful feature, if not particularly compliant. PS - are ANSI codes OK for the colours, or should I be using styles? All I need are the terminal primaries anyway. |
Hmmm that's a good question. Although it would be technically possible to still use stdin, that's not really a thing with our shell, and we don't have pipelines or redirections. So defaulting to ./* probably makes the most sense.
ANSI codes are fine, as long as the layer you're outputting to renders them :D |
I'm gonna run out of option flags to implement soon 😄 |
About that formatting of the arguments, like when you would do Also, I see you parse the arguments yourself. We have a library |
I figured replicating the command as close as I reasonably could would be ideal and potentially useful, but also most fun and satisfying! And I think the other commands should be adjusted to be as close as possible as well, for fun and profit. 😁
I was totally unaware of Do you know if it's https://www.npmjs.com/package/jargs this? There's no documentation as to what it is (that I can find) but from the few (five) uses it has in the repo, it looks similar. ps: I'm a little disappointed you pointed that out xD. I'm quite pleased with the shape I got my little parser into haha. |
Sadly, beyond the uses within the game, I have no idea what this package is or what it does.
It's fine if you leave it as is. I'm changing some stuff from the |
I have multiflags working now anyhow. 😃 . While multiflag options might not be POSIX (assuming that they are not), they are definitely Linux. It's something I would miss. |
A simple implementation of grep.
There's a few ideas I've thought to add, to make it more grep-like, such as;
regexp support (should be pretty simple),✅✅-n
to disable line-numbers,✅-B/A/C n
to provide context,But I thought I'd make the PR and get the ball rolling.
:)