Drake
9d67adfc45
`ls`: remove debug printf.
2 years ago
Drake
177e7648c4
`ls`: fix memory leak.
2 years ago
Drake
182090801f
`ls`: unbreak things heavily.
2 years ago
Drake
e11c85017a
`yes`: use strcat.
2 years ago
Drake
01a5d6d9c0
`yes`: fix some errors.
2 years ago
Drake
eddbac9c48
`dbox`: use macro to match functions.
2 years ago
Drake
35e0d2c66e
`dbox`/Makefile/funcs.h: fix remaining compiler warnings.
...
specifically, the ones where I implicitly declared functions in dbox (because I manually linked with them later on)
2 years ago
Drake
90627d1428
`src/main.c`: rename to `src/dbox.c`.
...
it should hereby be refered to in commit messages as `dbox`, because it
is now a fully incorporated program.
3 years ago
Drake
4dacf439da
`src/main.c`: remove debug messages.
3 years ago
Drake
d395b0ae28
`src/main.c`/Makefile: inital single bin support.
...
get fucked sigsegvs, I won this time.
very early, probably very broken, havent really had time to test too
muj
3 years ago
Drake
9921ad5cff
all: change main funcs to respectively named ones
...
first big change to help with moving to a single binary :)
3 years ago
Drake
ecb700d401
`chroot`/Makefile: add chroot
3 years ago
Drake
7a801dbe8e
`cp`/Makefile: add `cp`.
3 years ago
Drake
810dec9808
`ls`/file.h/ansi-colour.h: add colouring for executables.
...
also switched symlink colour from green to purple (so I can use green for executables).
3 years ago
Drake
ad598c70f9
`ls`: fix memory leak from not freeing the directory.
3 years ago
Drake
5e09a79105
`ls`: massive refactor to support passing multiple paths.
...
moved printing files into function
can now parse multiple paths when passed
reworked printing to directly add paths to a char** and sort them, as opposed to the jank simoleon delimiter thing i was doing previously with strtok
3 years ago
Drake
93b1d9219d
`yes`: run clang-format.
...
dammit, where is my precommit hook
3 years ago
Drake
6476b90e9b
`ls`: update help message.
3 years ago
Drake
e05c4f8d22
`ls`: add proper short option handling.
...
Now a command such as `ls -caC` is valid, and will be interpreted the same as `ls --color --all --columns`
3 years ago
Drake
e78aa64bb1
`yes`: rework printing and use a buffer.
3 years ago
Drake
38705fa09b
`cat`: close file descriptor in `concatFileToStdoutWithOptions`.
...
otherwise, it was causing memory leaks.
3 years ago
Drake
0ab66c2a27
`uname`: read hostname at the beginning, instead of on-demand.
3 years ago
Drake
389dbcda7c
`cat`: add `--show-line-ends`.
3 years ago
Drake
84ca84611f
`rm`: add `--follow-symlinks`.
...
now i have a feature that gnu doesn't even have!
admittedly a pointless one... but still a substantial feature none-the-less.
3 years ago
Drake
e16bee31d5
`rm`/Makefile: add `rm`.
...
another gamer added to the ranks of the esports team.
supports recursive deletion of directories.
3 years ago
Drake
19d0be3cf0
`ls`: move width checking to before filename printing.
...
this matches gnu/posix `ls` more (maybe?).
also it looks better imo
3 years ago
Drake
e8412ff491
`ls`/file.h: run `clang-format`.
...
the "i need a pre-commit hook" curse strikes again.
3 years ago
Drake
1567e63152
`cat`/file.h: move `concatFileToStdout` func to file.h.
...
another thing i figure may be somewhat needed.
3 years ago
Drake
42e3204429
`ls`/checks.h: move `startsWith*` functions to header.
...
i figure these'll be useful in other programs, so might as well go ahead and add them.
3 years ago
Drake
6f27014976
`cat`: remove pointless checking after running concatFileToStdout.
...
it didn't even seem to work properly anyways.
3 years ago
Drake
2f14fffd5c
All: add license comment.
...
also: change ansi implementation to be slightly less copyright-infringing.
3 years ago
Drake
75be2b920a
`cat`: allow concatenating multiple files.
...
previously the `concatenating` in the help message meant concatenating to stdout :p
3 years ago
Drake
4a2bc64ca5
`ls`: update help message.
...
added example usage, --width docs, and cwd note.
3 years ago
Drake
9b124c9cfb
`cat`/Makefile: add `cat`.
...
i thought this would be alot harder to implement, lol.
supports reading from stdin (including pipes) and files.
big dab moment.
3 years ago
Drake
48745708cc
`ls`: add error checking when expanding `..`s.
...
so apparently it was realpath causing this, not opendir.
me big dum.
3 years ago
Drake
f42b88fad5
`ls`: add --width.
...
you do not know the pain i went through to implement this.
3 years ago
Drake
136b84d019
`ls`: run `clang-format`.
...
i should setup a pre-commit hook for this, lol.
3 years ago
Drake
1bc13fb62c
`ls`: fix segfault when being ran in a directory without any files.
3 years ago
Drake
fba399a85e
`ls`: remove uneeded comment.
...
went along with one of the unremoved functions ig.
3 years ago
Drake
11d32b9dfb
All: add newline to version output.
...
goddammit, i apparently missed a bunch of stuff after some of the reforms i've done.
3 years ago
Drake
1ee035fe27
All: run `clang-format` on code and makefile.
...
C source files use LLVM style, Makefile uses Google style.
3 years ago
Drake
d97207065f
All: remove uneeded imports, according to include-what-you-use.
...
see https://github.com/include-what-you-use/include-what-you-use for more info on iwyu.
3 years ago
Drake
a839c81518
`ls` and file.h: massive ls function cleanup.
...
moved file functions (isRegularFile, isDirectory, isSymlink) into file.h.
commented out printBool, as it should only be needed when debugging.
made remaining function static.
3 years ago
Drake
005327533e
`uname`: add typecast to fix `-Wextra` warning.
3 years ago
Drake
23bc854b51
`whoami`: revert "`whoami`: misc improvements, including...".
...
This reverts commit 8a2afdc33a
.
so apparently `getlogin()` returns the user the process is running under, and when it is called when you are in a sudoed bash, it returns the login username instead of root.
as you may be able to guess, that is not exactly intended behaviour.
3 years ago
Drake
9eb02a4954
`ls`: fix output on prompts without newline at beginning.
...
i *swore* i fixed this (and i did for other programs) but i guess this one just escaped my mind.
very sad.
3 years ago
Drake
4813fd8c0c
`ls`: make -C directly modify maxLen instead of an intermediary boolean.
...
i've no idea why i didnt do this in the first place, lol
3 years ago
Drake
0a059278c7
All: switch version declaration using header to makefile.
...
makes imports a little cleaner
3 years ago
Drake
cecdc7bf59
`yes`: better help message, specified messages.
3 years ago
Drake
5bc4b66dd0
`ls`: add green highlighting for symlinks
...
fun fact: github copilot helped me with this :)
3 years ago