From fd76c478a9318b5b5757a60f69145683bae3bd5b Mon Sep 17 00:00:00 2001 From: Jane Degtiareva Date: Fri, 24 Jul 2020 11:23:45 -0700 Subject: [PATCH] Improve help for view/call operations --- bin/near-cli.js | 7 ++++++- commands/call.js | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/near-cli.js b/bin/near-cli.js index 25c6212b..208b2c3e 100644 --- a/bin/near-cli.js +++ b/bin/near-cli.js @@ -128,7 +128,12 @@ const deploy = { const callViewFunction = { command: 'view [args]', desc: 'make smart contract call which can view state', - builder: (yargs) => yargs, + builder: (yargs) => yargs + .option('args', { + desc: 'Arguments to the view call, in JSON format (e.g. \'{"param_a": "value"}\')', + type: 'string', + default: null + }), handler: exitOnError(main.callViewFunction) }; diff --git a/commands/call.js b/commands/call.js index eedc44c5..99686b90 100644 --- a/commands/call.js +++ b/commands/call.js @@ -16,6 +16,14 @@ module.exports = { desc: 'Number of tokens to attach', type: 'string', default: '0' + }) + .option('args', { + desc: 'Arguments to the contract call, in JSON format (e.g. \'{"param_a": "value"}\')', + type: 'string', + default: null + }) + .option('accountId', { + required: true, }), handler: exitOnError(scheduleFunctionCall) };