2017 © Pedro Peláez
 

library z-plugin-interact

Console interaction plugin for Z

image

zicht/z-plugin-interact

Console interaction plugin for Z

  • Thursday, January 26, 2017
  • by muhammedeminakbulut
  • Repository
  • 0 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 14 % Grown

The README.md

z plugin for user interaction

This plugin provides a few user interaction utilities implemented using the 'dialog helper' from Symfony., (*1)

Examples:

Ask a user for confirmation

plugins: ['interact']

tasks:
    test:
        - @(if confirm("Are you sure?")) echo "OK, I will..."

Ask a user to choose between a few options

It's very easy to supply defaults with Z, which will ask the user if it wasn't supplied on the command line. See this example which uses env and interact together:, (*2)

plugins: ['interact', 'env']


envs:
    production:
        ssh: user@production
    testing:
        ssh: user@production

tasks:
    ssh:
        args:
            target_env: ? choose("Where do you want to go?", keys envs)
        do: @env.ssh

This will result in a list of options being displayed:, (*3)

$ z --explain ssh
[0] production
[1] testing
Where do you want to go?: 1
NOTICE: interactive shell:
( /bin/bash -c 'ssh -tq user@testing "cd ; bash --login"' )

Ask a user for text input

plugins: ['interact']

tasks:
    test:
        set:
            name: ask("What is your name?", USER)
        do: echo "Hello $(name), my name is `uname`"

Running this:, (*4)

$ z test
What is your name? [gerard]: 
Hello gerard, my name is Linux

Maintainer(s)

The Versions

26/01 2017

dev-master

9999999-dev

Console interaction plugin for Z

  Sources   Download

MIT

by Gerard van Helden

07/04 2016

1.0.0

1.0.0.0

Console interaction plugin for Z

  Sources   Download

MIT

by Gerard van Helden