Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.216.250
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
nodejs /
yargs /
build /
lib /
Delete
Unzip
Name
Size
Permission
Date
Action
platform-shims
[ DIR ]
drwxr-xr-x
2023-12-23 20:12
typings
[ DIR ]
drwxr-xr-x
2023-12-23 20:12
utils
[ DIR ]
drwxr-xr-x
2023-12-23 20:12
argsert.d.ts
180
B
-rw-r--r--
2022-12-01 14:49
argsert.js
2.42
KB
-rw-r--r--
2022-12-01 14:49
cjs.d.ts
1.92
KB
-rw-r--r--
2022-12-01 14:49
command.d.ts
3.18
KB
-rw-r--r--
2022-12-01 14:49
command.js
15.07
KB
-rw-r--r--
2022-12-01 14:49
completion-templates.d.ts
1.43
KB
-rw-r--r--
2022-12-01 14:49
completion-templates.js
1.36
KB
-rw-r--r--
2022-12-01 14:49
completion.d.ts
1.06
KB
-rw-r--r--
2022-12-01 14:49
completion.js
5.4
KB
-rw-r--r--
2022-12-01 14:49
middleware.d.ts
785
B
-rw-r--r--
2022-12-01 14:49
middleware.js
2.14
KB
-rw-r--r--
2022-12-01 14:49
parse-command.d.ts
331
B
-rw-r--r--
2022-12-01 14:49
parse-command.js
1.04
KB
-rw-r--r--
2022-12-01 14:49
usage.d.ts
2.1
KB
-rw-r--r--
2022-12-01 14:49
usage.js
19.36
KB
-rw-r--r--
2022-12-01 14:49
validation.d.ts
1.78
KB
-rw-r--r--
2022-12-01 14:49
validation.js
11.92
KB
-rw-r--r--
2022-12-01 14:49
yargs-factory.d.ts
12.76
KB
-rw-r--r--
2022-12-01 14:49
yargs-factory.js
41.24
KB
-rw-r--r--
2022-12-01 14:49
yerror.d.ts
106
B
-rw-r--r--
2022-12-01 14:49
yerror.js
181
B
-rw-r--r--
2022-12-01 14:49
Save
Rename
import { isCommandBuilderCallback } from './command.js'; import { assertNotStrictEqual } from './typings/common-types.js'; import * as templates from './completion-templates.js'; import { isPromise } from './utils/is-promise.js'; import { parseCommand } from './parse-command.js'; export function completion(yargs, usage, command, shim) { const self = { completionKey: 'get-yargs-completions', }; let aliases; self.setParsed = function setParsed(parsed) { aliases = parsed.aliases; }; const zshShell = (shim.getEnv('SHELL') && shim.getEnv('SHELL').indexOf('zsh') !== -1) || (shim.getEnv('ZSH_NAME') && shim.getEnv('ZSH_NAME').indexOf('zsh') !== -1); self.getCompletion = function getCompletion(args, done) { const completions = []; const current = args.length ? args[args.length - 1] : ''; const argv = yargs.parse(args, true); const parentCommands = yargs.getContext().commands; function runCompletionFunction(argv) { assertNotStrictEqual(completionFunction, null, shim); if (isSyncCompletionFunction(completionFunction)) { const result = completionFunction(current, argv); if (isPromise(result)) { return result .then(list => { shim.process.nextTick(() => { done(list); }); }) .catch(err => { shim.process.nextTick(() => { throw err; }); }); } return done(result); } else { return completionFunction(current, argv, completions => { done(completions); }); } } if (completionFunction) { return isPromise(argv) ? argv.then(runCompletionFunction) : runCompletionFunction(argv); } const handlers = command.getCommandHandlers(); for (let i = 0, ii = args.length; i < ii; ++i) { if (handlers[args[i]] && handlers[args[i]].builder) { const builder = handlers[args[i]].builder; if (isCommandBuilderCallback(builder)) { const y = yargs.reset(); builder(y); return y.argv; } } } if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current) { usage.getCommands().forEach(usageCommand => { const commandName = parseCommand(usageCommand[0]).cmd; if (args.indexOf(commandName) === -1) { if (!zshShell) { completions.push(commandName); } else { const desc = usageCommand[1] || ''; completions.push(commandName.replace(/:/g, '\\:') + ':' + desc); } } }); } if (current.match(/^-/) || (current === '' && completions.length === 0)) { const descs = usage.getDescriptions(); const options = yargs.getOptions(); Object.keys(options.key).forEach(key => { const negable = !!options.configuration['boolean-negation'] && options.boolean.includes(key); let keyAndAliases = [key].concat(aliases[key] || []); if (negable) keyAndAliases = keyAndAliases.concat(keyAndAliases.map(key => `no-${key}`)); function completeOptionKey(key) { const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1); if (notInArgs) { const startsByTwoDashes = (s) => /^--/.test(s); const isShortOption = (s) => /^[^0-9]$/.test(s); const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--'; if (!zshShell) { completions.push(dashes + key); } else { const desc = descs[key] || ''; completions.push(dashes + `${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`); } } } completeOptionKey(key); if (negable && !!options.default[key]) completeOptionKey(`no-${key}`); }); } done(completions); }; self.generateCompletionScript = function generateCompletionScript($0, cmd) { let script = zshShell ? templates.completionZshTemplate : templates.completionShTemplate; const name = shim.path.basename($0); if ($0.match(/\.js$/)) $0 = `./${$0}`; script = script.replace(/{{app_name}}/g, name); script = script.replace(/{{completion_command}}/g, cmd); return script.replace(/{{app_path}}/g, $0); }; let completionFunction = null; self.registerFunction = fn => { completionFunction = fn; }; return self; } function isSyncCompletionFunction(completionFunction) { return completionFunction.length < 3; }