phansch / questionnaire

A terminal program (not library) to ask questions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

questionnaire

A program to ask questions on the command line and collect the results in JSON files. Questions and answers are defined in a JSON file. The Results are collected in a JSON file as well.

This is not a library.

Usage

questionnaire questions.json

Where questions.json has to have the following structure:

[
    {
        "name": "An identifier for the question",
        "prompt": "The actual question",
        "answer": {
            "kind": "see below",
            "choices": [0, 1, 2, 3]
        }
    }
]

answer.kind can be one of the following:

  • select will ask the user to select something from a given set of options, defined in answer.choices.
  • input will ask for basic text
  • editor will open the $EDITOR to enter text
[
    {
        "name": "some_identifier",
        "prompt": "The actual question",
        "answer": {
            "kind": "select",
            "choices": [0, 1, 2, 3]
        }
    },
    {
        "name": "some_identifier",
        "prompt": "The actual question",
        "answer": {
            "kind": "input"
        }
    },
    {
        "name": "some_identifier2",
        "prompt": "The actual question",
        "answer": {
            "kind": "editor"
        }
    }
]

Release process

Use cargo release to release a new version. This will push a new git tag and trigger the appropriate GitHub Action workflow that in turn uploads a release artifiact.

About

A terminal program (not library) to ask questions


Languages

Language:Rust 100.0%