@cli.command()
def menu():
    'Shows a simple menu.'
    menu = 'main'
    while 1:
        if (menu == 'main'):
            click.echo('Main menu:')
            click.echo('  d: debug menu')
            click.echo('  q: quit')
            char = click.getchar()
            if (char == 'd'):
                menu = 'debug'
            elif (char == 'q'):
                menu = 'quit'
            else:
                click.echo('Invalid input')
        elif (menu == 'debug'):
            click.echo('Debug menu')
            click.echo('  b: back')
            char = click.getchar()
            if (char == 'b'):
                menu = 'main'
            else:
                click.echo('Invalid input')
        elif (menu == 'quit'):
            return
Shows a simple menu.
@cli.command()
def menu():
    
    menu = 'main'
    while 1:
        if (menu == 'main'):
            click.echo('Main menu:')
            click.echo('  d: debug menu')
            click.echo('  q: quit')
            char = click.getchar()
            if (char == 'd'):
                menu = 'debug'
            elif (char == 'q'):
                menu = 'quit'
            else:
                click.echo('Invalid input')
        elif (menu == 'debug'):
            click.echo('Debug menu')
            click.echo('  b: back')
            char = click.getchar()
            if (char == 'b'):
                menu = 'main'
            else:
                click.echo('Invalid input')
        elif (menu == 'quit'):
            return