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
GitLab 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
d1adcde1
Commit
d1adcde1
authored
3 years ago
by
Yorhel
Browse files
Options
Downloads
Patches
Plain Diff
Add --ignore-config command line option
parent
39a137c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ncdu.pod
+6
-1
6 additions, 1 deletion
ncdu.pod
src/main.zig
+21
-9
21 additions, 9 deletions
src/main.zig
with
27 additions
and
10 deletions
ncdu.pod
+
6
−
1
View file @
d1adcde1
...
...
@@ -73,6 +73,10 @@ information.
This enables viewing and sorting by the latest child mtime, or modified time,
using 'm' and 'M', respectively.
=item --ignore-config
Do not attempt to load any configuration files.
=back
=head2 Scan Options
...
...
@@ -272,7 +276,8 @@ Ncdu can be configured by placing command-line options in C</etc/ncdu.conf> or
C<$HOME/.config/ncdu/config>. If both files exist, the system configuration
will be loaded before the user configuration, allowing users to override
options set in the system configuration. Options given on the command line will
override options set in the configuration files.
override options set in the configuration files. The files will not be read at
all when C<--ignore-config> is given on the command line.
The configuration file format is simply one command line option per line. Lines
starting with C<#> are ignored. Example configuration file:
...
...
This diff is collapsed.
Click to expand it.
src/main.zig
+
21
−
9
View file @
d1adcde1
...
...
@@ -306,6 +306,7 @@ fn help() noreturn {
\\
--
exclude
-
kernfs
Exclude
Linux
pseudo
filesystems
(
procfs
,
sysfs
,
cgroup
,
...
)
\\
--
confirm
-
quit
Confirm
quitting
ncdu
\\
--
color
SCHEME
Set
color
scheme
(
off
/
dark
/
dark
-
bg
)
\\
--
ignore
-
config
Don
't
load
config
files
\\
\\
Refer
to
`
man
ncdu
`
for
the
full
list
of
options
.
\\
...
...
@@ -394,6 +395,15 @@ pub fn main() void {
}
if
(
std
.
os
.
getenvZ
(
"NO_COLOR"
)
==
null
)
config
.
ui_color
=
.
darkbg
;
const
loadConf
=
blk
:
{
var
args
=
std
.
process
.
ArgIteratorPosix
.
init
();
while
(
args
.
next
())
|
a
|
if
(
std
.
mem
.
eql
(
u8
,
a
,
"--ignore-config"
))
break
:
blk
false
;
break
:
blk
true
;
};
if
(
loadConf
)
{
tryReadArgsFile
(
"/etc/ncdu.conf"
);
if
(
std
.
os
.
getenvZ
(
"XDG_CONFIG_HOME"
))
|
p
|
{
...
...
@@ -405,6 +415,7 @@ pub fn main() void {
defer
allocator
.
free
(
path
);
tryReadArgsFile
(
path
);
}
}
var
scan_dir
:
?
[]
const
u8
=
null
;
var
import_file
:
?
[:
0
]
const
u8
=
null
;
...
...
@@ -427,6 +438,7 @@ pub fn main() void {
else
if
(
opt
.
is
(
"-o"
))
export_file
=
allocator
.
dupeZ
(
u8
,
args
.
arg
())
catch
unreachable
else
if
(
opt
.
is
(
"-f"
)
and
import_file
!=
null
)
ui
.
die
(
"The -f flag can only be given once.
\n
"
,
.
{})
else
if
(
opt
.
is
(
"-f"
))
import_file
=
allocator
.
dupeZ
(
u8
,
args
.
arg
())
catch
unreachable
else
if
(
opt
.
is
(
"--ignore-config"
))
{}
else
if
(
argConfig
(
&
args
,
opt
))
{}
else
ui
.
die
(
"Unrecognized option '{s}'.
\n
"
,
.
{
opt
.
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