Skip to content

Commit

Permalink
release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcx committed Jun 23, 2020
1 parent cc9df69 commit 014a94b
Show file tree
Hide file tree
Showing 12 changed files with 2,282 additions and 0 deletions.
Binary file added .assets/tree.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .assets/tree_showhidden.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
BasedOnStyle : LLVM
AccessModifierOffset : -1
AlignAfterOpenBracket : AlwaysBreak
AlignConsecutiveAssignments : true
AlignConsecutiveDeclarations : false
AlignConsecutiveMacros : true
AlignEscapedNewlines : Left
AlignOperands : true
AlignTrailingComments : true
AllowAllArgumentsOnNextLine : true
AllowAllConstructorInitializersOnNextLine : true
AllowAllParametersOfDeclarationOnNextLine : true
AllowShortBlocksOnASingleLine : true
AllowShortCaseLabelsOnASingleLine : true
AllowShortFunctionsOnASingleLine : false
AllowShortIfStatementsOnASingleLine : Never
AllowShortLambdasOnASingleLine : All
AlwaysBreakAfterReturnType : All
AlwaysBreakAfterDefinitionReturnType : All
AlwaysBreakTemplateDeclarations : Yes
KeepEmptyLinesAtTheStartOfBlocks : false
IndentWrappedFunctionNames : false
UseTab : Never
IndentWidth : 2
TabWidth : 2
ContinuationIndentWidth : 4
BinPackArguments : true
BinPackParameters : true
ColumnLimit : 80
Language : Cpp
Standard : Auto
84 changes: 84 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# - - - - - - - - - - - - - configuration - - - - - - - - - - - - - #

BIN = treee
PREFIX = /usr/local

LIBS = -lncurses

EXTDIR = ext
INCDIR = include
SRCDIR = src

BINDIR = .bin
OBJDIR = .obj
DEPDIR = .dep

SRC = disp.c \
file.c \
main.c

CFLAGS = -std=gnu99 \
-g \
-pedantic \
-Wall \
-I/usr/include \
-I${INCDIR} \
-I${EXTDIR}
LDFLAGS = ${LIBS}

# - - - - - - - - - - - - - - - phony - - - - - - - - - - - - - - - - #

all: ${BINDIR}/${BIN}

run: ${BINDIR}/${BIN}
./${BINDIR}/${BIN}

install: ${BINDIR}/${BIN}
cp $< ${PREFIX}/bin

uninstall:
rm -f ${PREFIX}/bin/${BIN}

clean:
rm -rf ./${BINDIR} ./${OBJDIR} ./${DEPDIR}

.PHONY: all run clean

# - - - - - - - - - - - - - - - objects - - - - - - - - - - - - - - - #

vpath %.c ${SRCDIR}

OBJ = $(patsubst %.c,${OBJDIR}/%.o,$(SRC))

${OBJ}: | ${OBJDIR}

${OBJDIR}:
@mkdir -p $@

${OBJDIR}/%.o: %.c
${CC} ${CFLAGS} -c $< -o $@

# - - - - - - - - - - - - - - - binary - - - - - - - - - - - - - - - #

${BINDIR}:
@mkdir -p $@

${BINDIR}/${BIN}: ${BINDIR} ${OBJ} ${INC}
${CC} -o $@ ${OBJ} ${LDFLAGS}
@chmod 755 $@

# - - - - - - - - - - - - - - dependencies - - - - - - - - - - - - - - #

$(patsubst %.c,${DEPDIR}/%.d,$(SRC)): | ${DEPDIR}

${DEPDIR}:
@mkdir -p $@

${DEPDIR}/%.d: %.c
@${CC} ${CFLAGS} \
-MF"$@" -MG -M -MP \
-MT"$@" \
-MT"$(patsubst %.c,${DEPDIR}/%.o,${<})" \
"$<"

include $(patsubst %.c,${DEPDIR}/%.d,$(SRC))
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# treee

treee is an interactive GNU/Linux `tree` clone.

_This project is in a very early stage of development, but basic features are complete._

## Purpose

I have found `tree` to be a really great addition to development.

This program is similar to `tree` but is built with ncurses;
the working directory is scanned every second and updates the display.

## Example

![example](./.assets/tree.example.png)
![showhidden.example](./.assets/tree_showhidden.example.png)

## Usage

```bash
git clone https://github.com/jpcx/treee
cd treee
make
sudo make install

treee

# for other directories:
treee ../another_dir
```

## Controls

`h`, `j`, `k`, `l` for motion

_[hold shift for fast motion]_

press `.` to toggle hidden file display

pres `q` to exit

## TODO

- color different file types differently
- add `/` control for search
- add more command parameters
- enable/disable colors
- exclude matching
- display more directory information

## Contribution

Contribution is welcome! Again, this is in an early stage of development.
Loading

0 comments on commit 014a94b

Please sign in to comment.