aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-07-01 21:07:20 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-07-01 21:07:20 -0300
commit85bc1c72d7da0a9eac1621048fb4c71678269b63 (patch)
tree7616f93f75874504d466040f870f05bf48460a1d /scripts
parentfixed the patch handling if no patches are available (diff)
downloadg-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-xscripts/g-octave17
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