You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
this is a feature request for the integration of Params and https://github.com/carlobaldassi/ArgParse.jl. It would be nice to be able to define an ArgParse table from a @with_kw struct. My macro-fu is next to zero, but I think most of the machinery needed is already part of @with_kw, this is why I'm opening the issue here.
With this feature, it would be very easy to create julia code that can be either be included or used as a script. This is the kind of interface I have in mind:
using Parameters, ArgParse
@with_kwstruct Params
a::Int
b::String=2
c::Bool=true# comments could become helpstrings.endmain(; kws...) =main(Params(; kws...)) # just keywords convenience interfacefunctionmain(prms::Params)
....endifabspath(PROGRAM_FILE) ==@__FILE__# executing as a script: julia myfile.jl
s =ArgParseSettings()
@add_arg_table! s Params
prms =parse_args(ARGS, s) # return a Params objectmain(prms)
end
Hi,
this is a feature request for the integration of Params and https://github.com/carlobaldassi/ArgParse.jl. It would be nice to be able to define an ArgParse table from a
@with_kw
struct. My macro-fu is next to zero, but I think most of the machinery needed is already part of@with_kw
, this is why I'm opening the issue here.With this feature, it would be very easy to create julia code that can be either be included or used as a script. This is the kind of interface I have in mind:
@mauro3 do you think this is feasible / worth having?
pinging also @carlobaldassi
The text was updated successfully, but these errors were encountered: