Commit graph

1125 commits

Author SHA1 Message Date
Ali Mohammad Pur
67357fe984 LibXML: Add a fairly basic XML parser
Currently this can parse XML and resolve external resources/references,
and read a DTD (but not apply or verify its rules).
That's good enough for _most_ XHTML documents as the HTML 5 spec
enforces its own rules about document well-formedness, and does not make
use of XML DTDs (aside from a list of predefined entities).

An accompanying `xml` utility is provided that can read and dump XML
documents, and can also run the XML conformance test suite.
2022-03-28 23:11:48 +02:00
Kenneth Myhra
f38076e596 disk_benchmark: TRY more stuff :^) 2022-03-27 08:33:24 -04:00
Kenneth Myhra
c0f15ebcbb disk_benchmark: Core::ArgsParser to parse arguments 2022-03-27 08:33:24 -04:00
Kenneth Myhra
122778b9ac tee: Port to LibMain and move to SerenityOS code patterns
This patch ports the utility 'tee' to LibMain and converts a larger part
of its code to our SerenityOS patterns.
2022-03-26 18:39:58 +00:00
Ali Mohammad Pur
4a331c73f8 ls: Remove leading dashes from ArgsParser argument name
Otherwise the full argument would be "----ignore-backups", which is most
certainly not correct :^)
2022-03-26 21:34:56 +04:30
Liav A
d7c7e6e496 Utilities/ps: Don't assume the kernel can provide real TTY paths 2022-03-26 11:01:49 +01:00
Lenny Maiorani
f268a91227 Utilities: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-24 20:09:26 -07:00
Nicholas Cellino
626ea5007a sql: Re-prompt user for input after unrecognized command
This fixes a bug in the SQL REPL where after a user enters an
unrecognized command, the REPL would not print another "> " prompt and
would not accept any more input.
2022-03-24 07:25:04 -04:00
Kenneth Myhra
546a6a80a7 readlink: Use StringView instead of const char* 2022-03-24 11:57:51 +01:00
Kenneth Myhra
45ac5e90b7 readlink: Port to LibMain 2022-03-24 11:57:51 +01:00
Kenneth Myhra
4a57be824c Userland+Tests: Convert File::read_link() from String to ErrorOr<String>
This converts the return value of File::read_link() from String to
ErrorOr<String>.

The rest of the change is to support the potential of an Error being
returned and subsequent release of the value when no Error is returned.
Unfortunately at this stage none of the places affected can utililize
our TRY() macro.
2022-03-24 11:57:51 +01:00
Nicholas Cellino
0e51d99322 sql: Do not indent next line when current one is blank
Previously, if a user pressed Enter without typing a command at
the SQL REPL, the next line would be automatically indented. This
change makes it so we check if there were any tokens in the command
before applying the indentation logic.
2022-03-23 15:27:09 -04:00
int16
a4d96c159c Mount: Implement wxallowed mount option 2022-03-22 12:20:19 +01:00
Nicholas Cellino
1db7c423db disk_benchmark: Port to LibMain 2022-03-22 11:51:32 +01:00
Brian Gianforcaro
0a9e84aff0 readelf: Port to LibMain 2022-03-22 11:39:20 +01:00
Brian Gianforcaro
575fcc42c3 purge: Port to LibMain 2022-03-22 11:39:20 +01:00
Brian Gianforcaro
fbceebb717 ping: Utilize TRY + Core::System wrappers 2022-03-22 11:39:20 +01:00
Brian Gianforcaro
08d65e8c38 traceroute: Port to LibMain 2022-03-22 11:39:20 +01:00
Brian Gianforcaro
7403342387 true: Port to LibMain 2022-03-22 11:39:20 +01:00
Brian Gianforcaro
544609b40f printf: Port to LibMain 2022-03-22 11:39:20 +01:00
Brian Gianforcaro
dba23c55dd matroska: Port to LibMain 2022-03-22 11:39:20 +01:00
Brian Gianforcaro
16bee0ba79 Everywhere: Move js/web/wasm tests under /home/anon/Tests 2022-03-20 22:20:59 +01:00
Brian Gianforcaro
67fc81a65a Everywhere: Move cpp-tests under /home/anon/Tests 2022-03-20 22:20:59 +01:00
Tim Schumacher
a128d4931d Base: Install symlinks instead of aliasing rgrep and egrep 2022-03-20 11:50:47 -07:00
Tim Schumacher
4a5d1db7f6 grep: Recognize mode based on the program name 2022-03-20 11:50:47 -07:00
Tim Schumacher
21bbff0349 grep: Properly update match state when handling files 2022-03-19 22:05:40 +01:00
Tim Schumacher
c1004b095e grep: Adapt maximum line size depending on file size
Otherwise, we would never stop trying to fetch new lines if the next
newline is found beyond a range that the (default sized) buffer can
hold.
2022-03-19 22:05:40 +01:00
Ali Mohammad Pur
3c1815a0d9 pro: Simplify the progress report logic a bit
The previous progress report changed far too fast to be meaningful,
limit the report time to 100ms, and avoid spamming the terminal with
report data that's not even readable.
Also remove some dbgln()'s.
2022-03-19 22:04:35 +01:00
Ali Mohammad Pur
adff9a96a6 pro: Optionally follow 3xx responses with a Location header
This is not enabled by default, and can be enabled by passing `-l`.
Fixes #12714.
2022-03-19 22:04:35 +01:00
Sam Atkins
1ba6974b60 cmp: Implement cmp(1) 2022-03-19 11:01:49 -07:00
Tim Schumacher
13ef8469da Utilities: Add support for setting permissions to install 2022-03-19 10:26:33 -07:00
Tim Schumacher
9de742e321 Utilities: Add support for multiple sources to install 2022-03-19 10:26:33 -07:00
Tim Schumacher
f44cd168b0 Utilities: Add the -c option to install 2022-03-19 10:26:33 -07:00
Lenny Maiorani
f912a48315 Userland: Change static const variables to static constexpr
`static const` variables can be computed and initialized at run-time
during initialization or the first time a function is called. Change
them to `static constexpr` to ensure they are computed at
compile-time.

