'use strict'

/*
 * adonis-ace
 *
 * (c) Harminder Virk <virk@adonisjs.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
*/

const kernel = require('../src/kernel')

kernel.command(
  'greet {name?: Enter the name of the person you want to greet}',
  'Greet a user',
  async function ({ name }) {
    const validateName = function (input) {
      return !input ? 'Enter your name' : true
    }
    name = name || await this.on('validate', validateName).ask('Can u share your name')
    this.success(`Hello ${name}`)
  }
)

kernel.wireUpWithCommander()
kernel.invoke()

@@ -324,16 +324,31 @@
 o greet%7D
+ %7B --is-admin %7D
 ',%0A  'Gr
@@ -386,24 +386,51 @@
 %7B name %7D) %7B%0A
+    console.log(arguments)%0A
     const va

use command.opts() over command._events