Skip to content

Commit

Permalink
Merge pull request #35 from eternauta1337/ui-fix
Browse files Browse the repository at this point in the history
Do not show program name in autocompletion
  • Loading branch information
eternauta1337 authored Oct 11, 2024
2 parents 90a1ecf + 5edd6e9 commit 9d01b73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/ethernaut-common/src/ui/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ module.exports = function toCliSyntax(task, args, program = 'ethernaut') {
'common',
)

const tokens = [program]
const tokens = []
if (program.length > 0) tokens.push(program)

if (task.scope) tokens.push(task.scope)
tokens.push(task.name)

Expand Down
2 changes: 1 addition & 1 deletion packages/ethernaut-ui/src/internal/make-interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function makeInteractive(task) {

// If parameters were collected, print out the call
if (Object.values(collectedArgs).length > 0) {
const msg = toCliSyntax(task, args)
const msg = toCliSyntax(task, args, '')
copy(msg)
output.info(`Autocompleted: ${msg} (copied to clipboard)`)
}
Expand Down

0 comments on commit 9d01b73

Please sign in to comment.