Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --dereference option to binary #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ Think `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI
## Command Line usage

Usage is simple: `ncp [source] [dest] [--limit=concurrency limit]
[--filter=filter] --stopOnErr`
[--filter=filter] [--dereference] --stopOnErr`

The 'filter' is a Regular Expression - matched files will be copied.

The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time.

'dereference' is a boolean flag that will tell `ncp' to follow symbolic links.

'stoponerr' is a boolean flag that will tell `ncp` to stop immediately if any
errors arise, rather than attempting to continue while logging errors. The default behavior is to complete as many copies as possible, logging errors along the way.

Expand Down
5 changes: 4 additions & 1 deletion bin/ncp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var ncp = require('../lib/ncp'),
source, dest;

if (args.length < 2) {
console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]');
console.error('Usage: ncp [source] [destination] [--dereference] [--filter=filter] [--limit=concurrency limit]');
process.exit(1);
}

Expand All @@ -28,6 +28,9 @@ args.forEach(function (arg) {
if (startsWith(arg, "--stoponerr")) {
options.stopOnErr = true;
}
if (startsWith(arg, "--dereference")) {
options.dereference = true;
}
});

ncp.ncp(args[0], args[1], options, function (err) {
Expand Down