Skip to content

Commit

Permalink
Revert many of the args to kwargs move. Shit happened under the hood. (
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim authored Dec 30, 2024
1 parent e962a6a commit f127dab
Show file tree
Hide file tree
Showing 27 changed files with 60 additions and 66 deletions.
58 changes: 29 additions & 29 deletions src/common_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function leave_paper_mode()
end

# ---------------------------------------------------------------------------------------------------
parse_RIr(d::Dict, cmd::String, O::Bool=false; del::Bool=true) = parse_R(d, cmd, O=O, del=del, RIr=true)
parse_RIr(d::Dict, cmd::String, O::Bool=false, del::Bool=true) = parse_R(d, cmd, O=O, del=del, RIr=true)
function parse_R(d::Dict, cmd::String; O::Bool=false, del::Bool=true, RIr::Bool=false, noGlobalR::Bool=false)::Tuple{String, String}
# Build the option -R string. Make it simply -R if overlay mode (-O) and no new -R is fished here
# The RIr option is to assign also the -I and -r when R was given a GMTgrid|image value. This is a
Expand All @@ -163,7 +163,7 @@ function parse_R(d::Dict, cmd::String; O::Bool=false, del::Bool=true, RIr::Bool=
val, symb = find_in_dict(d, [:R :region :limits :region_llur :limits_llur :limits_diag :region_diag], del)

(val === nothing && IamModern[1] && !RIr) && return cmd, ""
opt_R = build_opt_R(val, symb=symb)
opt_R = build_opt_R(val, symb)

opt_R = merge_R_and_xyzlims(d, opt_R) # Let a -R be partially changed by the use of optional xyzlim

Expand Down Expand Up @@ -272,8 +272,8 @@ function merge_R_and_xyzlims(d::Dict, opt_R::String)::String
end

# ---------------------------------------------------------------------------------------------------
build_opt_R(val::Symbol; symb::Symbol=Symbol())::String = build_opt_R(string(val), symb=symb)
function build_opt_R(r::String; symb::Symbol=Symbol())::String
build_opt_R(val::Symbol, symb::Symbol=Symbol())::String = build_opt_R(string(val), symb)
function build_opt_R(r::String, symb::Symbol=Symbol())::String
if (r == "global") R = " -Rd"
elseif (r == "global360") R = " -Rg"
elseif (r == "same") R = " -R"
Expand All @@ -282,7 +282,7 @@ function build_opt_R(r::String; symb::Symbol=Symbol())::String
R
end

function build_opt_R(val; symb::Symbol=Symbol())::String # Generic function that deals with all but NamedTuple args
function build_opt_R(val, symb::Symbol=Symbol())::String # Generic function that deals with all but NamedTuple args
R::String = ""
if ((isvector(val) || isa(val, Tuple)) && (length(val) == 4 || length(val) == 6))
if (symb (:region_llur, :limits_llur, :limits_diag, :region_diag))
Expand All @@ -303,7 +303,7 @@ function build_opt_R(val; symb::Symbol=Symbol())::String # Generic function tha
end

# ---------------------------------------------------------------------------------------------------
function build_opt_R(arg::NamedTuple; symb::Symbol=Symbol())::String
function build_opt_R(arg::NamedTuple, symb::Symbol=Symbol())::String
# Option -R can also be diabolicly complicated. Try to addres it. Stil misses the Time part.
BB::String = ""
d = nt2dict(arg) # Convert to Dict
Expand Down Expand Up @@ -403,7 +403,7 @@ function opt_R2num(opt_R::String)::Vector{Float64}
end

# ---------------------------------------------------------------------------------------------------
function parse_JZ(d::Dict, cmd::String; del::Bool=true, O::Bool=false, is3D::Bool=false)::Tuple{String,String}
function parse_JZ(d::Dict, cmd::String, del::Bool=true; O::Bool=false, is3D::Bool=false)::Tuple{String,String}
symbs = [:JZ :Jz :zsize :zscale]
(SHOW_KWARGS[1]) && return (print_kwarg_opts(symbs, "String | Number"), "")
opt_J::String = ""; seek_JZ = true
Expand Down Expand Up @@ -498,7 +498,7 @@ function parse_J(d::Dict, cmd::String; default::String="", map::Bool=true, O::Bo
end
(opt_J == "") && (opt_J = " -JX")
# If only the projection but no size, try to get it from the kwargs.
if ((s = helper_append_figsize(d, opt_J, O, del=del)) != "") # Takes care of both fig scales and fig sizes
if ((s = helper_append_figsize(d, opt_J, O, del)) != "") # Takes care of both fig scales and fig sizes
opt_J = s
elseif (default != "" && opt_J == " -JX")
opt_J = IamSubplot[1] ? " -JX?" : (default != "guess" ? default : opt_J) # -JX was a working default
Expand All @@ -521,7 +521,7 @@ function parse_J(d::Dict, cmd::String; default::String="", map::Bool=true, O::Bo
end
end
else # For when a new size is entered in a middle of a script
if ((s = helper_append_figsize(d, opt_J, O, del=del)) != "")
if ((s = helper_append_figsize(d, opt_J, O, del)) != "")
if (opt_J == " -J")
(CTRL.pocket_J[1] != s) && # Composed funs (ex: fill_between) would trigger this warning
println("SEVERE WARNING: When appending a new fig with a different size you SHOULD set the `projection`. \n\tAdding `projection=:linear` at your own risk.");
Expand Down Expand Up @@ -588,7 +588,7 @@ function fish_size_from_J(opt_J; onlylinear::Bool=true, opt_R::String="")
return nothing
end

function get_figsize(; opt_R::String="", opt_J::String="")
function get_figsize(opt_R::String="", opt_J::String="")
# Compute the current fig dimensions in paper coords using the know -R -J
(opt_R == "" || opt_R == " -R") && (opt_R = CTRL.pocket_R[1])
(opt_J == "" || opt_J == " -J") && (opt_J = CTRL.pocket_J[1])
Expand All @@ -597,7 +597,7 @@ function get_figsize(; opt_R::String="", opt_J::String="")
return Dwh[1], Dwh[2] # Width, Height
end

function helper_append_figsize(d::Dict, opt_J::String, O::Bool; del::Bool=true)::String
function helper_append_figsize(d::Dict, opt_J::String, O::Bool, del::Bool=true)::String
val_, symb = find_in_dict(d, [:figscale :fig_scale :scale :figsize :fig_size], del)
(val_ === nothing && is_in_dict(d, [:flipaxes :flip_axes]) === nothing) && return ""
val::String = arg2str(val_)
Expand All @@ -609,18 +609,18 @@ function helper_append_figsize(d::Dict, opt_J::String, O::Bool; del::Bool=true):
if (opt_J == " -JX")
val = check_flipaxes(d, val)
opt_J::String = isletter(val[1]) ? " -J" * val : " -Jx" * val # FRAGILE
else opt_J = append_figsize(d, opt_J, width=val, scale=true)
else opt_J = append_figsize(d, opt_J, val, true)
end
else # A fig SIZE request
(haskey(d, :units)) && (val *= d[:units][1]::String)
if (occursin("+proj", opt_J)) opt_J *= "+width=" * val
else opt_J = append_figsize(d, opt_J, width=val)
else opt_J = append_figsize(d, opt_J, val)
end
end
return opt_J
end

function append_figsize(d::Dict, opt_J::String; width::String="", scale::Bool=false)::String
function append_figsize(d::Dict, opt_J::String, width::String="", scale::Bool=false)::String
# Appending either a fig width or fig scale depending on what projection.
# Sometimes we need to separate with a '/' others not. If WIDTH == "" we
# use the DEF_FIG_SIZE, otherwise use WIDTH that can be a size or a scale.
Expand Down Expand Up @@ -697,7 +697,7 @@ end

# ----------------------------------------------------------------------------------------------------
"""
w, h = plot_GI_size(GI; proj="", region="")
w, h = plot_GI_size(GI, proj="", region="")
Compute the plot width and height in cm given the the region `region` and projection `proj`. Note that
here the `region` and `proj` options, if provided, must be the full " -R...." and " -J..." strings and
Expand All @@ -707,7 +707,7 @@ value is not particularly important because the main idea here is to be able to
Returns a tuple of Float64 with the width, height in cm.
"""
function plot_GI_size(GI::GItype; opt_J="", opt_R="")
function plot_GI_size(GI::GItype, opt_J="", opt_R="")
got_J = (opt_J != "")
(opt_R == "") && (opt_R = @sprintf(" -R%.10g/%.10g/%.10g/%.10g", GI.range[1:4]...))
(opt_J == "") && (opt_J = (GI.geog > 0) ? guess_proj(GI.range[1:2], GI.range[3:4]) : " -JX")
Expand Down Expand Up @@ -1309,11 +1309,11 @@ end

# ---------------------------------------------------------------------------------------------------
title(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset)
subtitle(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, tipo="s")
xlabel(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, tipo="x")
ylabel(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, tipo="y")
zlabel(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, tipo="z")
function titles_e_comp(str::AbstractString, fnt, offset; tipo::String="")::Tuple{String, String}
subtitle(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, "s")
xlabel(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, "x")
ylabel(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, "y")
zlabel(; str::AbstractString="", font=nothing, offset=0) = titles_e_comp(str, font, offset, "z")
function titles_e_comp(str::AbstractString, fnt, offset, tipo::String="")::Tuple{String, String}
f::String = (fnt !== nothing) ? font(fnt) : ""
o::String = (offset != 0) ? string(offset) : ""
(str == "") && return str, ""
Expand Down Expand Up @@ -1371,7 +1371,7 @@ function guess_WESN(d::Dict, cmd::String)::String
end

# ---------------------------------------------------------------------------------------------------
function parse_BJR(d::Dict, cmd::String, caller::String, O::Bool; defaultJ::String="", del::Bool=true)
function parse_BJR(d::Dict, cmd::String, caller::String, O::Bool, defaultJ::String="", del::Bool=true)
# Join these three in one function. CALLER is non-empty when module is called by plot()
cmd, opt_R = parse_R(d, cmd, O=O, del=del)
cmd, opt_J = parse_J(d, cmd, default=defaultJ, map=true, O=O, del=del)
Expand Down Expand Up @@ -1511,16 +1511,16 @@ function parse_c(d::Dict, cmd::String)::Tuple{String, String}
end

# ---------------------------------------------------------------------------------------------------
function parse_d(d::Dict, cmd::String; symbs::VMs=[:d :nodata])
function parse_d(d::Dict, cmd::String, symbs::VMs=[:d :nodata])
(SHOW_KWARGS[1]) && return (print_kwarg_opts(symbs, "$(symbs[2])=val"),"")
parse_helper(cmd, d, [:d :nodata], " -d")
end
parse_di(d::Dict, cmd::String) = parse_d(d, cmd, symbs=[:di :nodata_in])
parse_do(d::Dict, cmd::String) = parse_d(d, cmd, symbs=[:do :nodata_out])
parse_di(d::Dict, cmd::String) = parse_d(d, cmd, [:di :nodata_in])
parse_do(d::Dict, cmd::String) = parse_d(d, cmd, [:do :nodata_out])
parse_e(d::Dict, cmd::String) = parse_helper(cmd, d, [:e :pattern :find], " -e")
parse_g(d::Dict, cmd::String) = parse_helper(cmd, d, [:g :gap], " -g")
parse_h(d::Dict, cmd::String) = parse_helper(cmd, d, [:h :header], " -h")
parse_i(d::Dict, cmd::String) = parse_helper(cmd, d, [:i :incols :incol], " -i", sep=',')
parse_i(d::Dict, cmd::String) = parse_helper(cmd, d, [:i :incols :incol], " -i", ',')
parse_j(d::Dict, cmd::String) = parse_helper(cmd, d, [:j :metric :spherical :spherical_dist], " -j")

# ---------------------------------------------------------------------------------
Expand Down Expand Up @@ -1565,7 +1565,7 @@ function parse_n(d::Dict, cmd::String, gmtcompat::Bool=false)
end

# ---------------------------------------------------------------------------------
parse_o(d::Dict, cmd::String) = parse_helper(cmd, d, [:o :outcols :outcol], " -o", sep=',')
parse_o(d::Dict, cmd::String) = parse_helper(cmd, d, [:o :outcols :outcol], " -o", ',')
parse_p(d::Dict, cmd::String) = parse_helper(cmd, d, [:p :view :perspective], " -p")

# ---------------------------------------------------------------------------------
Expand Down Expand Up @@ -1650,7 +1650,7 @@ function parse_append(d::Dict, cmd::String)::String
end

# ---------------------------------------------------------------------------------------------------
function parse_helper(cmd::String, d::Dict, symbs::VMs, opt::String; sep='/')::Tuple{String, String}
function parse_helper(cmd::String, d::Dict, symbs::VMs, opt::String, sep='/')::Tuple{String, String}
# Helper function to the parse_?() global options.
(SHOW_KWARGS[1]) && return (print_kwarg_opts(symbs, "(Common option not yet expanded)"),"")
opt_val::String = ""
Expand Down Expand Up @@ -1759,7 +1759,7 @@ end
parse_G(d::Dict, cmd::String) = parse_helper(cmd, d, [:G :save :write :outgrid :outfile], " -G")

# ---------------------------------------------------------------------------------------------------
function parse_I(d::Dict, cmd::String, symbs, opt::String, del::Bool)::String
function parse_I(d::Dict, cmd::String, symbs, opt::String, del::Bool=true)::String
# Parse the quasi-global -I option. But arguments can be strings, arrays, tuples or NamedTuples
# At the end we must recreate this syntax: xinc[unit][+e|n][/yinc[unit][+e|n]] or
get_that_string(arg)::String = string(arg)::String # Function barrier. Shuting up JET, etc.
Expand Down
2 changes: 1 addition & 1 deletion src/drawing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function helper_shapes(x, y, cmd; Vd=0, kw...)
end
CTRLshapes.points[1] = true
else
_cmd, opt_B, opt_J, opt_R = GMT.parse_BJR(d, "", "", false, defaultJ=" ")
_cmd, opt_B, opt_J, opt_R = GMT.parse_BJR(d, "", "", false, " ")
(opt_R == "") && (opt_R = " -R0/21/0/29")
(opt_J == " ") && (opt_J = " -Jx1")
end
Expand Down
2 changes: 1 addition & 1 deletion src/geodesy/psvelo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function velo(cmd0::String="", arg1=nothing; first=true, kwargs...)

d, K, O = init_module(first, kwargs...) # Also checks if the user wants ONLY the HELP mode

cmd, _, _, opt_R = parse_BJR(d, "", "", O, defaultJ=" -JX12cd/0d")
cmd, _, _, opt_R = parse_BJR(d, "", "", O, " -JX12cd/0d")
cmd, = parse_common_opts(d, cmd, [:UVXY :di :e :p :t :params]; first=first)

if ((val = find_in_dict(d, [:A :arrow])[1]) !== nothing)
Expand Down
2 changes: 1 addition & 1 deletion src/gmtbegin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function helper1_inset_nested(d; iscoast=false, isplot=false, imgdims=tuple())
# All inset_nested methods start with this. Also sets some defaults.
fig_opt_R, fig_opt_J = CTRL.pocket_R[1], CTRL.pocket_J[1] # Main fig region and proj. Need these to cheat the modern session
bak = CTRL.limits[7:end] # Backup these because parse_R will change them
_, opt_B::String, opt_J::String, opt_R::String = parse_BJR(d, "", "", false, defaultJ=" ")
_, opt_B::String, opt_J::String, opt_R::String = parse_BJR(d, "", "", false, " ")
CTRL.limits[7:end] = bak # and we don't want that change to be stored
islinear = (opt_J == "" || opt_J[4] == 'X' || opt_J[4] == 'x');
fname = hack_modern_session(fig_opt_R, fig_opt_J) # Start a modern session and return the full name of the gmt_0.ps- file
Expand Down
2 changes: 1 addition & 1 deletion src/grdcontour.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function _grdcontour_helper(cmd0::String, arg1, O::Bool, K::Bool, d::Dict)
arg2, arg3 = nothing, nothing
dict_auto_add!(d) # The ternary module may send options via another channel

cmd::String, opt_B, opt_J, opt_R = parse_BJR(d, "", "", O, defaultJ=" -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd::String, opt_B, opt_J, opt_R = parse_BJR(d, "", "", O, " -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd, = parse_common_opts(d, cmd, [:UVXY :margin :params :bo :c :e :f :h :p :t]; first=!O)
cmd = parse_these_opts(cmd, d, [[:D :dump], [:F :force], [:L :range], [:Q :cut], [:S :smooth]])
cmd = parse_contour_AGTW(d::Dict, cmd::String)[1]
Expand Down
2 changes: 1 addition & 1 deletion src/grdimage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function _grdimage(cmd0::String, arg1, arg2, arg3, O::Bool, K::Bool, d::Dict)

has_opt_B = (is_in_dict(d, [:B :frame :axis :axes]) !== nothing)
(is_in_dict(d, [:A :img_out :image_out]) !== nothing) && (d[:B] = "none") # When -A is used, -B is forbiden
cmd::String, opt_B::String, opt_J::String, opt_R::String = parse_BJR(d, "", "", O, defaultJ=" -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd::String, opt_B::String, opt_J::String, opt_R::String = parse_BJR(d, "", "", O, " -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
(startswith(opt_J, " -JX") && !contains(opt_J, "/")) && (cmd = replace(cmd, opt_J => opt_J * "/0")) # When sub-regions
(!has_opt_B && isa(arg1, GMTimage) && (isimgsize(arg1) || CTRL.limits[1:4] == zeros(4)) && opt_B == DEF_FIG_AXES_BAK) &&
(cmd = replace(cmd, opt_B => "")) # Dont plot axes for plain images if that was not required
Expand Down
2 changes: 1 addition & 1 deletion src/grdvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function grdvector(arg1, arg2; first=true, kwargs...)
(inverse=("i", nothing, 1), length=("l", arg2str, 1), scale=("",arg2str,2), scale_at_lat="+c", refsize="+s"))

opt_R = (contains(cmd, "-R") && !contains(cmd, " -R ")) ? "" : @sprintf(" -R%.4g/%.14g/%.14g/%.14g", info[1:4]...)
w,h = get_figsize(opt_R=opt_R, opt_J=opt_J)
w,h = get_figsize(opt_R, opt_J)
max_extrema = max(abs(info[5]), abs(info[6]), abs(info2[5]), abs(info2[6])) # The max of the absolute extremas
as = 1.05 * max_extrema * sqrt((n_rows*n_cols) / (w*h)) # Autoscale (approx). Idealy it should be max magnitude.

Expand Down
2 changes: 1 addition & 1 deletion src/grdview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function grdview_helper(cmd0::String, arg1, O::Bool, K::Bool, d::Dict)
common_insert_R!(d, O, cmd0, arg1; is3D=true) # Set -R in 'd' out of grid/images (with coords) if limits was not used

have_opt_B = (find_in_dict(d, [:B :frame :axis :axes], false)[1] !== nothing)
cmd, opt_B, opt_J, opt_R = parse_BJR(d, "", "grdview", O, defaultJ=" -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd, opt_B, opt_J, opt_R = parse_BJR(d, "", "grdview", O, " -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
(startswith(opt_J, " -JX") && !contains(opt_J, "/")) && (cmd = replace(cmd, opt_J => opt_J * "/0")) # When sub-regions
(!have_opt_B && isa(arg1, GMTimage) && (isimgsize(arg1) || CTRL.limits[1:4] == zeros(4)) && opt_B == DEF_FIG_AXES_BAK) &&
(cmd = replace(cmd, opt_B => "")) # Dont plot axes for plain images if that was not required
Expand Down
2 changes: 1 addition & 1 deletion src/gridit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ gridit(arg1::MatGDsGd; method::StrSymb="surface", proj="", epsg=0, kw...) =
function seek_auto_RI(d::Dict{Symbol,Any}, fname::String, arg1::Union{Nothing, MatGDsGd})
# Check if -R -I was provided and if not make a wild guess of them.
IamModern[1] && return d # No sniffs in modern
opt_RI, opt_R = parse_RIr(d, "", false, del=false)
opt_RI, opt_R = parse_RIr(d, "", false, false)
opt_I = (opt_RI != opt_R) ? split(opt_RI)[1] : "" # opt_RI has -I first than -R
have_R, have_I = (opt_R != ""), (opt_RI != opt_R)

Expand Down
2 changes: 1 addition & 1 deletion src/imshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function imshow(arg1::GItype; kw...)
(arg1.geog > 0 && is_in_dict(d, [:J :proj :projection]) === nothing) && (d[:J] = "guess")
opt_J = parse_J(d, "", default="", map=true, O=false, del=false)[2]
(startswith(opt_J, " -JX") && !contains(opt_J, '/')) && (opt_J *= "/0") # We always want axis equal
w, h = plot_GI_size(arg1, opt_J=opt_J) # Compute the plot Width,Height given the arg1 limits and proj
w, h = plot_GI_size(arg1, opt_J) # Compute the plot Width,Height given the arg1 limits and proj
aspect = h / w
_w = 15 / nc; _h = _w * aspect

Expand Down
2 changes: 1 addition & 1 deletion src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ function arrows(cmd0::String="", arg1=nothing; first=true, kwargs...)
# TYPEVEC = 0, ==> u,v = theta,rho. TYPEVEC = 1, ==> u,v = u,v. TYPEVEC = 2, ==> u,v = x2,y2
typevec = (find_in_dict(d, [:uv])[1] !== nothing) ? 1 : (find_in_dict(d, [:endpt :endpoint])[1] !== nothing) ? 2 : 0
d, arg1 = helper_vecBug(d, arg1, first, haveR, haveVarFill, typevec) # Deal with GMT nasty bug
_common_plot_xyz(cmd0, mat2ds(arg1), "", first==1, true, false, d)
common_plot_xyz(cmd0, mat2ds(arg1), "", first, false; d...)
end

arrows!(cmd0::String="", arg1=nothing; kw...) = arrows(cmd0, arg1; first=false, kw...)
Expand Down
2 changes: 1 addition & 1 deletion src/psbasemap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function basemap(; first=true, kwargs...)

d, K, O = init_module(first, kwargs...) # Also checks if the user wants ONLY the HELP mode

cmd, = parse_BJR(d, "", "", O, defaultJ=" -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd, = parse_BJR(d, "", "", O, " -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd, = parse_JZ(d, cmd)
cmd, = parse_common_opts(d, cmd, [:F :UVXY :bo :c :f :p :t :params :margin]; first=first)
cmd = parse_these_opts(cmd, d, [[:A :polygon]])
Expand Down
2 changes: 1 addition & 1 deletion src/psclip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function clip_helper(cmd0::String, arg1; first=true, kwargs...)

d, K, O = init_module(first, kwargs...) # Also checks if the user wants ONLY the HELP mode

cmd, _, _, opt_R = parse_BJR(d, "", "", O, defaultJ=" -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd, _, _, opt_R = parse_BJR(d, "", "", O, " -JX" * split(DEF_FIG_SIZE, '/')[1] * "/0")
cmd, = parse_common_opts(d, cmd, [:UVXY :JZ :c :e :f :g :p :t :yx :params]; first=first)
cmd = parse_these_opts(cmd, d, [[:A :steps :straightlines], [:C :endclip], [:N :invert], [:T :clipregion :clip_limits]])
cmd *= add_opt_pen(d, [:W :pen], opt="W")
Expand Down
Loading

0 comments on commit f127dab

Please sign in to comment.