module Inquirer::Console

Overview

Provides Inquirer with standardized style & utilities for printing stuff on the screen.

Extended Modules

Defined in:

inquirer/console.cr

Constant Summary

COLUMNS = (`tput cols`).to_i? || 80

The amount of columns in the terminal.

Instance Method Summary

Macro Summary

Instance Method Detail

def done(message : String) #

Displays a done plaque followed by message.

Returns nothing.


[View source]
def error(message : String) #

Displays an error plaque followed by message.

Returns nothing.


[View source]
def exit(status : Int32, message : String) #

Calls #error(message) and exits with the given status.


[View source]
def log(message : String) #

Displays a log plaque followed by message.

Returns nothing.


[View source]
def overwrite(message : String) #

Stacks the given message on top of an #update.


[View source]
def quit(with message : String) #

Prints the given message and exits with status 0.


[View source]
def update(message : String) #

Prints the given message so that the next call, it changes in-place.

Returns the carriage to the start of the line, clears the line, and prints message with no trailing newline.

Cuts off message if it doesn't fit (see COLUMNS).

Returns nothing.


[View source]

Macro Detail

macro comment(before, after, given) #

Returns given, logging message before beforehand and message after afterwards.


[View source]