var m=(e,r,t)=>new Promise((n,s)=>{var c=a=>{try{i(t.next(a))}catch(u){s(u)}},o=a=>{try{i(t.throw(a))}catch(u){s(u)}},i=a=>a.done?n(a.value):Promise.resolve(a.value).then(c,o);i((t=t.apply(e,r)).next())});var g={group:["name","gid"],host:["name","ip_address"],mount:["name"],protocol:["name","number"],rpc:["name","number"],service:["name","port"],user:["name","uid"]},p=Array.from(Object.keys(g)),h=e=>r=>{let{attributeKey:t}=e,n=new Set;r.split(`

`).map(c=>{c.split(`
`).forEach(o=>{let[i,a]=o.trim().split(": ");i===t&&n.add(a)})});let s=[];return n.forEach(c=>s.push({name:c})),s},d={keys:{custom:(e,r)=>m(void 0,null,function*(){let t=e[e.length-3];return p.includes(t)?g[t].map(n=>({name:n})):[]})},values:{custom:(e,r)=>m(void 0,null,function*(){let t=e[e.length-4],n=e[e.length-2];return h({attributeKey:n})((yield r({command:"dscacheutil",args:["-q",t]})).stdout,e)})}},l={name:"dscacheutil",description:"Utility for managing the Directory Service cache",subcommands:[{name:"-h",description:"List the options for calling dscacheutil"},{name:"-q",description:"Query the Directory Service cache",options:[{name:"-a",description:"Attribute to query",args:[{name:"attributeKey",generators:d.keys},{name:"attributeValue",generators:d.values}]}],args:{name:"category",description:"Category to query",suggestions:p}},{name:"-cachedump",description:"Get an overview of the cache by default",options:[{name:"-buckets",description:"Get an overview of the cache by default"},{name:"-entries",description:"Dump detailed information about cache entries",args:{name:"entry",suggestions:p}}]},{name:"-configuration",description:"Get the current configuration information, such as the search policy and cache parameters"},{name:"-flushcache",description:"Flush the entire cache"},{name:"-statistics",description:"Get statistics from the cache, including an overview an detailed call statistics"}]},f=l;export{f as default};
