From 124df59933acebe54740365b0b53ced09e06776a Mon Sep 17 00:00:00 2001 From: Piotr Marendowski Date: Tue, 19 Mar 2024 19:40:32 +0100 Subject: [PATCH] Add man page and update README --- Makefile | 2 +- README.md | 73 +++++++++++++++++++++++++++++++++++++++++-------------- ccc.1 | 47 +++++++++++++++++++++++++++++++++++ file.h | 2 +- 4 files changed, 104 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 809ef7f..f36a8b7 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ MANDIR = $(PREFIX)/share/man/man1 # Flags LDFLAGS = $(shell pkg-config --libs ncurses) -CFLAGS = -march=native -mtune=native -O3 -pipe -s -std=c99 -pedantic $(shell pkg-config --cflags ncurses) -Wall # -Wextra -Werror +CFLAGS = -O3 -pipe -s -std=c99 -pedantic -Wall $(shell pkg-config --cflags ncurses) SRC = ccc.c util.c file.c $(CONF) diff --git a/README.md b/README.md index 42ea80a..e0daa2a 100644 --- a/README.md +++ b/README.md @@ -8,36 +8,73 @@ The fact that it is written in C makes it more versatile and rapid, enabling us Consider this project incomplete and WIP! -| Feature | Ported | Dropped | Added | -|--------------------------------|:------:|:-------:|:-----:| -| Standard movement | X | | | -| Advanced movement (jumps) | X | | | -| Searching | | | | -| File preview | | | X | -| Sorting | | | | -| Marking and marking operations | | | | -| Other operations on files | | | | -| File details | X | | | -| Image previews | | | | -| Help | | | | -| History | | | | -| Bookmarks | | | | -| Bulk rename | | | | -| Workspaces | | | | +| Feature of fff | Ported | Dropped | +|--------------------------------|:------:|:-------:| +| Standard movement | X | | +| Advanced movement (jumps) | X | | +| File details | X | | +| Searching for files | | | +| Sorting | | | +| Marking and marking operations | | | +| Other operations on files | | | +| Image previews | | | +| Help | | | +| History | | | +| Bookmarks | | | +| Bulk rename | | | + +#### Features added that are not in [fff](https://github.com/piotr-marendowski/fff): + +- File preview (without highlighting) + +## Installation ### Dependencies - gcc +- ncurses - make - pkg-config -- ncurses ### Building You will need to run these with elevated privilages. -```sh +``` $ git clone https://github.com/piotr-marendowski/ccc $ make $ sudo make install ``` + +## Usage + +``` +j: scroll down +k: scroll up +h: go to parent dir +l: go to child dir + +down: scroll down +up: scroll up +left: go to parent dir +right: go to child dir + +enter: go to child dir/open file +backspace: go to parent dir + +g: go to top +G: go to bottom + +t: go to trash +~: go to home +z: refresh current dir + +space: mark file +a: mark all files in directory + +q: exit +``` + +## License + +This project has GNU GPL v.3 license. diff --git a/ccc.1 b/ccc.1 index e69de29..02029de 100644 --- a/ccc.1 +++ b/ccc.1 @@ -0,0 +1,47 @@ +. +.TH CCC "1" "March 2024" "ccc" "User Commands" +.SH NAME +ccc \- Fast TUI file manager written in C, using ncurses. +.SH SYNOPSIS +.B ccc +.SH DESCRIPTION +ccc is a rewrite of fff file manager in C aiming for usefulness and speed. The fact that it is written in C makes it more versatile and rapid, enabling us to add features that were previously ruled out due to time complexity. You may call it a soft fork. +.PP +.SH "Usage" +. +.nf + +j: scroll down +k: scroll up +h: go to parent dir +l: go to child dir + +down: scroll down +up: scroll up +left: go to parent dir +right: go to child dir + +enter: go to child dir/open file +backspace: go to parent dir + +g: go to top +G: go to bottom + +t: go to trash +~: go to home +z: refresh current dir + +space: mark file +a: mark all files in directory + +q: exit +. +.fi +. +.SH "Customization" +. +.nf + +Various settings can be changed in config.h file located in the program's directory. +. +.fi diff --git a/file.h b/file.h index b2890cb..57070aa 100644 --- a/file.h +++ b/file.h @@ -16,7 +16,7 @@ void clear_files(); void clear_marked(); long add_file(char *filepath, char *stats, char *type, int color); void remove_marked(file *marked_file); -long add_marked(char *filepath, char *type); +long add_marked(char *filepath, char *type, bool force); file *get_marked(long index); bool in_marked(char *path); file *get_file(long index);