finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
760 bytes
|
| Line | |
|---|
| 1 | 'use strict'
|
|---|
| 2 |
|
|---|
| 3 | // turn tar(1) style args like `C` into the more verbose things like `cwd`
|
|---|
| 4 |
|
|---|
| 5 | const argmap = new Map([
|
|---|
| 6 | ['C', 'cwd'],
|
|---|
| 7 | ['f', 'file'],
|
|---|
| 8 | ['z', 'gzip'],
|
|---|
| 9 | ['P', 'preservePaths'],
|
|---|
| 10 | ['U', 'unlink'],
|
|---|
| 11 | ['strip-components', 'strip'],
|
|---|
| 12 | ['stripComponents', 'strip'],
|
|---|
| 13 | ['keep-newer', 'newer'],
|
|---|
| 14 | ['keepNewer', 'newer'],
|
|---|
| 15 | ['keep-newer-files', 'newer'],
|
|---|
| 16 | ['keepNewerFiles', 'newer'],
|
|---|
| 17 | ['k', 'keep'],
|
|---|
| 18 | ['keep-existing', 'keep'],
|
|---|
| 19 | ['keepExisting', 'keep'],
|
|---|
| 20 | ['m', 'noMtime'],
|
|---|
| 21 | ['no-mtime', 'noMtime'],
|
|---|
| 22 | ['p', 'preserveOwner'],
|
|---|
| 23 | ['L', 'follow'],
|
|---|
| 24 | ['h', 'follow'],
|
|---|
| 25 | ])
|
|---|
| 26 |
|
|---|
| 27 | module.exports = opt => opt ? Object.keys(opt).map(k => [
|
|---|
| 28 | argmap.has(k) ? argmap.get(k) : k, opt[k],
|
|---|
| 29 | ]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {}
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.