diff --git a/argparse.bash b/argparse.bash index 25f935e..e54dc7d 100755 --- a/argparse.bash +++ b/argparse.bash @@ -28,7 +28,8 @@ class MyArgumentParser(argparse.ArgumentParser): sys.exit(1) parser = MyArgumentParser(prog=os.path.basename("$0"), - description="""$ARGPARSE_DESCRIPTION""") + description="""$ARGPARSE_DESCRIPTION""", + epilog="""$ARGPARSE_EPILOG""") EOF # stdin to this function should contain the parser definition diff --git a/example.sh b/example.sh index 128cb09..33f5802 100755 --- a/example.sh +++ b/example.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash ARGPARSE_DESCRIPTION="Sample script description" # this is optional -source $(dirname $0)/argparse.bash || exit 1 +ARGPARSE_EPILOG="This is the epilog." # this is optional +# shellcheck source=/Users/aberezin/apps/argparse.bash +source "$ARGPARSE_PATH" || exit 1 +#optional way to plave src file: source $(dirname $0)/argparse.bash || exit 1 argparse "$@" <