S.Çağlar Onur | a95895d | 2015-02-09 13:34:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python |
Scott Baker | d14ffa4 | 2014-05-15 15:29:47 -0700 | [diff] [blame] | 2 | import sys |
Scott Baker | 76a840e | 2015-02-11 21:38:09 -0800 | [diff] [blame] | 3 | from xos.config import Config |
Scott Baker | d14ffa4 | 2014-05-15 15:29:47 -0700 | [diff] [blame] | 4 | |
| 5 | def help(): |
| 6 | print "syntax: %s get name [default]" % sys.argv[0] |
| 7 | |
| 8 | def main(): |
| 9 | c = Config() |
| 10 | |
| 11 | if len(sys.argv)<=1: |
| 12 | help() |
| 13 | return |
| 14 | |
| 15 | if sys.argv[1] == "get": |
| 16 | if len(sys.argv)==4: |
| 17 | print getattr(c, sys.argv[2], sys.argv[3]) |
| 18 | elif len(sys.argv)==3: |
| 19 | print getattr(c, sys.argv[2]) |
| 20 | else: |
| 21 | help() |
| 22 | else: |
| 23 | help() |
| 24 | |
| 25 | main() |