Wove pipe protocol
================================================================================

A front-end (wove-gui, a TUI, a web page behind a CGI...) runs

  wove --pipe

and talks to it with lines of text: the front-end writes on Wove's stdin,
Wove writes events on its stdout. One line is one message; fields are
separated by a TAB; a field never holds a TAB nor a newline. Texts are
already translated (gettext, from LANG of the wove process).


Wove -> front-end
--------------------------------------------------------------------------------

  hello   <version>                first line
  suggest <icon> <sentence>        things to offer before the first word
                                   (a button that sends the sentence)
  ready                            waiting for a sentence

  say     <text>                   a sentence for the user
  title   <text>                   a heading (what is about to happen)
  info    <text>                   a side note (dim)
  ok      <text>                   a success
  warn    <text>                   a warning
  error   <text>                   an error
  cmd     <command line>           a command Wove runs (technical detail)
  planhead <text>                  "This will run:", before the plan lines
  plan    <command line>           a command the next confirmation will run
                                   (technical detail)
  out     <line>                   output of the running command

  item    <value> <label> <detail> one choice, before "choose"
  choose  <prompt>                 answer: a value, its number, or "" to cancel
  ask     <prompt> <default>       answer: a line of text ("" = default)
  secret  <prompt>                 answer: a line of text, do not show it
  confirm <prompt>                 answer: y or n
  word    <prompt> <word>          answer: the word itself to go on (danger)

  done    <rc>                     the sentence is handled: 0 ok, 126
                                   cancelled, other = failure; "ready" follows


Front-end -> Wove
--------------------------------------------------------------------------------

After "ready": one sentence. After choose, ask, secret, confirm or word:
one answer line. "bye" or closing stdin ends Wove.


Root
--------------------------------------------------------------------------------

Wove runs as the user and asks root rights with sudo only when a tool
says it needs them. Without a terminal sudo cannot ask a password: give
an askpass helper in SUDO_ASKPASS (Wove then runs sudo -A), or a sudoers
rule. wove-gui sets SUDO_ASKPASS to itself (wove-gui --askpass shows a
password dialog and prints the answer).


Example
--------------------------------------------------------------------------------

  < hello	1.0
  < ready
  > mets le son à 40
  < title	Régler le volume
  < planhead	Ceci va lancer :
  < plan	amixer sset Master 40%
  < confirm	On y va ?
  > y
  < cmd	trame audio set '40'
  < out	Volume réglé : 40%
  < done	0
  < ready
