shflags
shflags copied to clipboard
DEFINE_list
Locally, I added code so you can define a List. So basically you can do:
`source shflags
Define flags
DEFINE_string 'name' 'world' 'Name to greet' 'n' DEFINE_boolean 'verbose' false 'Enable verbose output' 'v' DEFINE_list 'files' 'file1,file2' 'Files to process' 'f'
Parse command line arguments
FLAGS "$@" || exit $?
Use the flags
echo "Hello, ${FLAGS_name}!" if [[ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]]; then echo "Verbose mode enabled" fi
echo "Files to Process: ${FLAGS_files}."
Process files
for file in ${FLAGS_files}; do echo "Processing: $file" done`
Please let me know if you're interested in incorporating this part of the code.