Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nccf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
702
Provoz
nccf
Commits
c035c385
You need to sign in or sign up before continuing.
Commit
c035c385
authored
9 years ago
by
Max Klinger
Committed by
Yorhel
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
implement confirmation switch
parent
5aeb4f9b
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
doc/ncdu.pod
+5
-0
5 additions, 0 deletions
doc/ncdu.pod
src/browser.c
+3
-1
3 additions, 1 deletion
src/browser.c
src/browser.h
+1
-0
1 addition, 0 deletions
src/browser.h
src/global.h
+2
-0
2 additions, 0 deletions
src/global.h
src/main.c
+3
-0
3 additions, 0 deletions
src/main.c
with
14 additions
and
1 deletion
doc/ncdu.pod
+
5
−
0
View file @
c035c385
...
...
@@ -103,6 +103,11 @@ List sizes using base 10 prefixes, that is, powers of 1000 (KB, MB, etc), as
defined in the International System of Units (SI), instead of the usual base 2
prefixes, that is, powers of 1024 (KiB, MiB, etc).
=item --confirm-quit
Requires a confirmation before quitting ncdu. Very helpful when you
accidentally press 'q' during or after a very long scan.
=back
=head2 Scan Options
...
...
This diff is collapsed.
Click to expand it.
src/browser.c
+
3
−
1
View file @
c035c385
...
...
@@ -397,7 +397,9 @@ int browse_key(int ch) {
if
(
info_show
)
info_show
=
0
;
else
quit_init
();
if
(
confirm_quit
)
quit_init
();
else
return
1
;
break
;
case
'g'
:
if
(
++
graph
>
3
)
...
...
This diff is collapsed.
Click to expand it.
src/browser.h
+
1
−
0
View file @
c035c385
...
...
@@ -28,6 +28,7 @@
#include
"global.h"
int
confirm_quit
;
int
browse_key
(
int
);
void
browse_draw
(
void
);
void
browse_init
(
struct
dir
*
);
...
...
This diff is collapsed.
Click to expand it.
src/global.h
+
2
−
0
View file @
c035c385
...
...
@@ -90,6 +90,8 @@ extern int read_only;
extern
long
update_delay
;
/* filter directories with CACHEDIR.TAG */
extern
int
cachedir_tags
;
/* flag if we should ask for confirmation when quitting */
extern
int
confirm_quit
;
/* handle input from keyboard and update display */
int
input_handle
(
int
);
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
3
−
0
View file @
c035c385
...
...
@@ -130,6 +130,7 @@ static void argv_parse(int argc, char **argv) {
{
'X'
,
1
,
"-X,--exclude-from"
},
{
'C'
,
0
,
"--exclude-caches"
},
{
's'
,
0
,
"--si"
},
{
'Q'
,
0
,
"--confirm-quit"
},
{
0
,
0
,
NULL
}
};
...
...
@@ -154,6 +155,7 @@ static void argv_parse(int argc, char **argv) {
printf
(
" --exclude PATTERN Exclude files that match PATTERN
\n
"
);
printf
(
" -X, --exclude-from FILE Exclude files that match any pattern in FILE
\n
"
);
printf
(
" --exclude-caches Exclude directories containing CACHEDIR.TAG
\n
"
);
printf
(
" --confirm-quit Confirm quitting ncdu
\n
"
);
exit
(
0
);
case
'q'
:
update_delay
=
2000
;
break
;
case
'v'
:
...
...
@@ -167,6 +169,7 @@ static void argv_parse(int argc, char **argv) {
case
'0'
:
dir_ui
=
0
;
break
;
case
'1'
:
dir_ui
=
1
;
break
;
case
'2'
:
dir_ui
=
2
;
break
;
case
'Q'
:
confirm_quit
=
1
;
break
;
case
1
:
exclude_add
(
val
);
break
;
/* --exclude */
case
'X'
:
if
(
exclude_addfile
(
val
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment