more changes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-07-29 22:35:55 +03:00
parent 236e62b4f6
commit df9f0f89ee
2 changed files with 55 additions and 55 deletions

View File

@ -5,7 +5,7 @@ This file will cover the usage, contents and configuration topics in more detail
## Basics ## Basics
For basics see README.md For basics see [README.md](./README.md)
## Contents ## Contents

View File

@ -259,14 +259,14 @@ And for quick-n-dirty hacking stuff together, a shorthand (_not for production_)
To stop option processing either return `STOP` or `THEN`. To stop option processing either return `STOP` or `THEN`.
- `THEN` is the normal case, stop processing and trigger [`<parser>.then(..)`](#parserthen): - `THEN` is the normal case, stop processing and trigger [`<parser>.then(..)`](./ADVANCED.md#parserthen):
```javascript ```javascript
'-then': { '-then': {
handler: function(){ handler: function(){
return argv.THEN } }, return argv.THEN } },
``` ```
- `STOP` will stop processing and trigger [`<parser>.stop(..)`](#parserstop): - `STOP` will stop processing and trigger [`<parser>.stop(..)`](./ADVANCED.md#parserstop):
```javascript ```javascript
'-stop': { '-stop': {
handler: function(){ handler: function(){
@ -285,7 +285,7 @@ There are three ways to stop and/or report errors:
throw argv.ParserError('something went wrong.') } }, throw argv.ParserError('something went wrong.') } },
``` ```
Here the error will be reported automatically after processing has stopped Here the error will be reported automatically after processing has stopped
but before [`<parser>.error(..)`](#parsererror-1) is triggered. but before [`<parser>.error(..)`](./ADVANCED.md#parsererror-1) is triggered.
- _Silently_ `return` a `ParserError(..)` instance: - _Silently_ `return` a `ParserError(..)` instance:
```javascript ```javascript
@ -294,7 +294,7 @@ There are three ways to stop and/or report errors:
return argv.ParserError('something went wrong.') } }, return argv.ParserError('something went wrong.') } },
``` ```
This will _not_ report the error but will stop processing and trigger This will _not_ report the error but will stop processing and trigger
[`<parser>.error(..)`](#parsererror-1), so the user can either recover [`<parser>.error(..)`](./ADVANCED.md#parsererror-1), so the user can either recover
from or report the issue manually. from or report the issue manually.
- For a critical error simply `throw` any other JavaScript error/exception: - For a critical error simply `throw` any other JavaScript error/exception:
@ -307,7 +307,7 @@ There are three ways to stop and/or report errors:
}) })
``` ```
Also see: [`<parser>.printError(..)`](#parserprint--parserprinterror) Also see: [`<parser>.printError(..)`](./ADVANCED.md#parserprint--parserprinterror)
### Usage examples ### Usage examples
@ -330,7 +330,7 @@ $ ./script.js -fb
## In detail ## In detail
For a more detailed set of docs see ADVANCED.md For a more detailed set of docs see [ADVANCED.md](./ADVANCED.md)
## More... ## More...