#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 kini):
Replying to [comment:42 jdemeyer]:
> But what about `sage-env` then? That's needed by `sage-sh`, so it
cannot be Python-based.
Right, we might have a very thin bash wrapper that loads `sage-env` (which
will be a bash script) before the main Python script. Or, since `sage-env`
ideally should just set up environment variables and do nothing else
(right?), we could turn it into a config file that was read independently
by `sage-sh` and by `sage`. This would also allow us to rely less on
environment variables for random things seemingly unrelated to the shell.
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.
In any case, if I as a new Sage developer want to know or modify what
option `--foo` does, there should be one obvious place to look for it.
Making `sage-sh` parse arguments also means that we are shadowing
arguments that could be passed on to the shell, etc. etc. Splitting
argument parsing into two places is just generally a nasty design IMHO.
Why does part of the startup need to be bash, other than because of `sage-
env`?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/21#comment:45>
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 post to this group, send email to [email protected].
To unsubscribe from 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.