Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1nksm committed Nov 17, 2020
1 parent 1ad2097 commit 2ade58b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@
An elegant option parser and generator for shell scripts (sh, bash and all POSIX shells)

getoptions is a new option parser and generator released in 2020.
It's simple, easy-to-use, fast, small, flexible, extensible, portable and POSIX compliant. No more any loops and templates needed!

- [getoptions.sh](./lib/getoptions.sh) - base module
- [getoptions_abbr.sh](./lib/getoptions_abbr.sh) - abbreviation option module (add-on)
- [getoptions_help.sh](./lib/getoptions_help.sh) - help module (add-on)
It's simple, easy-to-use, fast, small, flexible, extensible, portable and POSIX compliant.
No more any loops and templates needed!

## Table of Contents <!-- omit in toc -->

- [Requirements](#requirements)
- [Comparison](#comparison)
- [with other implementations](#with-other-implementations)
- [`getopt` vs `getopts` vs `getoptions`](#getopt-vs-getopts-vs-getoptions)
- [Installation](#installation)
- [Requirements](#requirements)
- [Usage](#usage)
- [Basic](#basic)
- [Subcommand](#subcommand)
Expand Down Expand Up @@ -52,11 +49,6 @@ It's simple, easy-to-use, fast, small, flexible, extensible, portable and POSIX
- [Changelog](#changelog)
- [License](#license)

## Requirements

- No requirements for option parsing (POSIX shell only)
- `cat` is required for optional automatic help generation

## Comparison

### with other implementations
Expand Down Expand Up @@ -130,8 +122,17 @@ git clone https://github.com/ko1nksm/getoptions.git
Copy the necessary files under the [lib](lib) directory to your project or
use the code generated by the `bin/getoptions` command in your project.

## Requirements

- No requirements for option parsing (POSIX shell only)
- `cat` is required for optional automatic help generation

## Usage

- [getoptions.sh](./lib/getoptions.sh) - Base module
- [getoptions_abbr.sh](./lib/getoptions_abbr.sh) - Abbreviation option module (add-on)
- [getoptions_help.sh](./lib/getoptions_help.sh) - Automatic help generation module (add-on)

### Basic

```sh
Expand Down Expand Up @@ -200,10 +201,10 @@ sample/advanced.sh --help
See [advanced.sh](sample/advanced.sh)
getoptions was originally developed to improve the maintainability and testability for [ShellSpec][shellspec]
which has number of options. [ShellSpec usage][shellspec_usage] is another good example of how to use getoptions.
which has number of options. [ShellSpec optparser][optparser] is another good example of how to use getoptions.
[shellspec]: https://shellspec.info/
[shellspec_usage]: https://github.com/shellspec/shellspec/tree/master/lib/libexec/optparser
[optparser]: https://github.com/shellspec/shellspec/tree/master/lib/libexec/optparser
### Extension
Expand Down Expand Up @@ -244,7 +245,7 @@ bin/getoptions --indent=2 --shellcheck sample/parser_definition.sh parser prog
<details>
<summary>generated code</summary>
```
```sh
# shellcheck shell=sh
# Generated by getoptions (BEGIN)
# URL: https://github.com/ko1nksm/getoptions (2.3.0)
Expand Down Expand Up @@ -392,6 +393,7 @@ GETOPTIONSHERE
}
# Generated by getoptions (END)
```
</details>
## NOTE: 2.x breaking changes
Expand Down

0 comments on commit 2ade58b

Please sign in to comment.