Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 7, 2024
1 parent 109a771 commit a21a150
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
12 changes: 0 additions & 12 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Thanks to Alessio Stalla!
## 0.12.0

* Added LispWorks support.

* Program name now evaluated at runtime instead of a compile-time.

<a id="x-28DEFMAIN-2FCHANGELOG-3A-3A-7C0-2E11-2E0-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>
Expand All @@ -43,7 +42,6 @@ can carry optional keyword arguments, such as

* Fixed subcommands for the case when a program was
compiled using `ASDF:MAKE`.

* Added more examples and improved documentation!

<a id="x-28DEFMAIN-2FCHANGELOG-3A-3A-7C0-2E10-2E0-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>
Expand All @@ -52,7 +50,6 @@ can carry optional keyword arguments, such as

* Moved documentation from reStructured readme to `40ANTS-DOC`
documentation builder.

* Added github actions for building docs, linting and testing.
Using [40ANTS-CI][3f72] generator.

Expand All @@ -61,9 +58,7 @@ can carry optional keyword arguments, such as
## 0.9.1

* Fixed work under `ABCL` and probably `CMUCL`.

* Help commands now exit with 0 status code.

* Fixed annoying banner about missing `CC` env variable.

<a id="x-28DEFMAIN-2FCHANGELOG-3A-3A-7C0-2E9-2E0-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>
Expand Down Expand Up @@ -94,7 +89,6 @@ qlot exec ros run -L sbcl -e '(asdf:make :work-hours)'
## 0.8.0

* Added support for positional arguments.

* Fixed issue of catching signals not inherited `error` and
handling them as errors by printing traceback and quitting.

Expand Down Expand Up @@ -181,7 +175,6 @@ Also, you can pass `NIL` as a value to disable short name:
* Fixed a way how `--help` option is processed. Now, this argument
can be redefined by user, for example, to give this option another
description.

* Now, if `:default "some string"` is given for option, then it will
be parsed as string. Previously, `lispobj` type was used to parse
value, and there were problems when you tried to pass as a value
Expand All @@ -192,7 +185,6 @@ Also, you can pass `NIL` as a value to disable short name:
## 0.2.0

* Added function [`defmain:print-help`][9b39].

* Fixed handling of existing `help` option. Now you can redefine it
to give another description.

Expand All @@ -201,13 +193,9 @@ Also, you can pass `NIL` as a value to disable short name:
## 0.1.0

* Number features here.

* Like that.

* Add new versions to the top.

* Specify dates as `2017-04-19`.

* Read [KeepAChangelog.com][eeaa] for futher
explanations.

Expand Down
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@
## DEFMAIN ASDF System Details

* Version: 0.12.1

* Description: A wrapper around net.didierverna.clon which makes command line arguments parsing easier.

* Licence: `BSD`

* Author: Alexander Artemenko

