11"""
2- coast(cmd0::String="" ; kwargs...)
2+ coast(; kwargs...)
33
44Plot continents, shorelines, rivers, and borders on maps.
55
66Plots grayshaded, colored, or textured land-masses [or water-masses] on
7- maps and [optionally] draws coastlines, rivers, and political
8- boundaries. A map projection must be supplied.
7+ maps and [optionally] draws coastlines, rivers, and political boundaries.
98
109Parameters
1110----------
@@ -75,11 +74,13 @@ Parameters
7574
7675To see the full documentation type: ``@? coast``
7776"""
78- function coast (cmd0:: String = " " ; clip:: StrSymb = " " , first= true , kwargs... )
79- dbg_cmd, d, cmd, K, O, finish, get_largest, toTrack = coast_parser (first, string (clip); kwargs... )
77+ function coast (; clip:: StrSymb = " " , first= true , kwargs... )
78+ d, K, O = init_module (first, kwargs... ) # Also checks if the user wants ONLY the HELP mode
79+ dbg_cmd, d, cmd, O, finish, get_largest, toTrack = coast_parser (first== 1 , string (clip), O, d)
8080 (dbg_cmd != = nothing ) && return dbg_cmd
81-
82- # Have a big possible break here to allow PS_nested call only the parsing part and hence fck the Julia recompilation eagerness
81+ coast (cmd, K, O, finish, get_largest, toTrack, d)
82+ end
83+ function coast (cmd:: Vector{String} , K:: Bool , O:: Bool , finish:: Bool , get_largest:: Bool , toTrack, d:: Dict{Symbol, Any} )
8384
8485 # Don't call finish_PS_module if -M because it returns a GDtype instead of a PS
8586 R = (length (cmd) == 1 && contains (cmd[1 ], " -M" )) ? gmt (cmd[1 ]) : prep_and_call_finish_PS_module (d, cmd, " " , K, O, finish)
@@ -105,14 +106,13 @@ function coast(cmd0::String=""; clip::StrSymb="", first=true, kwargs...)
105106 R
106107end
107108
108- function coast_parser (first:: Bool , clip:: String ; kwargs ... )
109+ function coast_parser (first:: Bool , clip:: String , O :: Bool , d :: Dict{Symbol, Any} )
109110
110- d, K, O = init_module (first, kwargs... ) # Also checks if the user wants ONLY the HELP mode
111111 gmt_proggy = (IamModern[]) ? " coast " : " pscoast "
112112
113113 if ((val = hlp_desnany_str (d, [:getR :getregion :get_region ], false )) != = " " )
114114 t:: String = string (gmt_proggy, " -E" , val)
115- resto = d, " " , K, O, true , false , " "
115+ resto = d, " " , O, true , false , " "
116116 ((Vd = hlp_desnany_int (d, [:Vd ])) != = - 999 ) && (Vd == 1 ? println (t) : Vd > 1 ? (return t, resto... ) : nothing )
117117 t = parse_V (d:: Dict , t)
118118 return gmt (t). text[1 ]:: String , resto...
@@ -124,7 +124,7 @@ function coast_parser(first::Bool, clip::String; kwargs...)
124124 twoORfour = have_opt_M && contains (cmd, " +z" ) && contains (cmd, ' .' ) ? " 4" : " 2" # To use in gmt_main to decide CODE attrib
125125 if (cmd != " " ) # Check for a minimum of points that segments must have
126126 if ((val = hlp_desnany_str (d, [:minpts ])) != = " " ) POSTMAN[][" minpts" ] = val
127- elseif (get (POSTMAN[], " minpts" , " " ) != " " ) delete! (POSTMAN[], " minpts" )
127+ elseif (get (POSTMAN[], " minpts" , " " ) != " " ) delete! (POSTMAN[], " minpts" )
128128 end
129129 end
130130
@@ -135,7 +135,7 @@ function coast_parser(first::Bool, clip::String; kwargs...)
135135 POSTMAN[][" DCWnames" ] = twoORfour # When dumping, we want to add the country name as attribute
136136 if ((val = find_in_dict (d, [:Z ])[1 ]) != = nothing )
137137 toTrack = (isa (val, GMTgrid) || (isa (val, String) && length (val) > 4 )) ? val : " "
138- toTrack == " " && (POSTMAN[][" plusZzero" ] = " y" )# If toTrack the extra column is added by the grdtrack call below
138+ toTrack == " " && (POSTMAN[][" plusZzero" ] = " y" ) # If toTrack the extra column is added by the grdtrack call below
139139 end
140140 end
141141
@@ -193,7 +193,7 @@ function coast_parser(first::Bool, clip::String; kwargs...)
193193 end
194194
195195 r = check_dbg_print_cmd (d, _cmd)
196- return r, d, _cmd, K, O, finish, get_largest, toTrack
196+ return r, d, _cmd, O, finish, get_largest, toTrack
197197end
198198
199199# ---------------------------------------------------------------------------------------------------
@@ -293,7 +293,7 @@ function parse_dcw(val::Tuple)::String
293293end
294294
295295# ---------------------------------------------------------------------------------------------------
296- coast! (cmd0 :: String = " " ; clip:: StrSymb = " " , kw... ) = coast (cmd0 ; clip= clip, first= false , kw... )
296+ coast! (; clip:: StrSymb = " " , kw... ) = coast (; clip= clip, first= false , kw... )
297297
298298const pscoast = coast # Alias
299299const pscoast! = coast!
0 commit comments