ko1nksm / getoptions

An elegant option/argument parser for shell scripts (full support for bash and all POSIX shells)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No output from gengetoptions embed --overwrite example.sh

shinokada opened this issue · comments

image

I run the code from the documentation, but it doesn't embed code.

gengetoptions embed --overwrite example.sh

~/Sandbox/examples
cat example.sh

What am I doing wrong?

Please create the example.sh first.

An example of the example.sh.

#!/bin/sh

set -eu

# @getoptions
parser_definition() {
  setup   REST help:usage -- "Usage: example.sh [options]... [arguments]..." ''
  msg -- 'Options:'
  flag    FLAG    -f --flag                 -- "takes no arguments"
  param   PARAM   -p --param                -- "takes one argument"
  option  OPTION  -o --option on:"default"  -- "takes one optional argument"
  disp    :usage  -h --help
  disp    VERSION    --version
}
# @end

# @gengetoptions parser -i parser_definition parse
# 
#     INSERTED HERE
#
# @end

echo "FLAG: $FLAG, PARAM: $PARAM, OPTION: $OPTION"
printf '%s\n' "$@" # rest arguments

Fixed the documentation.