* Homepage: [https://40ants.com/defmain][a9ad]

* Bug tracker: [https://github.com/40ants/defmain/issues][defe]

* Source control: [GIT][26c5]
* Depends on: [40ants-doc][2c00], [alexandria][8236], [cl-inflector][0b66], [cl-strings][2ecb], [docs-config][ce67], [named-readtables][d0a9], [net.didierverna.clon.core][47d6], [pythonic-string-reader][c01d], [uiop][5274]


<table>
Expand Down Expand Up @@ -108,7 +103,7 @@ The main entry point for defining the main function for your program is the [`de

<a id="x-28DEFMAIN-3ADEFMAIN-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

### [macro](2964) `defmain:defmain` (name &key program-name) (&rest args) &body body
### [macro](134f) `defmain:defmain` (name &key program-name) (&rest args) &body body

This macro let you to define a main function for a command-line program.

Expand Down Expand Up @@ -178,7 +173,7 @@ to define additional subcommands using [`defcommand`][4b6c] macro:

<a id="x-28DEFMAIN-3ADEFCOMMAND-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29"></a>

#### [macro](171f) `defmain:defcommand` (parent name) (&rest args) &body body
#### [macro](94c8) `defmain:defcommand` (parent name) (&rest args) &body body

This macro is similar to [`defmain`][4130] macro in terms of arguments and body processing.

Expand All @@ -187,7 +182,6 @@ list of two names:

* First element should be the name of the parent function.
It can be either a main entry-point or other subcommand.

* Second element is a symbol to name the subcommand.

Here is an example with of a program with two subcommands.
Expand Down Expand Up @@ -234,29 +228,29 @@ When writing more complex logic, these helpers could be useful:

<a id="x-28DEFMAIN-3APRINT-HELP-20FUNCTION-29"></a>

#### [function](a4c7) `defmain:print-help`
#### [function](10b9) `defmain:print-help`

Outputs to stdout a help about command line utility.

<a id="x-28DEFMAIN-3APRINT-COMMANDS-HELP-20FUNCTION-29"></a>

#### [function](5732) `defmain:print-commands-help`
#### [function](1cd9) `defmain:print-commands-help`

Outputs information about supported subcommands.

It should be called from the function defined with [`defmain`][4130] macro.

<a id="x-28DEFMAIN-3AGET-SUBCOMMAND-NAME-20FUNCTION-29"></a>

#### [function](36dd) `defmain:get-subcommand-name`
#### [function](95b2) `defmain:get-subcommand-name`

Returns a string with current subcommand's name.

It should be called from the function defined with [`defmain`][4130] macro.

<a id="x-28DEFMAIN-3ASUBCOMMAND-20FUNCTION-29"></a>

#### [function](f2ab) `defmain:subcommand`
#### [function](aa7a) `defmain:subcommand`

Executes the current subcommand. It is called automatically at the end of the
main body unless you call it manually.
Expand All @@ -268,9 +262,7 @@ It can be called from the function defined with [`defmain`][4130] macro.
## Roadmap

* Make better support for integer arguments.

* Support more types of arguments, like filepathes and enums.

* Raise error when two short options are identical during
macro-expansion, not during runtime. Right now the `clon`
checks this during runtime:
Expand Down Expand Up @@ -308,14 +300,23 @@ Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING
[4130]: https://40ants.com/defmain/#x-28DEFMAIN-3ADEFMAIN-20-2840ANTS-DOC-2FLOCATIVES-3AMACRO-29-29
[98fc]: https://40ants.com/defmain/#x-28DEFMAIN-3ASUBCOMMAND-20FUNCTION-29
[26c5]: https://github.com/40ants/defmain
[5732]: https://github.com/40ants/defmain/blob/6345393bacc05663a60a6617aa715a44a91bae2b/src/defmain.lisp#L482
[36dd]: https://github.com/40ants/defmain/blob/6345393bacc05663a60a6617aa715a44a91bae2b/src/defmain.lisp#L489
[f2ab]: https://github.com/40ants/defmain/blob/6345393bacc05663a60a6617aa715a44a91bae2b/src/defmain.lisp#L496
[2964]: https://github.com/40ants/defmain/blob/6345393bacc05663a60a6617aa715a44a91bae2b/src/defmain.lisp#L589
[171f]: https://github.com/40ants/defmain/blob/6345393bacc05663a60a6617aa715a44a91bae2b/src/defmain.lisp#L828
[a4c7]: https://github.com/40ants/defmain/blob/6345393bacc05663a60a6617aa715a44a91bae2b/src/defmain.lisp#L888
[1cd9]: https://github.com/40ants/defmain/blob/109a771b1ab4804d87f7b7259b0b20cd4cecc5e2/src/defmain.lisp#L482
[95b2]: https://github.com/40ants/defmain/blob/109a771b1ab4804d87f7b7259b0b20cd4cecc5e2/src/defmain.lisp#L489
[aa7a]: https://github.com/40ants/defmain/blob/109a771b1ab4804d87f7b7259b0b20cd4cecc5e2/src/defmain.lisp#L496
[134f]: https://github.com/40ants/defmain/blob/109a771b1ab4804d87f7b7259b0b20cd4cecc5e2/src/defmain.lisp#L589
[94c8]: https://github.com/40ants/defmain/blob/109a771b1ab4804d87f7b7259b0b20cd4cecc5e2/src/defmain.lisp#L828
[10b9]: https://github.com/40ants/defmain/blob/109a771b1ab4804d87f7b7259b0b20cd4cecc5e2/src/defmain.lisp#L888
[defe]: https://github.com/40ants/defmain/issues
[da87]: https://github.com/didierverna/clon
[2c00]: https://quickdocs.org/40ants-doc
[8236]: https://quickdocs.org/alexandria
[0b66]: https://quickdocs.org/cl-inflector
[2ecb]: https://quickdocs.org/cl-strings
[ce67]: https://quickdocs.org/docs-config
[d0a9]: https://quickdocs.org/named-readtables
[47d6]: https://quickdocs.org/net.didierverna.clon.core
[c01d]: https://quickdocs.org/pythonic-string-reader
[5274]: https://quickdocs.org/uiop

* * *
###### [generated by [40ANTS-DOC](https://40ants.com/doc/)]

0 comments on commit a21a150

Please sign in to comment.