mesg-foundation / engine

Build apps or autonomous workflows with reusable, shareable integrations connecting any service, app, blockchain or decentralized network.
https://mesg.com/
Apache License 2.0
130 stars 13 forks source link

Command execute doesn't allow repeated types #681

Closed antho1404 closed 5 years ago

antho1404 commented 5 years ago

This PR https://github.com/mesg-foundation/core/pull/679 introduced a new data type: repeated data

This file https://github.com/mesg-foundation/core/blob/master/utils/servicecasting/cast.go doesn't do anything about repeated parameters and so the command service execute cannot handle repeated data with the flag --data

antho1404 commented 5 years ago

Future types like Any and Object need to be tested as well

krhubert commented 5 years ago

How do we want to represent the repeated types in cli?

antho1404 commented 5 years ago

Some ideas:

NicolasMahe commented 5 years ago

Let's see what is the simplest to implement in xpflag.NewStringToStringValue.

I like --data foo=[a, b, c].

krhubert commented 5 years ago

the most common way i saw in cli is: --data foo=a,b,c where , is default separator and could be changed by --data-separator flag

--data foo=[a, b, c] - remember that spaces here won't be allowed (because of parsing cli args) so it would become --data foo=[a,b,c]

--data foo.0=a --data foo.1=b --data foo.2=c this one introduce complexity because someone may pass --data foo.100000=a and you have to fill previous values with zeros or return an error

ilgooz commented 5 years ago
NicolasMahe commented 5 years ago

let's go with the simplest implementation!