11cb0ef41Sopenharmony_ci'use strict'
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ci// turn tar(1) style args like `C` into the more verbose things like `cwd`
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciconst argmap = new Map([
61cb0ef41Sopenharmony_ci  ['C', 'cwd'],
71cb0ef41Sopenharmony_ci  ['f', 'file'],
81cb0ef41Sopenharmony_ci  ['z', 'gzip'],
91cb0ef41Sopenharmony_ci  ['P', 'preservePaths'],
101cb0ef41Sopenharmony_ci  ['U', 'unlink'],
111cb0ef41Sopenharmony_ci  ['strip-components', 'strip'],
121cb0ef41Sopenharmony_ci  ['stripComponents', 'strip'],
131cb0ef41Sopenharmony_ci  ['keep-newer', 'newer'],
141cb0ef41Sopenharmony_ci  ['keepNewer', 'newer'],
151cb0ef41Sopenharmony_ci  ['keep-newer-files', 'newer'],
161cb0ef41Sopenharmony_ci  ['keepNewerFiles', 'newer'],
171cb0ef41Sopenharmony_ci  ['k', 'keep'],
181cb0ef41Sopenharmony_ci  ['keep-existing', 'keep'],
191cb0ef41Sopenharmony_ci  ['keepExisting', 'keep'],
201cb0ef41Sopenharmony_ci  ['m', 'noMtime'],
211cb0ef41Sopenharmony_ci  ['no-mtime', 'noMtime'],
221cb0ef41Sopenharmony_ci  ['p', 'preserveOwner'],
231cb0ef41Sopenharmony_ci  ['L', 'follow'],
241cb0ef41Sopenharmony_ci  ['h', 'follow'],
251cb0ef41Sopenharmony_ci])
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_cimodule.exports = opt => opt ? Object.keys(opt).map(k => [
281cb0ef41Sopenharmony_ci  argmap.has(k) ? argmap.get(k) : k, opt[k],
291cb0ef41Sopenharmony_ci]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {}
30