diff options
author | 2010-07-01 21:07:20 -0300 | |
---|---|---|
committer | 2010-07-01 21:07:20 -0300 | |
commit | 85bc1c72d7da0a9eac1621048fb4c71678269b63 (patch) | |
tree | 7616f93f75874504d466040f870f05bf48460a1d /scripts | |
parent | fixed the patch handling if no patches are available (diff) | |
download | g-octave-85bc1c72d7da0a9eac1621048fb4c71678269b63.tar.gz g-octave-85bc1c72d7da0a9eac1621048fb4c71678269b63.tar.bz2 g-octave-85bc1c72d7da0a9eac1621048fb4c71678269b63.zip |
added a helper option to g-octave script to return values from the config file
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/g-octave | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/g-octave b/scripts/g-octave index 49b48c5..008b5f9 100755 --- a/scripts/g-octave +++ b/scripts/g-octave @@ -133,6 +133,14 @@ def main(): help = 'search for updates of the package database, patches and auxiliary files' ) + parser.add_option( + '--config', + action = 'store_true', + dest = 'config', + default = False, + help = 'return a value from the configuration file (/etc/g-octave.cfg)' + ) + options, args = parser.parse_args() if not options.colors: @@ -181,7 +189,14 @@ def main(): check_db_cache() conf = Config() - + + if options.config: + try: + print conf.__getattr__(args[0]) + except: + return os.EX_DATAERR + return os.EX_OK + from g_octave.description import Description from g_octave.description_tree import DescriptionTree from g_octave.ebuild import Ebuild, EbuildException |