Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the duologue Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 13:21:09 2020 GMT+0.
• Introduction | What duologue is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Duologue is high-level interaction library for Common Lisp. Command line interaction is implemented at the moment. It features coloured printing via cl-ansi-text and readline completion.
(&optional (msg "Yes or no: ") &key (default nil default-p) if-wrong-answer
(color *prompt-color*) (error-color *prompt-error-color*))
Ask for yes or no.
(msg options &key if-wrong-option default (print-options t) (separator "~%")
complete completer (color *prompt-color*) (error-color *prompt-error-color*))
Asks the user to choose one of the given options.
Example:
(choose "Choose: " (list "foo" "bar" "baz") :default "baz")
Tags: menu, choose
(msg options &key if-wrong-option default (print-options t) (separator "~%")
complete completer (test #'eql) (color *prompt-color*)
(error-color *prompt-error-color*))
Asks the user to choose many of the given options.
Example:
(choose-many "Choose: " (list "foo" "bar" "baz") :default "baz")
Tags: menu, choose
(options)
Makes a default completer from a list of options
(&optional msg &key (default nil default-p) (required-p t) validator if-invalid
parser completer (color *prompt-color*) (error-color *prompt-error-color*))
Prompt for a string.
(&optional msg &key default (required-p t) if-invalid (color *prompt-color*)
(error-color *prompt-error-color*))
Prompts for a timestamp.
Returns: the parsed local-time
The input is parsed with chronicity library and transformed to a local-time. The input is validated and the process does not stop until the user enters a valid timestamp address.
(&optional msg &key default (required-p t) if-invalid (color *prompt-color*)
(error-color *prompt-error-color*))
Prompts for an email.
Returns: the entered email
The email is validated and the process does not stop until the user enters a valid email address.
(&optional msg &key default (required-p t) if-invalid (color *prompt-color*)
(error-color *prompt-error-color*))
Prompts for an integer.
Returns: the entered number
(&optional msg &key default (required-p t) if-invalid (color *prompt-color*)
(error-color *prompt-error-color*) probe if-exists (if-does-not-exist :error)
absolute-p file-type directory-p (complete t))
Prompts for a pathname.
(&optional msg &key default (required-p t) if-invalid (color *prompt-color*)
(error-color *prompt-error-color*) probe if-exists (if-does-not-exist :error))
Prompts for an url.
Returns: the entered url
(datum &rest args)
Prints a message on the screen.
A newline is printed iff either newline parameter is T or datum doesn't end with a space. That is, if datum ends in a space, then no newline is printed.
Example:
(say "Hello ~A" "John" :color :blue)
Categories: printing Tags: printing
(msg (&rest options) &body body)
Asks to repeat a task several times and collects its result.
Returns: A list of collected task results
Example: ```lisp (while "Add item?: " (:default t) (prompt "Item: "))
**Tags**: flow
## Generic-Functions
## Slot-Accessors
## Variables
## Classs
## Conditions
## Constants
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The duologue system |
Mariano Montone <marianomontone@gmail.com>
MIT
High-level user interaction library for Common Lisp
duologue.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The duologue.asd file | ||
• The duologue/package.lisp file | ||
• The duologue/duologue.lisp file |
Next: The duologue/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
duologue.asd
duologue (system)
Next: The duologue/duologue․lisp file, Previous: The duologue․asd file, Up: Lisp files [Contents][Index]
Previous: The duologue/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
duologue (system)
duologue.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The duologue package |
High-level interaction library for Common Lisp
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Asks to repeat a task several times and collects its result.
Args: - msg: The thing to ask to confirm the task
- options: Options of the ask operation
- body: The task to execute while the user confirms it.
Returns: A list of collected task results
Example:
“(while "Add item?: " (:default t)
(prompt "Item: "))“
Tags: flow
duologue.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
Ask for yes or no.
Args: - msg(string): The prompt to use. Default: ’Yes or no: ’.
- default: Default value. It gets selected if the user enters the empty string. Default: nil.
- if-wrong-answer(function): Function to execute if a wrong answer is given.
- color: Prompt color.
- error-color: Prompt error color.
duologue.lisp (file)
Asks the user to choose one of the given options.
Args: - msg(string): The prompt message.
- options(list): The list of options the user can choose from.
- if-wrong-option(function): When present, this function is run if the user enters a wrong option. Default: nil.
- default: The default value. The default value is selected if the user just hits the ENTER key. Default: nil.
- print-options(boolean): Print the options on the screen. Default: T.
- separator(string): Separation string to use when printing the options. Default: ’~%’
- complete: If T, then readline completion is enabled. Default: nil.
- completer: A custom completer. If NIL, then the default completer is used.
- color: Color to use at prompt. Default: *prompt-color*
- error-color: Color to use when error ocurrs. Default: *prompt-error-color*
Example:
“(choose "Choose: " (list "foo" "bar" "baz") :default "baz")“
Tags: menu, choose
duologue.lisp (file)
Asks the user to choose many of the given options.
Args: - msg(string): The prompt message.
- options(list): The list of options the user can choose from.
- if-wrong-option(function): When present, this function is run if the user enters a wrong option. Default: nil.
- default: The default value. The default value is selected if the user just hits the ENTER key. Default: nil.
- print-options(boolean): Print the options on the screen. Default: T.
- separator(string): Separation string to use when printing the options. Default: ’~%’
- complete: If T, then readline completion is enabled. Default: nil.
- completer: A custom completer. If NIL, then the default completer is used.
- color: Color to use at prompt. Default: *prompt-color*
- error-color: Color to use when error ocurrs. Default: *prompt-error-color*
Example:
“(choose-many "Choose: " (list "foo" "bar" "baz") :default "baz")“
Tags: menu, choose
duologue.lisp (file)
Makes a default completer from a list of options
duologue.lisp (file)
Prompt for a string.
Args: - msg: The prompt.
- default: Default value. This is returned if the user enters the empty string. Default: nil.
- required-p(boolean): If T, then the empty string is not allowed as a valid input, and the user is asked again for input. Default: t.
- validator(function): A function to use to validate the input. Should return T if the input is valid, or NIL otherwise.
- if-invalid(function): Function to execute if the validator fails.
- parser (function): A function to parse the input string.
- completer: A custom completer. Default: no completion.
- color: Prompt color
- error-color: Prompt error color.
duologue.lisp (file)
Prompts for a timestamp.
Args: - msg: The prompt.
- default: Default value. This is returned if the user enters the empty string. Default: nil.
- required-p(boolean): If T, then the empty string is not allowed as a valid input, and the user is asked again for input. Default: t.
- if-invalid(function): Function to execute if the validator fails.
- color: Prompt color
- error-color: Prompt error color.
Returns: the parsed local-time
The input is parsed with chronicity library and transformed to a local-time.
The input is validated and the process does not stop until the user enters a valid timestamp address.
duologue.lisp (file)
Prompts for an email.
Args: - msg: The prompt.
- default: Default value. This is returned if the user enters the empty string. Default: nil.
- required-p(boolean): If T, then the empty string is not allowed as a valid input, and the user is asked again for input. Default: t.
- if-invalid(function): Function to execute if the validator fails.
- color: Prompt color
- error-color: Prompt error color.
Returns: the entered email
The email is validated and the process does not stop until the user enters a valid email address.
duologue.lisp (file)
Prompts for an integer.
Args: - msg: The prompt.
- default: Default value. This is returned if the user enters the empty string. Default: nil.
- required-p(boolean): If T, then the empty string is not allowed as a valid input, and the user is asked again for input. Default: t.
- if-invalid(function): Function to execute if the validator fails.
- color: Prompt color
- error-color: Prompt error color.
Returns: the entered number
duologue.lisp (file)
Prompts for a pathname.
Args: - msg: The prompt.
- default: Default value. This is returned if the user enters the empty string. Default: nil.
- required-p(boolean): If T, then the empty string is not allowed as a valid input, and the user is asked again for input. Default: t.
- if-invalid(function): Function to execute if the validator fails.
- color: Prompt color
- error-color: Prompt error color.
- complete: If T, then uses readline path completion. Default: T.
- probe. If T, checks that the file exists on the filesystem.
- if-exists: Function to call if the probe is successful.
- if-does-not-exist(keyword): One of:
* :error : Tries again until the pathname can be accessed.
* :warn : Warns the user the pathname could not be accessed and asks for continuing.
* :warn-and-continue: Warns the user the pathname could not be accessed and continues.
duologue.lisp (file)
Prompts for an url.
Args: - msg: The prompt.
- default: Default value. This is returned if the user enters the empty string. Default: nil.
- required-p(boolean): If T, then the empty string is not allowed as a valid input, and the user is asked again for input. Default: t.
- if-invalid(function): Function to execute if the validator fails.
- color: Prompt color
- error-color: Prompt error color
- probe(boolean): If T, then url is accessed and verified.
- if-exists(function): A function to call if the url exists (can be accessed).
- if-does-not-exist(keyword): One of:
* :error : Tries again until the url can be accessed.
* :warn : Warns the user the url could not be accessed and asks for continuing.
* :warn-and-continue: Warns the user the url could not be accessed and continues.
Returns: the entered url
duologue.lisp (file)
Prints a message on the screen.
Args: - datum(string): A format like string.
- args: Format arguments or :color, :newline options
- color(keyword): An ansi-text color. One of ansi-colors (.i.e :red, :green, :yellow)
- newline(boolean): If t, forces a newline after printing
A newline is printed iff either newline parameter is T or datum doesn’t end with a space. That is, if datum ends in a space, then no newline is printed.
Example:
“(say "Hello ~A" "John" :color :blue)“
Categories: printing
Tags: printing
duologue.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
The default prompt color.
duologue.lisp (file)
The default error color
duologue.lisp (file)
Previous: Internal special variables, Up: Internal definitions [Contents][Index]
duologue.lisp (file)
duologue.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | D F L |
---|
Jump to: | D F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | A C F M P R S W |
---|
Jump to: | A C F M P R S W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | D P S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
D | |||
duologue : | The duologue system | ||
duologue : | The duologue package | ||
| |||
P | |||
Package, duologue : | The duologue package | ||
| |||
S | |||
System, duologue : | The duologue system | ||
|
Jump to: | D P S |
---|