Commit Graph

297 Commits

Author SHA1 Message Date
Andreas Kling
01f1333856 LookupServer+LibC: Add support for reverse DNS lookups via gethostbyaddr().
LookupServer can now take two types of requests:

* L: Lookup
* R: Reverse lookup

The /bin/host program now does a reverse lookup if the input string is a
valid IPv4 address. :^)
2019-06-06 05:35:03 +02:00
Andreas Kling
d03505bc29 LibC: inet_pton() should return 1 on success, 0 or -1 on failure. 2019-06-06 05:25:18 +02:00
Christopher Dumas
8fecc0eaee Userland: Implement recursive rm 2019-06-03 20:16:00 +02:00
Robin Burchell
b55b6cd7fc AK: Add implicit String -> StringView conversion
And tidy up existing view() users.
2019-06-02 12:55:51 +02:00
Robin Burchell
decf1afbaa Userland: Use CFile in dmesg 2019-06-02 12:55:51 +02:00
Robin Burchell
7de861bdd9 Userland: Use CFile in mm 2019-06-02 12:55:51 +02:00
Robin Burchell
9a4ec2e92a Userland: Use CFile in ps 2019-06-02 12:55:51 +02:00
Robin Burchell
e74b5975e4 Userland: Use CFile inside sysctl
Also add a StringView overload to CIODevice::write
2019-06-02 12:55:51 +02:00
vger92
1876606973 Userland: Add tee command (#166) 2019-06-02 12:45:17 +02:00
Conrad Pankoff
6cabd34b93 Userland: Improve head program
* allow specifying files as arguments, e.g. `head a b c`
* support multiple files
* print a filename header when multiple files are being printed
* allow suppression or forcing of filename header via flags

This change drops support for the legacy `-123` syntax in favour of the
more widely-supported `-n 123` form.

fixes #105
2019-06-01 14:48:03 +02:00
Mustafa
a4726b846c ls: Show user name and group name if available. (#151)
Fixes #150
2019-06-01 13:23:35 +02:00
Conrad Pankoff
51a74fb3bb Userland: Add a /bin/yes program (fixes #110) 2019-06-01 12:16:55 +02:00
Andreas Kling
cbd858544d LibC: Move struct timeval to sys/time.h. #POSIX 2019-05-28 13:48:06 +02:00
Robin Burchell
9d2b08e06e LibCore: Add CDirIterator, and use it in everything rather than readdir 2019-05-27 15:27:23 +02:00
Andreas Kling
f352a5094d ls: Fix build and tidy up coding style. 2019-05-27 15:04:23 +02:00
faissaloo
f28cc2e2e0 Ls: Cleanup 2019-05-27 14:53:16 +02:00
faissaloo
4c410f3de6 Ls: Support multiple files 2019-05-27 14:53:16 +02:00
faissaloo
776a359a17 Ls: Support single files in long mode 2019-05-27 14:53:16 +02:00
faissaloo
fee686e2cd Ls: Refactor long directory listings 2019-05-27 14:53:16 +02:00
faissaloo
07c356ce64 Ls: Add single file support in short mode 2019-05-27 14:53:16 +02:00
Andreas Kling
9308ce071f Userland: Add a helpful little program for provoking different crashes.
Currently supported crash types:

    -s : Segmentation violation
    -d : Division by zero
    -i : Illegal instruction
    -a : Abort
2019-05-26 02:35:25 +02:00
Andreas Kling
677794f30d LibGUI: Make GCheckBox inherit from GAbstractButton. 2019-05-24 17:11:42 +02:00
Andreas Kling
21c56477b0 LibGUI: Add a GAbstractButton base class for button widgets.
This patch moves GButton and GRadioButton to inherit from it. This allows
them to share code for mouse event handling, etc.
2019-05-24 16:32:20 +02:00
Robin Burchell
77dfd419e9 LibCore: Move AK/ArgsParser to LibCore/CArgsParser
Also rename the classes to match LibCore naming style.
This means that it's no longer incorrectly linked into LibC and Kernel.
2019-05-17 15:49:37 +02:00
Robin Burchell
190111e21a Userland: Port ln to use ArgsParser 2019-05-17 15:49:37 +02:00
Robin Burchell
bffed9e3cb ArgsParser: Expand to be able to handle multiple single arguments
This is needed for e.g. ln
2019-05-17 15:49:37 +02:00
Robin Burchell
b92fa59832 Userland: Port pape to use ArgsParser, and minor cleanups 2019-05-17 15:49:37 +02:00
Robin Burchell
56aad835ad Userland: Port sysctl to use ArgsParser, and minor cleanups 2019-05-17 15:49:37 +02:00
Robin Burchell
6dd7ee53ea AK/Userland: Add single value to ArgsParser usage, and port tail to use ArgsParser 2019-05-17 15:49:37 +02:00
Robin Burchell
c478503581 ArgsParser: Remove prefix from constructor
It makes sense to keep this consistent between applications, and the
purpose of the string is not immediately obvious from an API perspective.

If we need to make it configurable later, that can come from a setter.
2019-05-17 15:49:37 +02:00
Robin Burchell
729507f2bd ArgsParser: Remove boolean trap on add_arg
Rather than requiring a boolean for whether or not the argument is
required, add some new methods to make the purpose of the bool explicit.
2019-05-17 15:49:37 +02:00
Robin Burchell
c8fda23a03 LibCore/Userland: Introduce a simple tail implementation
Also introduce more seek modes on CIODevice, and an out param to find
the current position inside the file -- this means less syscalls (and
less potential races) than requesting it through a separate pos()
accessor or something.
2019-05-17 14:28:13 +02:00
Andreas Kling
c597c2332b Userland: Add /bin/whoami 2019-05-16 20:18:17 +02:00
GuillaumeGas
0ba4ceb2cd Added CProcessStatisticsReader to avoid having to parse /proc/all (#35)
* Added CProcessStatisticsReader to avoid having to parse /proc/all

* Took @awesomekling's feedbacks into account

* Fixed indentation and replaced tabs by spaces
2019-05-16 18:47:47 +02:00
GuillaumeGas
801d6f572a Feature/pidof (#31)
* Added killall command

* Fixed feedbacks of awesomekling

* Implemented pidof program and helper to parse arguments called ArgsParser.

* Fixed feedbacks in pidof implem.

Fixes #26
2019-05-13 14:31:23 +02:00
Andreas Kling
b5b44a29bb Replace various copies of parse_uint(String) with String::to_uint(). 2019-05-08 19:21:51 +02:00
GuillaumeGas
cea631d90c Added killall command (#30)
* Added killall command

* Fixed feedbacks of awesomekling
2019-05-08 18:52:37 +02:00
Andreas Kling
fe73543d41 Shell: Move the Shell to a separate directory and let's call it "Shell" :^) 2019-05-07 01:12:08 +02:00
Andreas Kling
e63cc38861 Shell: Use a Vector<char> for the main input buffer. 2019-05-07 01:01:50 +02:00
Andreas Kling
3ae75e04ec date: Add "-u" argument for printing current Unix timestamp. 2019-05-04 16:50:36 +02:00
Andreas Kling
8b249bd09b Kernel+Userland: Implement mknod() syscall and add a /bin/mknod program. 2019-05-03 22:59:58 +02:00
Andreas Kling
2a65f0ee4f strace: Allow "strace command" to trace a process from start to finish.
Tracing a specific pid is now done via "strace -p PID".
To ensure we don't miss any syscalls, we fork and have the child immediately
SIGSTOP itself. Then when the parent has set up the systrace() fd, we send
SIGCONT to the child which then execs the command. :^)
2019-05-02 15:51:39 +02:00
Andreas Kling
d3bd4fdcfe sh: Log to debugger how long command took. 2019-05-02 02:22:28 +02:00
Andreas Kling
b204b77b29 sh: Remove debug spam during command launch. 2019-04-26 17:33:06 +02:00
Andreas Kling
d4a8e2930e sh: Add a simple "export" command for setting environment variables. 2019-04-26 03:23:27 +02:00
Andreas Kling
c392c0d799 Userland: Add a simple /bin/tr program. 2019-04-26 00:57:37 +02:00
Andreas Kling
671dee9afa Userland: Add a simple /bin/sort program. 2019-04-26 00:53:57 +02:00
Andreas Kling
b5a1ee1d3e Userland: Add a simple /bin/head program. 2019-04-26 00:47:30 +02:00
Andreas Kling
96d4b701e6 sh: Make "cd" jump to the home directory. And also let's set $HOME.
Nobody else is setting $HOME right now, so we might as well do it here.
This should eventually be done by some sort of "login" program.
2019-04-25 23:09:21 +02:00
Andreas Kling
89e9aafbb5 sh: Support erasing a whole word with WERASE (^W). 2019-04-25 23:05:10 +02:00