Skip to content

Commit

Permalink
Allowing wildcards in command-line arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Paul committed Sep 3, 2015
1 parent 0b0fc6e commit 3a3db0e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/slice2series
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ See the LICENSE.rst file for details
"""

import optparse
import glob
from pyreshaper import specification
from pyreshaper import reshaper

Expand Down Expand Up @@ -79,8 +80,13 @@ def main(options, input_file_list):
# Create the input object for the Reshaper
spec = specification.create_specifier()

# Generate the input file list from (potentially) globs/wildcards
full_input_file_list = []
for arg in input_file_list:
full_input_file_list.extend(glob.glob(arg))

# Add input to the specifier
spec.input_file_list = input_file_list
spec.input_file_list = full_input_file_list
spec.netcdf_format = options.netcdf_format
spec.output_file_prefix = options.output_prefix
spec.output_file_suffix = options.output_suffix
Expand Down

0 comments on commit 3a3db0e

Please sign in to comment.