1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-01 19:22:41 +01:00
phorge-arcanist/support
epriestley df2c1ba912 [Wilds] Provide a skeleton for prompt behaviors
Summary:
Ref T13098. Ref T13198. Ref T12996. The major ideas here are:

Workflows must define a list of all the prompts they can raise, so that these prompts can be enumerated with `arc prompts <workflow>`.

Prompts themselves should respond properly to ^C (abort immediately) and we should be able to make them nonblocking in the future (particularly, we'd like to be able to continue reading bytes from subprocess buffers while the prompt is shown on screen).

This doesn't have a lot of fancy features yet (non-confirm prompts, default yes, prompts which don't abort on "N", etc) but those should be easy to add later.

In the future, you'll be able to configure a default answer to prompts either in a config file or at runtime with `--config prompts=x.y.z=N` or similar.

This removes the history/readline mode for prompts, where you could use the up arrow to cycle through older responses. I believe this was only really useful for "excuse" prompts and intend to remove those.

Test Plan:
Forced `arc shell-complete` to always prompt, then:

  - Got prompted, answered "y", "n", "N", "", "quack". Got sensible behavior in all cases.
  - Ran `echo | arc shell-complete`, got a TTY error.
  - Ran `arc prompts`, `arc prompts shell-complete`.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13098, T13198, T12996

Differential Revision: https://secure.phabricator.com/D19706
2018-09-26 14:08:49 -07:00
..
parser [Wilds] Remove libphutil 2018-09-21 16:38:53 -07:00
shell [Wilds] Shell complete files with spaces in them correctly 2018-09-25 16:15:51 -07:00
xhpast [Wilds] Remove libphutil 2018-09-21 16:38:53 -07:00
ArcanistRuntime.php [Wilds] Provide a skeleton for prompt behaviors 2018-09-26 14:08:49 -07:00