Skip to content

A terminal program (not library) to ask questions

Notifications You must be signed in to change notification settings

phansch/questionnaire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages