Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1nksm committed May 2, 2021
1 parent d66076d commit ef914fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- getoptions: Make the parser name optional

## [3.2.0] - 2021-04-30

### Added
Expand Down
9 changes: 5 additions & 4 deletions docs/References.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
This function is, to be exact, an option parser generator.
An option parser is defined by `eval` the generated code.

`getoptions <parser_definition> <parser_name> [arguments]...`
`getoptions <definition> [<parser|-> [arguments]...]`


- parser_definition - Option parser definition
- parser_name - Function name for option parser
Expand All @@ -46,8 +47,8 @@ parse "$@" # Option parsing
eval "set -- $REST" # Exclude options from arguments
```

If you use `-` as the option parser name, it will define the default option parser
and parse the arguments directly.
If you omit the option parser name or use `-`, it will define the default option
parser and parse arguments immediately.

```sh
parser_definition() {
Expand Down Expand Up @@ -76,7 +77,7 @@ automatically by the `help` attribute of `getoptions`, but you can also call it
The function to display help does not necessarily need to be generated by `getoptions_help`.
Since it is just a function, you may define your own shell function.

`getoptions_help <parser_definition> <help_name> [arguments...]`
`getoptions_help <definition> <help> [arguments...]`

- parser_definition - Option parser definition
- help_name - Function name for help display
Expand Down

0 comments on commit ef914fa

Please sign in to comment.