CloudSlang / cloud-slang

CloudSlang Language, CLI and Builder
http://cloudslang.io
Apache License 2.0
234 stars 82 forks source link

Request for YML/DSL syntax improvement: multiline, dictionary (map), or non string values #461

Open rqc opened 8 years ago

rqc commented 8 years ago

Hello,

I just wanted to give a bit of feedback on the usability of cloudslang DSL. Here they are;

  1. Remove requirement to wrap values for news in double quotes and single quotes. I understand that distinguishing between what is code and what isn't is complicated. But having me for instance, to do this:
 - command: "'echo \"Hello World\"'"

can be very detrimental to productivity and error prone. Instead it would be easier to do something like:

- command: echo "Hello World" 

or at least:

- command: "echo \"Hello World\""
  1. Have better cli input flags for run command. Right now, you have to wrap all inputs in double quotes separated by commas, then you have to escape special characters if you use them as values to the input parameters, etc. Again, this is very error prone to use manually and even when you are trying to use this programmatically. My suggestion is have flags that can be repeated like docker run allows multiple -v or -e flags. Maybe have a flag -i that specifies each separate input.
  2. It would be good to allow multiline values in input lists for instance:
- command: |
  echo "Hello World"
  echo "Cloudslang is cool"

Not sure if this is allowed by yaml format, but it is worth the investigation.

  1. It would also be cool to establish inputs as maps (not sure if this is possible right now in cloudslang). I guess it would require the inputs to be entered as a map itself and not a list:

inputs:
   input_1: 
       key1: value1
       key2: value2
   input_2: "foo"

Thanks!

meirwah commented 8 years ago

Hi @rqc , Did you look at input file capability: http://cloudslang-docs.readthedocs.org/en/v0.8/cloudslang_cli/#run-with-inputs

And we support maps of imputs, take a look at : http://cloudslang-docs.readthedocs.org/en/v0.8/yaml_overview/#maps

@Bonczidai @oritstone you have in mind any map example in our content today?

levice14 commented 8 years ago

Hi @rqc , thanks for your feedback!

Some of my comments:

    - person_map: >
        {'john': 1, 'jane': 2, 'peter': 'three'}
oritstone commented 8 years ago

@rqc thanks for you feedback :)

rqc commented 8 years ago

@oritstone thank you for your team's help.

oritstone commented 8 years ago

Thanks @rqc It is a good idea to improve our CLI UX. We will definitely add it to our roadmap