shflags icon indicating copy to clipboard operation
shflags copied to clipboard

DEFINE_list

Open tradergt opened this issue 4 months ago • 0 comments

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.

tradergt avatar Oct 05 '25 21:10 tradergt