Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liquidz/corne
Commandline argument parser for Common Lisp
https://github.com/liquidz/corne
argument-parsing command-line-parser common-lisp subcommands
Last synced: 2 days ago
JSON representation
Commandline argument parser for Common Lisp
- Host: GitHub
- URL: https://github.com/liquidz/corne
- Owner: liquidz
- License: mit
- Created: 2017-05-25T22:16:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-04T09:16:42.000Z (over 7 years ago)
- Last Synced: 2024-11-08T09:50:58.706Z (about 2 months ago)
- Topics: argument-parsing, command-line-parser, common-lisp, subcommands
- Language: Common Lisp
- Homepage:
- Size: 50.8 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Corne
[![Build Status](https://travis-ci.org/liquidz/corne.svg?branch=master)](https://travis-ci.org/liquidz/corne)Commandline argument parser for Common Lisp
## Usage
```lisp
(in-package :cl-user)
(defpackage foo.bar
(:use :cl :corne))
(in-package :foo.bar)(defvar *cli*
(cmd "hello"
:help "corne example command"
:version "1.0"
:options (list (opt "verbose" :short "v" :long "verbose" :help ""))
:arguments (list (arg "msg" :help "message"))))(defun main (&rest argv)
(let* ((res (parse *cli* argv)))
(format t "hello ~A~%" (get-arg res "msg"))))
```More examples are [here](example).
## Features
### Auto help generation
```sh
$ ./example/hello.ros -h
hello 1.0
corne example commandUSAGE: hello [OPTIONS]
OPTIONS:
-v, --verbose
-h, --help Prints help informationARGUMENTS:
message
```
### Subcommand support
```
(defvar *cli*
(cmd "subcommand"
:help "corne example command"
:version "1.0"
:subcommands (list (cmd "foo" :help "foooo")
(cmd "bar" :help "baaar"
:subcommands (list (cmd "baz" :help "baaaz"))))))
```## Installation
* Corne is not registered [Quicklisp](https://www.quicklisp.org/beta/) yet.
* clone to your local-projects
```sh
# ex
git clone https://github.com/liquidz/corne ~/.roswell/local-projects
```
* register local project
```lisp
(ql:register-local-projects)
```