This allows some removal of `strlen` because the length of the
`StringView` can be used which is pre-computed at compile-time.
2022-03-18 19:58:57 +01:00
Itamar
09bdd844b4 Utilities: Remove redundant program name element in Core::command() call
This removes a redundant program name element from the arguments Vector
in calls to Core::command().

The Shell's argument parsing logic tolerated the extra argument,
until 83609ad.
2022-03-17 12:32:59 +03:30
Undefine
004e045adc Utilities: Add an lscpu utility 2022-03-15 15:44:17 +00:00
Daniel Bertalan
7bd68c86d3 date: Allow using a custom format string
This commit adds an optional string positional argument which is used a
custom format string for the date.
2022-03-08 23:30:47 +01:00
Liav A
bd48e73851 Utilities/lspci: Add verbose flag to show data about PCI BARs
Use the exposed sysfs interface and print the addresses to the user if
requested to.
2022-03-08 21:52:10 +01:00
Liav A
a91da67216 Utilities/lspci: Iterate over /sys/bus/pci instead of reading /proc/pci
This opens many opportunities to add more data printed in lspci in a
flexible manner - so instead of reading an ever-expanding JSON encoded
file, we can add more features and let the utility read the directory
entries from sysfs.

This also allows not only filtering data on devices but to easily filter
non-wanted devices when printing the output.
2022-03-08 21:52:10 +01:00
Maciej
efd9c70d94 js: Don't try to run empty scripts
When you try to run script containing only whitespace, it will return
undefined and doesn't do anything anyway. Let's match NodeJS behavior
and just don't display anything.

This only applies to REPL input and not to modules.
2022-03-08 07:47:24 -05:00
Andreas Kling
ff60e8ffc6 LibJS: Use Vector instead of HashMap in DeclarativeEnvironment
Constructing the HashMap in DeclarativeEnvironment was by far the most
expensive thing when making JavaScript function calls.

As it turns out, we don't really need this to be a HashMap in the first
place, as lookups are cached (by EnvironmentCoordinate) after the first
access, so after that we were not even looking in the HashMap, going
directly to the bindings Vector instead.

This reduces function_declaration_instantiation() from 16% to 9% when
idling in "Biolab Disaster". It also reduces has_binding() from 3% to
1% on the same content.

With these changes, we now actually get to idle a little bit between
game frames on my machine. :^)
2022-03-07 14:49:21 +01:00
Ali Mohammad Pur
118590325a LibLine+Userland: Make suggestion offsets per-suggestion
This allows the user to modify different parts of the input with
different suggestions.
2022-03-06 13:20:41 +01:00
Ali Mohammad Pur
b05af48d80 js: Use token offset for highlighting instead of column offset
This makes it work correctly with multiline inputs as well.
2022-03-06 13:20:41 +01:00
Tim Schumacher
495a1be925 tar: Implement support for extended headers :^) 2022-03-05 13:17:13 +01:00
Tim Schumacher
ff19c1cffe tar: Use the prefixed path for listing and verbose output 2022-03-05 13:17:13 +01:00
Tim Schumacher
e2d71823d3 tar: Prevent file buffering from reading uninitialized data
Regressed in 91fa10a0ab.
2022-03-05 13:09:42 +01:00
Wuzado
6302ca0043 reboot: Port to LibMain
First commit to the project! :^)
2022-03-03 15:42:44 -08:00
cocateh
dd8fdf7077 Utilities: Lint CMakefiles.txt
Fixed an unalphabetical order of one of the entries.
2022-03-02 21:55:32 +01:00
cocateh
91fa10a0ab Utilities: Port tar to LibMain
Ported tar to LibMain and changed it to use Core::System syscalls.
2022-03-02 21:55:32 +01:00
ForLoveOfCats
a4f9630470 js: Print ArrayBuffer.maxByteLength when present 2022-03-02 20:53:18 +01:00