Skip to content

Commit c7069cf

Browse files
committed
removed unneeded args
1 parent 73f9bb8 commit c7069cf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/cli/bin/heroku-repl.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,10 @@ class HerokuRepl {
338338
*
339339
* @param {Record<string, unknown>} commandMeta the metadata for the command
340340
* @param {string[]} flagsOrArgs the flags or args for the command
341+
* @param {string} line the current line
341342
* @returns {Promise<[string[], string]>} the completions and the current input
342343
*/
343-
async #buildCompletions(commandMeta, flagsOrArgs = [], line) {
344+
async #buildCompletions(commandMeta, flagsOrArgs = [], line = '') {
344345
const {args, flags} = commandMeta
345346
const {requiredInputs: requiredFlags, optionalInputs: optionalFlags} = this.#collectInputsFromManifest(flags)
346347
const {requiredInputs: requiredArgs, optionalInputs: optionalArgs} = this.#collectInputsFromManifest(args)
@@ -362,9 +363,9 @@ class HerokuRepl {
362363
// Flags *must* occur first since they may influence
363364
// the completions for args.
364365
return await this.#getCompletionsForFlag(line, current, requiredFlags, userFlags, commandMeta) ||
365-
await this.#getCompletionsForArg(line, current, requiredArgs, userArgs, commandMeta) ||
366+
await this.#getCompletionsForArg(current, requiredArgs, userArgs) ||
366367
await this.#getCompletionsForFlag(line, current, optionalFlags, userFlags, commandMeta) ||
367-
await this.#getCompletionsForArg(line, current, optionalArgs, userArgs, commandMeta) ||
368+
await this.#getCompletionsForArg(current, optionalArgs, userArgs) ||
368369
this.#getCompletionsForEndOfLine(line, flags, userFlags)
369370
}
370371

@@ -585,14 +586,12 @@ class HerokuRepl {
585586
/**
586587
* Get completions for an arg.
587588
*
588-
* @param {string} line the current line
589589
* @param {string} current the current input
590590
* @param {({long: string}[])} args the args for the command
591591
* @param {string[]} userArgs the args that have already been used
592-
* @param {Record<string, unknown>} commandMeta the metadata for the command
593592
* @returns {Promise<[string[], string] | null>} the completions and the current input
594593
*/
595-
async #getCompletionsForArg(line, current, args = [], userArgs = [], commandMeta) {
594+
async #getCompletionsForArg(current, args = [], userArgs = []) {
596595
if (userArgs.length <= args.length) {
597596
const arg = args[userArgs.length]
598597
if (arg) {

0 commit comments

Comments
 (0)