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
Andreas Kling
04b7def6ab
sh: Add support for redirecting stdin and stdout with < and >.
...
This is certainly about time. The kernel has had all the necessary support
in place for months, and I just kept postponing working on the shell. :^)
2019-04-25 16:10:16 +02:00
Andreas Kling
df8e76a67c
cat: Just use fd 0 when no arguments are passed.
...
I'm not sure why it seemed necessary at some point to open /dev/stdin rather
than simply using the already-open fd 0.
2019-04-25 16:01:28 +02:00
Andreas Kling
e84faadb63
sh: Refactor command parsing into a separate class.
2019-04-25 14:34:25 +02:00
Andreas Kling
07de1147ad
sh: Add basic command piping support.
2019-04-25 14:13:36 +02:00
Andreas Kling
aa84e2fc64
fgrep: Don't repeat old incoming data if fgets() failed.
2019-04-25 14:07:17 +02:00
Andreas Kling
eadcf720c0
Userland: Add a simple /bin/echo program.
2019-04-25 04:42:09 +02:00
Andreas Kling
0c898e3c2c
Put assertions behind a DEBUG flag to make it easy to build without them.
2019-04-23 21:52:02 +02:00
Andreas Kling
91f561a417
touch: Newly created files were accidentally marked as FIFO's.
2019-04-23 17:04:12 +02:00
Andreas Kling
5c68929aa1
Kernel: Add a systrace() syscall and implement /bin/strace using it.
...
Calling systrace(pid) gives you a file descriptor with a stream of the
syscalls made by a peer process. The process must be owned by the same
UID who calls systrace(). :^)
2019-04-22 18:44:45 +02:00
Andreas Kling
57da00b731
Include Makefile.common in all other Makefiles.
2019-04-21 04:09:39 +02:00
Andreas Kling
5f63f8120c
Kernel: Remove "restorer" field from SignalActionData.
...
I was originally implementing signals by looking at some man page about
sigaction() to see how it works. It seems like the restorer thingy is
system-specific and not required by POSIX, so let's get rid of it.
2019-04-20 19:32:14 +02:00
Andreas Kling
5eedb22834
Sprinkle use of AK::Vector in various places.
...
Some of these are less helpful than others. Avoiding a bunch of mallocs
in the event loop wakeup code is definitely nice.
2019-04-20 14:02:19 +02:00
Andreas Kling
301a269ca0
Get rid of SERENITY macro since the compiler already defines __serenity__
...
This makes it a bit easier to use AK templates out-of-tree.
2019-04-20 12:58:49 +02:00
Andreas Kling
87c4d2bc92
Userland: Add a /bin/basename program.
2019-04-15 13:57:09 +02:00
Nicolas Van Bossuyt
37c27e2e39
Userspace: gitignore binaries
2019-04-15 00:35:37 +02:00
Andreas Kling
adc91d92a3
Userland: Oops, that merge broke the build, just needed a few tweaks. :^)
2019-04-14 20:32:44 +02:00
Nicolas Van Bossuyt
40e710da3d
Userland: Maybe find is overkill
2019-04-14 20:15:29 +02:00
Nicolas Van Bossuyt
dfeeaff237
Userland: making the makefile smarter
2019-04-14 19:58:25 +02:00
VAN BOSSUYT Nicolas
12f2d1f2e8
Uptime: making the ouput prettier
...
Just like the -p option on linux
2019-04-14 19:10:24 +02:00
Andreas Kling
c0fe48635b
Kernel: Add /proc/uptime file (number of seconds since boot.)
...
Also added a simple /bin/uptime to pretty-print this information. :^)
2019-04-14 15:19:45 +02:00
Andreas Kling
5e0577a042
Introduce LibCore and move GElapsedTimer => CElapsedTimer.
...
I need a layer somewhere between AK (usable both by userspace and kernel)
and LibGUI (usable by userspace except WindowServer.) So here's LibCore.
2019-04-10 16:14:44 +02:00