Commit 38b0469c authored by lukas.burgey's avatar lukas.burgey

Make stub script use questionnaire_answers

parent 30fe01eb
...@@ -13,10 +13,6 @@ import ( ...@@ -13,10 +13,6 @@ import (
"gopkg.in/alecthomas/kingpin.v2" "gopkg.in/alecthomas/kingpin.v2"
) )
const (
version = "0.2.0"
)
var ( var (
httpClient = &http.Client{} httpClient = &http.Client{}
app = kingpin.New( app = kingpin.New(
...@@ -68,8 +64,18 @@ func questionnaire(input scripts.Input) (output scripts.Output, err error) { ...@@ -68,8 +64,18 @@ func questionnaire(input scripts.Input) (output scripts.Output, err error) {
output.State = scripts.Questionnaire output.State = scripts.Questionnaire
output.Msg = "I need some answers" output.Msg = "I need some answers"
output.Questionnaire = map[string]string{ output.Questionnaire = map[string]string{
"Question-Foo": "Description of question foo", "question_name": "This is markdown!\\n#\\nOr is it?\\n - Option a\\n - Option B\\n",
"Question-Bar": "Description of question bar", "age_question": "How old are you?",
"list_question": "Who are you?",
"list_question_2": "How many do you want?",
"are_you_sure": "What you are trying is wrong. Are you sure?",
}
output.QuestionnaireAnswers = map[string]interface{}{
"question_name": "question", // string default value
"age_question": 18, // age_question must be an integer, defaulting to 18
"list_question": []string{"person_a", "person_b"}, // list_question must be one of the listed options
"list_question_2": []int{1, 2}, // list_question_2 must be one of the listed options
"are_you_sure": false, // are_you_sure must be a boolean, with false being the default value
} }
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment