On Wed, Dec 12, 2012 at 2:57 PM, David Quigley <selinux(a)davequigley.com> wrote:
I've given a few talks on SELinux over the past year and I've
spoken to a
bunch of people on google+ about SELinux and one topic keeps coming up. Many
people find semanage to be large and convoluted with the help text being way
to large to sort through. The latter part of the complaint is easy to
address. The code for argument parsing in semanage (last time I checked)
doesn't use things like argparse. If we switched it over to argparse we
could get per sub-command help messages that would be more useful to people
when they messed up a sub-command. Would anyone be opposed if I spent the
time to migrate semanage argument parsing and help messages over to argparse
or a similar library?
I'm not sure that's even possible. For example, my all-time favourite
"quirk" of semanage is:
semanage fcontext -d --ftype -d /some/dir
The first -d is the flag, while the second -d is actually a value
passed to --ftype. I'm not sure if argparse will do the right job
parsing this -- my brain certainly doesn't. :)
Best,
--
Konstantin Ryabitsev
LinuxFoundation.org
Montréal, Québec