Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
470bc2bd
Commit
470bc2bd
authored
4 years ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Update command-line parsing (e.g. double-dash support) and help output
parent
d06825b3
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Pipeline
#1935
passed
4 years ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/dupefind.js
+17
-16
17 additions, 16 deletions
exec/dupefind.js
with
17 additions
and
16 deletions
exec/dupefind.js
+
17
−
16
View file @
470bc2bd
...
...
@@ -7,21 +7,6 @@ load("file_size.js");
"
use strict
"
;
if
(
argv
.
indexOf
(
"
-help
"
)
>=
0
||
argv
.
indexOf
(
"
-?
"
)
>=
0
)
{
writeln
(
"
usage: [-options] [[dir_code] [...]]
"
);
writeln
(
"
options:
"
);
writeln
(
"
-lib=<name> search for duplicates in specified library only
"
);
writeln
(
"
-min=<bytes> specify minimum file size to compare hash/sum
"
);
writeln
(
"
-ex=<filename> add to excluded file name list
"
);
writeln
(
"
-crc32 search for duplicate CRC-32 sums
"
);
writeln
(
"
-md5 search for duplicate MD5 sums
"
);
writeln
(
"
-sha1 search for duplicate SHA-1 sums (the default)
"
);
writeln
(
"
-names search for duplicate file names (case-insensitive)
"
);
writeln
(
"
-json use JSON formatted output
"
);
writeln
(
"
-v increase verbosity of output
"
);
exit
(
0
);
}
var
detail
=
0
;
var
min_size
=
1024
;
var
dir_list
=
[];
...
...
@@ -31,7 +16,23 @@ var options = {};
for
(
var
i
=
0
;
i
<
argc
;
i
++
)
{
var
arg
=
argv
[
i
];
if
(
arg
[
0
]
==
'
-
'
)
{
var
opt
=
arg
.
slice
(
1
);
var
opt
=
arg
;
while
(
opt
[
0
]
==
'
-
'
)
opt
=
opt
.
slice
(
1
);
if
(
opt
==
"
help
"
||
opt
==
"
?
"
)
{
writeln
(
"
usage: [-options] [[dir_code] [...]]
"
);
writeln
(
"
options:
"
);
writeln
(
"
-lib=<name> search for duplicates in specified library only
"
);
writeln
(
"
-min=<bytes> specify minimum file size to compare hash/sum
"
);
writeln
(
"
-ex=<filename> add to excluded file name list (case-insensitive)
"
);
writeln
(
"
-names search for duplicate file names (case-insensitive)
"
);
writeln
(
"
-sha1 search for duplicate SHA-1 sums (the default)
"
);
writeln
(
"
-crc32 search for duplicate CRC-32 sums
"
);
writeln
(
"
-md5 search for duplicate MD5 sums
"
);
writeln
(
"
-json use JSON formatted output
"
);
writeln
(
"
-v increase verbosity of output
"
);
exit
(
0
);
}
if
(
opt
.
indexOf
(
"
ex=
"
)
==
0
)
{
exclude
.
push
(
opt
.
slice
(
3
).
toUpperCase
());
continue
;
...
...
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