diff --git a/packages/ethernaut-common/src/ui/syntax.js b/packages/ethernaut-common/src/ui/syntax.js index d7fa5343..d2570b94 100644 --- a/packages/ethernaut-common/src/ui/syntax.js +++ b/packages/ethernaut-common/src/ui/syntax.js @@ -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) diff --git a/packages/ethernaut-ui/src/internal/make-interactive.js b/packages/ethernaut-ui/src/internal/make-interactive.js index 67a5dc78..373cfe39 100644 --- a/packages/ethernaut-ui/src/internal/make-interactive.js +++ b/packages/ethernaut-ui/src/internal/make-interactive.js @@ -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)`) }