bothub-studio / bothub-cli

CLI tool for BotHub.Studio service
https://bothub.studio
Other
10 stars 2 forks source link

Set properties from file or stdin #10

Open toracle opened 6 years ago

toracle commented 6 years ago

For now, an user can set a project property with command line like this: bothub property set a_key a_value.

For some cases, a JSON can be used for value and the JSON string should escape every ", so cumbersome.

bothub property set menu "{\"Watermelon Juice\": {\"description\": \"Made by a watermelon.\", \"price\": 5000}, \"Melon Juice\": {\"description\": \"Made by a melon.\", \"price\": 4500}, \"Strawberry Juice\": {\"description\": \"Made by strawberry.\", \"price\": 3500}, \"Orange Juice\": {\"description\": \"Made by an orange.\", \"price\": 3000}, \"Kiwifruit Juice\": {\"description\": \"Made by a Kiwifruit.\", \"price\": 3800}}"

So it would be useful if an user can set a property value from file or stdin. An user can execute CLI without value, and enter value to prompt, or use --file option to specify a data file.

arun-company commented 6 years ago

Usage: bothub property set [KEY] [VALUE] --file [file_path] There are some cases : user given: 1) - KEY, Value and File => Priority only KEY and Value have been set to the project. 2) - KEY, File => Property set fill be {KEY:FILE_DATA} 3) - KEY => show the prompt to request the VALUE 4) - File => File Data will be set as the Project Properties 5) - No-Input => show Prompt for KEY and VALUE. These is the flow case of the bothub property set