chickadee » tick » define-command

define-command command usage procprocedure

Define a command that can then be used as a tick command on the command line.

command is a symbol naming the command.

usage is a string that will be printed as help message of command, when requested through the command line via any of the help-request options (-h, -help or --help).

proc is a one-argument procedure which will receive the arguments given to the command on the command line.

Example:

(import (chicken string))
(import commands)

(define-command 'hello
  "hello
    Print `hello' followed the arguments passed to this command"
  (lambda (args)
    (print "hello " (string-intersperse args))))