#21: command line option parsing
-------------------------------+--------------------------------------------
Reporter: was | Owner: jdemeyer
Type: enhancement | Status: needs_work
Priority: critical | Milestone: sage-6.0
Component: interfaces | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: #9958 | Stopgaps:
-------------------------------+--------------------------------------------
Comment (by jdemeyer):
Replying to [comment:45 kini]:
> Or, since `sage-env` ideally should just set up environment variables
and do nothing else
Well, some of these environment variables are conditional, so it's not
that easy to have a file which works both from bash and from Python. And
I certainly don't see it as a problem that `sage-env` remains in `bash` as
it is now.
> The problem with having two-pass argument parsing is that it separates
the processing of arguments into multiple areas, making the architecture
of the startup process needlessly complex. It is also pretty ugly to
actually do this in the standard option parsing way because either you
start to want to enforce arbitrary argument orders like we currently do
(`sage -tp` works and `sage -pt` doesn't, `sage -br` works and `sage -rb`
doesn't, etc.), or now the bash script needs to basically reimplement
optparse/argparse in bash in order to correctly read the flags it's
looking for.
All these arguments are essentially irrelevant if the first pass needs to
support just very few options. Things like `./sage -tp` or `./sage -pt`
would be handled anyway by the `argparse` script.
Of course it's bad design to have two-pass argument parsing, but it would
be so nice to keep `./sage -i` and `./sage --sh` working.
> Why does part of the startup need to be bash, other than because of
`sage-env`?
I think `sage-env` is the main reason.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/21#comment:48>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.