From b593dd1772fae959a91dea598409638963edf200 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Tue, 21 Dec 2010 11:49:40 +0300 Subject: [PATCH] Help restructuring. --- pym/cl_image_cmd.py | 7 +++++- pym/cl_kernel_cmd.py | 54 ++++++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/pym/cl_image_cmd.py b/pym/cl_image_cmd.py index 83fb2eb..e946235 100644 --- a/pym/cl_image_cmd.py +++ b/pym/cl_image_cmd.py @@ -38,6 +38,7 @@ CMD_OPTIONS = [{'shortOption':"p", 'optVal':"PROFILE", 'help':_("system profile") }, + {'longOption':"set"}, {'shortOption':"f", 'longOption':"force", 'help':_("no questions during the creating process") @@ -47,11 +48,15 @@ USAGE = _("%prog [options] iso|squash") class image_cmd(share_cmd): """Class for work with cl_builder by console""" def __init__(self): + setpos = \ + filter(lambda x:x[1].get('longOption')=="set", + enumerate(CMD_OPTIONS))[0][0] + CMD_OPTIONS[setpos] = opt.variable_set[0] self.optobj = opt(package=__app__, version=__version__, description=DESCRIPTION, usage=USAGE, - option_list= CMD_OPTIONS + opt.variable_control + + option_list= CMD_OPTIONS + opt.variable_view + opt.color_control, check_values=self.checkOpts) self.logicObj = cl_builder() diff --git a/pym/cl_kernel_cmd.py b/pym/cl_kernel_cmd.py index d4ca90f..5c0371b 100644 --- a/pym/cl_kernel_cmd.py +++ b/pym/cl_kernel_cmd.py @@ -28,65 +28,69 @@ from cl_lang import lang lang().setLanguage(sys.modules[__name__]) DESCRIPTION = _("The Calculate Linux kernel builder") -CMD_OPTIONS = [{'shortOption':"c", +CMD_OPTIONS = [{'shortOption':"o", + 'longOption':"use-own-config", + 'help':_("use config from kernel directory") + }, + {'shortOption':"c", 'longOption':"kernel-config", 'optVal':"FILE", 'help':_("kernel configuration file to use for compilation") }, - {'longOption':"dmraid", - 'help':_("include DMRAID support") - }, - {'shortOption':"e", - 'longOption':"extraversion", - 'optVal':"VER", - 'help':_("specify extraversion for kernel") - }, {'shortOption':"k", 'longOption':"kerneldir", 'optVal':"DIR", 'help':_("location of the kernel sources") }, + {'shortOption':"m", + 'longOption':"menuconfig", + 'help':_("run menuconfig after oldconfig") + }, + {'longOption':"dmraid", + 'help':_("include DMRAID support") + }, {'longOption':"lvm", 'help':_("include LVM support") }, { 'longOption':"mdadm", 'help':_("copy /etc/mdadm.conf to initramfs") }, - {'shortOption':"m", - 'longOption':"menuconfig", - 'help':_("run menuconfig after oldconfig") - }, {'longOption':"mrproper", 'help':_("run make mrproper before compilation") }, {'longOption':"no-clean", 'help':_("do not run make clean before compilation") }, - {'shortOption':"o", - 'longOption':"use-own-config", - 'help':_("use config from kernel directory") - }, - {'shortOption':"q", - 'help':_("do not display kernel compilation process") + {'shortOption':"e", + 'longOption':"extraversion", + 'optVal':"VER", + 'help':_("specify extraversion for kernel") }, - {'longOption':"initrd", - 'help':_("perform current initramfs optimization")}, {'longOption':"ebuild", - 'help': + 'help': _("build kernel by ebuild phase (need ebuild enviroment)")}, + {'longOption':"set"}, + {'longOption':"initrd", + 'help':_("perform current initramfs optimization")}, {'longOption':"symlink", 'help': - _("set uid symlinks for current kernel in boot directory")} - ] + _("set uid symlinks for current kernel in boot directory")}, + {'shortOption':"q", + 'help':_("do not display kernel compilation process") + }] class kernel_cmd(share_cmd): """Class for work with cl_install by console""" def __init__(self): + setpos = \ + filter(lambda x:x[1].get('longOption')=="set", + enumerate(CMD_OPTIONS))[0][0] + CMD_OPTIONS[setpos] = opt.variable_set[0] self.optobj = opt(package=__app__, version=__version__, description=DESCRIPTION, - option_list= CMD_OPTIONS + opt.variable_control + + option_list= CMD_OPTIONS + opt.variable_view + opt.color_control, check_values=self.checkOpts) self.logicObj = cl_kernel()