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
d06825b3
Commit
d06825b3
authored
4 years ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Make --help work and copy the option parsing logic from filelist.js
parent
3d04f9c1
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/addfiles.js
+39
-37
39 additions, 37 deletions
exec/addfiles.js
with
39 additions
and
37 deletions
exec/addfiles.js
+
39
−
37
View file @
d06825b3
...
@@ -12,26 +12,6 @@ const default_excludes = [
...
@@ -12,26 +12,6 @@ const default_excludes = [
"
SFFILES.BBS
"
"
SFFILES.BBS
"
];
];
if
(
argv
.
indexOf
(
"
-help
"
)
>=
0
||
argv
.
indexOf
(
"
-?
"
)
>=
0
)
{
writeln
(
"
usage: [-options] [dir-code] [listfile]
"
);
writeln
(
"
options:
"
);
writeln
(
"
-all add files in all libraries/directories (implies -auto)
"
);
writeln
(
"
-lib=<name> add files in all directories of specified library (implies -auto)
"
);
writeln
(
"
-from=<name> specify uploader's user name (may require quotes)
"
);
writeln
(
"
-ex=<filename> add to excluded filename list
"
);
writeln
(
"
(default:
"
+
default_excludes
.
join
(
'
,
'
)
+
"
)
"
);
writeln
(
"
-diz always extract/use description in archive
"
);
writeln
(
"
-update update existing file entries (default is to skip them)
"
);
writeln
(
"
-date[=fmt] include today's date in description
"
);
writeln
(
"
-fdate[=fmt] include file's date in description
"
);
writeln
(
"
-adate[=fmt] include newest archived file date in description
"
);
writeln
(
"
(fmt = optional strftime date/time format string)
"
);
writeln
(
"
-delete delete list after import
"
);
writeln
(
"
-v increase verbosity of output
"
);
writeln
(
"
-debug enable debug output
"
);
exit
(
0
);
}
function
datestr
(
t
)
function
datestr
(
t
)
{
{
if
(
date_fmt
)
if
(
date_fmt
)
...
@@ -62,12 +42,34 @@ var verbosity = 0;
...
@@ -62,12 +42,34 @@ var verbosity = 0;
for
(
var
i
=
0
;
i
<
argc
;
i
++
)
{
for
(
var
i
=
0
;
i
<
argc
;
i
++
)
{
var
arg
=
argv
[
i
];
var
arg
=
argv
[
i
];
if
(
arg
[
0
]
==
'
-
'
)
{
if
(
arg
[
0
]
==
'
-
'
)
{
if
(
arg
.
indexOf
(
"
-ex=
"
)
==
0
)
{
var
opt
=
arg
;
exclude
.
push
(
arg
.
slice
(
4
).
toUpperCase
());
while
(
opt
[
0
]
==
'
-
'
)
opt
=
opt
.
slice
(
1
);
if
(
opt
==
'
?
'
||
opt
.
toLowerCase
()
==
"
help
"
)
{
writeln
(
"
usage: [-options] [dir-code] [listfile]
"
);
writeln
(
"
options:
"
);
writeln
(
"
-all add files in all libraries/directories (implies -auto)
"
);
writeln
(
"
-lib=<name> add files in all directories of specified library (implies -auto)
"
);
writeln
(
"
-from=<name> specify uploader's user name (may require quotes)
"
);
writeln
(
"
-ex=<filename> add to excluded filename list
"
);
writeln
(
"
(default:
"
+
default_excludes
.
join
(
'
,
'
)
+
"
)
"
);
writeln
(
"
-diz always extract/use description in archive
"
);
writeln
(
"
-update update existing file entries (default is to skip them)
"
);
writeln
(
"
-date[=fmt] include today's date in description
"
);
writeln
(
"
-fdate[=fmt] include file's date in description
"
);
writeln
(
"
-adate[=fmt] include newest archived file date in description
"
);
writeln
(
"
(fmt = optional strftime date/time format string)
"
);
writeln
(
"
-delete delete list after import
"
);
writeln
(
"
-v increase verbosity of output
"
);
writeln
(
"
-debug enable debug output
"
);
exit
(
0
);
}
if
(
opt
.
indexOf
(
"
ex=
"
)
==
0
)
{
exclude
.
push
(
opt
.
slice
(
3
).
toUpperCase
());
continue
;
continue
;
}
}
if
(
arg
.
indexOf
(
"
-
lib=
"
)
==
0
)
{
if
(
opt
.
indexOf
(
"
lib=
"
)
==
0
)
{
var
lib
=
arg
.
slice
(
5
);
var
lib
=
opt
.
slice
(
4
);
if
(
!
file_area
.
lib
[
lib
])
{
if
(
!
file_area
.
lib
[
lib
])
{
alert
(
"
Library not found:
"
+
lib
);
alert
(
"
Library not found:
"
+
lib
);
exit
(
1
);
exit
(
1
);
...
@@ -77,38 +79,38 @@ for(var i = 0; i < argc; i++) {
...
@@ -77,38 +79,38 @@ for(var i = 0; i < argc; i++) {
options
.
auto
=
true
;
options
.
auto
=
true
;
continue
;
continue
;
}
}
if
(
arg
.
indexOf
(
"
-
from=
"
)
==
0
)
{
if
(
opt
.
indexOf
(
"
from=
"
)
==
0
)
{
uploader
=
arg
.
slice
(
6
);
uploader
=
opt
.
slice
(
5
);
continue
;
continue
;
}
}
if
(
arg
.
indexOf
(
"
-
date=
"
)
==
0
)
{
if
(
opt
.
indexOf
(
"
date=
"
)
==
0
)
{
date_fmt
=
arg
.
slice
(
6
);
date_fmt
=
opt
.
slice
(
5
);
options
.
date
=
true
;
options
.
date
=
true
;
continue
;
continue
;
}
}
if
(
arg
.
indexOf
(
"
-
fdate=
"
)
==
0
)
{
if
(
opt
.
indexOf
(
"
fdate=
"
)
==
0
)
{
date_fmt
=
arg
.
slice
(
7
);
date_fmt
=
opt
.
slice
(
6
);
options
.
fdate
=
true
;
options
.
fdate
=
true
;
continue
;
continue
;
}
}
if
(
arg
.
indexOf
(
"
-
adate=
"
)
==
0
)
{
if
(
opt
.
indexOf
(
"
adate=
"
)
==
0
)
{
date_fmt
=
arg
.
slice
(
7
);
date_fmt
=
opt
.
slice
(
6
);
options
.
adate
=
true
;
options
.
adate
=
true
;
continue
;
continue
;
}
}
if
(
arg
==
'
-
'
||
arg
==
'
-
all
'
)
{
if
(
opt
==
"
all
"
)
{
for
(
var
dir
in
file_area
.
dir
)
for
(
var
dir
in
file_area
.
dir
)
dir_list
.
push
(
dir
);
dir_list
.
push
(
dir
);
options
.
auto
=
true
;
options
.
auto
=
true
;
continue
;
continue
;
}
}
if
(
arg
[
1
]
==
'
v
'
)
{
if
(
opt
[
0
]
==
'
v
'
)
{
var
j
=
1
;
var
j
=
0
;
while
(
arg
[
j
++
]
==
'
v
'
)
while
(
opt
[
j
++
]
==
'
v
'
)
verbosity
++
;
verbosity
++
;
continue
;
continue
;
}
}
options
[
arg
.
slice
(
1
)
]
=
true
;
options
[
opt
]
=
true
;
}
else
{
}
else
{
if
(
!
dir_list
.
length
)
if
(
!
dir_list
.
length
)
dir_list
.
push
(
arg
);
dir_list
.
push
(
arg
);
...
...
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