Selaa lähdekoodia

docs: Add help text to dcall utility (#335)

Sam Atkins 1 vuosi sitten
vanhempi
säilyke
a8d1d3b87a
1 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 10 2
      packages/phoenix/src/puter-shell/coreutils/dcall.js

+ 10 - 2
packages/phoenix/src/puter-shell/coreutils/dcall.js

@@ -16,9 +16,17 @@
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
+function highlight(text) {
+    return `\x1B[92m${text}\x1B[0m`;
+}
+
 export default {
-    name: 'driver-call',
-    usage: 'driver-call METHOD [JSON]',
+    name: 'dcall',
+    usage: 'dcall INTERFACE:METHOD [ARGS]',
+    description: 'Send a request to a driver, and print the response.\n\n' +
+        'INTERFACE is the name of the driver interface.\n\n' +
+        `METHOD is the basic operation to perform, for example ${highlight('create')}, ${highlight('read')}, ${highlight('update')}, or ${highlight('delete')}. The valid methods will depend on the driver.\n\n` +
+        'ARGS is a JSON string that will be passed as the arguments to the driver method. This will depend on the driver and method.',
     args: {
         $: 'simple-parser',
         allowPositionals: true,