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
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
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
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
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
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
2f14fffd5c
All: add license comment.
...
also: change ansi implementation to be slightly less copyright-infringing.
3 years ago
Drake
4a2bc64ca5
`ls`: update help message.
...
added example usage, --width docs, and cwd note.
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
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
5bc4b66dd0
`ls`: add green highlighting for symlinks
...
fun fact: github copilot helped me with this :)
3 years ago
Drake
d3182b059e
`ls`: change spacing, fix too many newlines.
3 years ago
Drake
87a07a5dc2
all (but `yes`): re-add `\n`s to new `printf()`s
...
okay so apparently they're needed
3 years ago
Drake
01f7d53d15
all (but `yes`): use printf formatting
...
clang no longer complains!
3 years ago
Drake
72ab287432
`ansi-colour.h`: switch define source for more flexibility
3 years ago
Drake
d48a31d8c4
`ls`: fix compiler warning
3 years ago
Drake
2bd11f8548
all: update help messages
...
previously help messages showed `--version` was "WIP", which it is no-longer
3 years ago
Drake
f3f2e772df
all: add universal version
...
instead of having a placeholder version command, it is now read from a #define in `lib/version.h`
3 years ago
Drake
6b6742dc21
`ls`: assorted code cleanup
3 years ago
Drake
d81516027c
`ls`: update help message
3 years ago
Drake
ce8c9f52ff
`ls`: add --columns, max length (owo i can only take so much daddy) of printing
3 years ago
Drake
2e91a4cab5
`ls`: fix memory leak in specified paths
3 years ago
Drake
998a92840f
Fix problem with specified paths in `ls`
3 years ago
Drake
5f8f10bb04
More cool improvements to `ls`
...
All memory leaks fixed!
Other misc things that I am forgetting
3 years ago
Drake
909000e44b
various large improvements to ls
...
fix colour (previously it was messing with the sorting as we add it before the sorting, so we moved it to happening during the printing stage)
fix problem with spaces in filenames breaking (we now use simoleons as delimiters. if it breaks now, why do you have a simoleon in your filename)
3 years ago
Drake
989bced475
add colour to ls
3 years ago
Drake
ca52b040a6
add ls n do a bunch more shit
3 years ago