node-cluster-service icon indicating copy to clipboard operation
node-cluster-service copied to clipboard

Simpler command inputs

Open asilvas opened this issue 11 years ago • 2 comments

Currently commands issued are interpreted as primitive types (int, bool, etc), arrays, strings, or JSON for complex objects, and then passed in as arguments to the given command.

Example:

test_command { "key1": { "key1a": "val1a" } }

The command would receive that object as one as its parameters.

Problems:

  1. It's strict JSON syntax, requires quotes, not very forgiving to improper syntax.
  2. Very difficult to manually encode for use over the REST API. Too many encoded characters.

Ideally, the below examples should just work, but do not today:

// should permit js object syntax, not just JSON
cservice --workers "{ worker1: { worker: 'worker1.js' } }"

// array support
cservice --option3 "[ 'item1', 'item2' ]"

// command with multiple types of input
cservice "command2 'a long string' ['item1', 'item2'] { key: 'value' }"

What better alternatives are recommended?

asilvas avatar Aug 13 '13 20:08 asilvas

I'd love to work on this one. What is the timeline?

azweb76 avatar Aug 13 '13 21:08 azweb76

Awesome Dan. Not a blocker, so proceed with your own timeline for now.

asilvas avatar Aug 13 '13 21:08 asilvas