Skip to content
Snippets Groups Projects
Commit 66bdf71f authored by yorhel's avatar yorhel
Browse files

Documented the 'a' and 'i'-keys, help window is more dynamic and updated TODO

git-svn-id: svn://blicky.net/ncdu/trunk@21 ce56bc8d-f834-0410-b703-f827bd498a76
parent ce53b81d
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,8 @@ Small list of planned features/changes, suggestions are always welcome. ...@@ -4,8 +4,8 @@ Small list of planned features/changes, suggestions are always welcome.
- Improve configuration interface (settings.c) - Improve configuration interface (settings.c)
* All command line options should be accessible in the GUI * All command line options should be accessible in the GUI
* Tabs? * Tabs?
* Still use the ncurses forms library, or implement our own? (hopefully less * Still use the ncurses forms library, or implement our own?
buggy and more control) - shouldn't be too hard to do. (hopefully less buggy and more control)
- Add export/import feature for filelists - Add export/import feature for filelists
* Also comparing two filelists * Also comparing two filelists
...@@ -13,7 +13,3 @@ Small list of planned features/changes, suggestions are always welcome. ...@@ -13,7 +13,3 @@ Small list of planned features/changes, suggestions are always welcome.
- Improve browser interface - Improve browser interface
* Mutt-like status bar? * Mutt-like status bar?
* Browser always on background, even on startup * Browser always on background, even on startup
- Remove...
* Switching to powers of 1000 (is there *anyone* who actually uses that
feature?)
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.fam C .fam C
\fBncdu\fP [\fB-ahqvx\fP] [\fIdir\fP] \fBncdu\fP [\fB-hqvx\fP] [\fIdir\fP]
.fam T .fam T
.fi .fi
.SH DESCRIPTION .SH DESCRIPTION
...@@ -21,11 +21,6 @@ For a more detailed explanation of \fBncdu\fP, please check ...@@ -21,11 +21,6 @@ For a more detailed explanation of \fBncdu\fP, please check
http://dev.yorhel.nl/ncdu/ http://dev.yorhel.nl/ncdu/
.SH OPTIONS .SH OPTIONS
.TP .TP
\fB-a\fP
Apparent sizes. Normally, \fBncdu\fP would calculate the
disk usage of each file, setting \fB-a\fP will tell \fBncdu\fP
to simply calculate the actual size of the files.
.TP
\fB-h\fP \fB-h\fP
Print a small help message Print a small help message
.TP .TP
...@@ -92,6 +87,10 @@ s ...@@ -92,6 +87,10 @@ s
Order by filesize (press again for descending order) Order by filesize (press again for descending order)
.TP .TP
.B .B
a
Toggle between showing disk usage and showing apparent size.
.TP
.B
d d
Delete the selected file or directory. An error message will be shown Delete the selected file or directory. An error message will be shown
when the contents of the directory do not match or do not exist anymore when the contents of the directory do not match or do not exist anymore
...@@ -120,6 +119,10 @@ that the totals shown at the bottom of the screen are not correct, make ...@@ -120,6 +119,10 @@ that the totals shown at the bottom of the screen are not correct, make
sure you haven't enabled this option. sure you haven't enabled this option.
.TP .TP
.B .B
i
Show information about the current selected item.
.TP
.B
r r
Refresh/recalculate the current directory. Refresh/recalculate the current directory.
.TP .TP
......
...@@ -25,16 +25,38 @@ ...@@ -25,16 +25,38 @@
#include "ncdu.h" #include "ncdu.h"
#define KEYS 14
void drawHelp(int page) { char *keys[KEYS*2] = {
/*|----key----| |----------------description----------------|*/
"up/down", "Cycle through the items",
"right/enter", "Open directory",
"left", "Previous directory",
"n", "Sort by name (ascending/descending)",
"s", "Sort by size (ascending/descending)",
"d", "Delete selected file or directory",
"t", "Toggle dirs before files when sorting",
"g", "Show percentage and/or graph",
"p", "Toggle between powers of 1000 and 1024",
"a", "Toggle between apparent size and disk usage",
"h", "Show/hide hidden or excluded files",
"i", "Show information about selected item",
"r", "Recalculate the current directory",
"q", "Quit ncdu"
};
void drawHelp(int page, int start) {
WINDOW *hlp; WINDOW *hlp;
int i, line;
hlp = newwin(15, 60, winrows/2-7, wincols/2-30); hlp = newwin(15, 60, winrows/2-7, wincols/2-30);
box(hlp, 0, 0); box(hlp, 0, 0);
wattron(hlp, A_BOLD); wattron(hlp, A_BOLD);
mvwaddstr(hlp, 0, 4, "ncdu help"); mvwaddstr(hlp, 0, 4, "ncdu help");
wattroff(hlp, A_BOLD); wattroff(hlp, A_BOLD);
mvwaddstr(hlp, 13, 32, "Press any key to continue"); mvwaddstr(hlp, 13, 38, "Press q to continue");
if(page == 1) if(page == 1)
wattron(hlp, A_REVERSE); wattron(hlp, A_REVERSE);
...@@ -51,30 +73,15 @@ void drawHelp(int page) { ...@@ -51,30 +73,15 @@ void drawHelp(int page) {
switch(page) { switch(page) {
case 1: case 1:
wattron(hlp, A_BOLD); line = 1;
mvwaddstr(hlp, 2, 7, "up/down"); for(i=start*2; i<start*2+20; i+=2) {
mvwaddstr(hlp, 3, 3, "right/enter"); wattron(hlp, A_BOLD);
mvwaddstr(hlp, 4, 10, "left"); mvwaddstr(hlp, ++line, 13-strlen(keys[i]), keys[i]);
mvwaddstr(hlp, 5, 11, "n/s"); wattroff(hlp, A_BOLD);
mvwaddch( hlp, 6, 13, 'd'); mvwaddstr(hlp, line, 15, keys[i+1]);
mvwaddch( hlp, 7, 13, 't'); }
mvwaddch( hlp, 8, 13, 'g'); if(start != KEYS-10)
mvwaddch( hlp, 9, 13, 'p'); mvwaddstr(hlp, 12, 25, "-- more --");
mvwaddch( hlp,10, 13, 'h');
mvwaddch( hlp,11, 13, 'r');
mvwaddch( hlp,12, 13, 'q');
wattroff(hlp, A_BOLD);
mvwaddstr(hlp, 2, 16, "Cycle through the items");
mvwaddstr(hlp, 3, 16, "Open directory");
mvwaddstr(hlp, 4, 16, "Previous directory");
mvwaddstr(hlp, 5, 16, "Sort by name or size (asc/desc)");
mvwaddstr(hlp, 6, 16, "Delete selected file or directory");
mvwaddstr(hlp, 7, 16, "Toggle dirs before files when sorting");
mvwaddstr(hlp, 8, 16, "Show percentage and/or graph");
mvwaddstr(hlp, 9, 16, "Toggle between powers of 1000 and 1024");
mvwaddstr(hlp,10, 16, "Show/hide hidden or excluded files");
mvwaddstr(hlp,11, 16, "Recalculate the current directory");
mvwaddstr(hlp,12, 16, "Quit ncdu");
break; break;
case 2: case 2:
wattron(hlp, A_BOLD); wattron(hlp, A_BOLD);
...@@ -149,31 +156,39 @@ void drawHelp(int page) { ...@@ -149,31 +156,39 @@ void drawHelp(int page) {
void showHelp(void) { void showHelp(void) {
int p = 1, ch; int p = 1, st = 0, ch;
drawHelp(p); drawHelp(p, st);
while((ch = getch())) { while((ch = getch())) {
switch(ch) { switch(ch) {
case ERR: case ERR:
break; break;
case '1': case '1':
p = 1;
break;
case '2': case '2':
p = 2;
break;
case '3': case '3':
p = 3; p = ch-'0';
st = 0;
break; break;
case KEY_RIGHT: case KEY_RIGHT:
case KEY_NPAGE: case KEY_NPAGE:
if(++p > 3) if(++p > 3)
p = 3; p = 3;
st = 0;
break; break;
case KEY_LEFT: case KEY_LEFT:
case KEY_PPAGE: case KEY_PPAGE:
if(--p < 1) if(--p < 1)
p = 1; p = 1;
st = 0;
break;
case KEY_DOWN:
case ' ':
if(st < KEYS-10)
st++;
break;
case KEY_UP:
if(st > 0)
st--;
break; break;
case KEY_RESIZE: case KEY_RESIZE:
ncresize(); ncresize();
...@@ -182,7 +197,7 @@ void showHelp(void) { ...@@ -182,7 +197,7 @@ void showHelp(void) {
default: default:
return; return;
} }
drawHelp(p); drawHelp(p, st);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment