godaddy / godaddy/node-cluster-service

Simpler command inputs

Open
#5 2 comments 0 reactions 0 assignees Claimed by @azweb76 View on GitHub
enhancement Hacktoberfest low priority
Dominant language
JavaScript
Stars
168
Forks
28
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.