@@ -49,18 +49,19 @@ grdinfo(cmd0::String; kwargs...) = grdinfo_helper(cmd0, nothing; kwargs...)
4949grdinfo (arg1; kwargs... ) = grdinfo_helper (" " , arg1; kwargs... )
5050function grdinfo_helper (cmd0:: String , arg1; kwargs... )
5151 d = init_module (false , kwargs... )[1 ] # Also checks if the user wants ONLY the HELP mode
52- grdinfo_helper (cmd0, arg1, d)
52+ grdinfo_helper (wrapGrids ( cmd0, arg1) , d)
5353end
5454
5555# ---------------------------------------------------------------------------------------------------
56- function grdinfo_helper (cmd0:: String , arg1, d:: Dict{Symbol, Any} ):: Union{GMTdataset, String}
56+ function grdinfo_helper (w:: wrapGrids , d:: Dict{Symbol, Any} ):: Union{GMTdataset, String}
57+ cmd0, arg1 = unwrapGrids (w)
5758
5859 cmd, = parse_common_opts (d, " " , [:R :V_params :f :o ])
5960 (is_in_dict (d, [:numeric ], del= true ) != = nothing ) && (cmd *= " -Cn" )
6061 cmd = parse_these_opts (cmd, d, [[:C :oneliner ], [:D :tiles ], [:E :extrema :extreme ], [:F :report_ingeog ],
6162 [:G :download :force ], [:I :nearest ], [:L :force_scan ], [:Q :cube ], [:T :minmax :zmin_max ]])
62- opt_M = add_opt (d, " " , " M" , [:M :minmax_pos ]); (opt_M != " " ) && (cmd *= opt_M)
63- opt_L = add_opt (d, " " , " L" , [:L :force_scan ]); (opt_L != " " ) && (cmd *= opt_L)
63+ opt_M = add_opt (d, " " , " M" , [:M :minmax_pos ]); (opt_M != = " " ) && (cmd *= opt_M)
64+ opt_L = add_opt (d, " " , " L" , [:L :force_scan ]); (opt_L != = " " ) && (cmd *= opt_L)
6465
6566 (isa (arg1, GMTgrid) && size (arg1,3 ) > 1 && ! occursin (" -Q" , cmd)) && (cmd *= " -Q" ) # arg1 is a CUBE
6667 R = common_grd (d, cmd0, cmd, " grdinfo " , arg1) # Finish build cmd and run it
@@ -71,12 +72,12 @@ function grdinfo_helper(cmd0::String, arg1, d::Dict{Symbol, Any})::Union{GMTdata
7172 append! (hdims, [" z_min" ," z_max" ," dx" ," dy" ," n_cols" ," n_rows" ," reg" ," isgeog" ]) :
7273 append! (hdims, [" b(?)" ," t(?)" ," z_min" ," z_max" ," dx" ," dy" ," dz" ," n_cols" ," n_rows" ," n_layers" ," reg" ," isgeog" ])
7374 R. colnames = hdims
74- elseif (opt_M != " " && opt_L == " " )
75+ elseif (opt_M != = " " && opt_L == " " )
7576 (length (R. data) == 17 ) && # It can be 19 for cubes (not implemented yet)
7677 (R. colnames = append! (hdims, [" z_min" ," z_max" ," dx" ," dy" ," n_cols" ," n_rows" ," xmin_pos" ," ymin_pos" ," xmax_pos" ," ymax_pos" ," n_NaNs" ," reg" ," isgeog" ]))
7778 end
7879 # -o changes it all so we parse just the simplest case. If it fails we remove colnames
79- if ((t = scan_opt (cmd, " -o" )) != " " )
80+ if ((t = scan_opt (cmd, " -o" )) != = " " )
8081 cn = tryparse (Int, t) != = nothing
8182 (cn != = nothing ) ? (R. colnames = [R. colnames[cn+ 1 ]]) : (R. colnames = String[])
8283 end
0 commit comments