Config file for patterns? #21
Closed
CalebCloud
started this conversation in
Ideas
Replies: 1 comment
-
|
No. I don't know exactly what you mean by a configuration file, but I think a shell script file will suffice. See parser_definition.sh and the usage example below. It is declarative enough, and is a more flexible shell script than a configuration file. #!/bin/sh
set -eu
VERSION=0.1
. ./lib/getoptions.sh
. ./lib/getoptions_help.sh
. ./lib/getoptions_abbr.sh
. ./examples/parser_definition.sh
# Define the parse function for option parsing
eval "$(getoptions parser_definition parse "$0")"
parse "$@" # Option parsing
eval "set -- $REST" # Exclude options from arguments
echo "FLAG: $FLAG"
echo "VERBOSE: $VERBOSE"
echo "PARAM: $PARAM"
echo "OPTION: $OPTION"
echo "VERSION: $VERSION" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any support to read the patterns from a configuration file?
Genuinely an incredible library that has simplified menus in any shell script I make from here on out.
Beta Was this translation helpful? Give feedback.
All reactions