Add basic command line framework
`wutta setup` is the only real sub/command yet, and it does nothing
This commit is contained in:
parent
417f7e5c38
commit
005f43d14e
15 changed files with 742 additions and 12 deletions
|
@ -17,7 +17,8 @@ Much remains to be done, and it may be slow going since I'll be trying
|
|||
to incorporate this package into the main Rattail package along the
|
||||
way. So we'll see where this goes...
|
||||
|
||||
At this point the main focus is the configuration interface.
|
||||
Main points of focus so far are the configuration and command line
|
||||
interfaces.
|
||||
|
||||
|
||||
Basic Usage
|
||||
|
@ -37,6 +38,7 @@ Create a config file, e.g. ``my.conf``:
|
|||
bar = A
|
||||
baz = 2
|
||||
feature = true
|
||||
words = the quick brown fox
|
||||
|
||||
In your app, load the config and reference its values as needed::
|
||||
|
||||
|
@ -44,13 +46,18 @@ In your app, load the config and reference its values as needed::
|
|||
|
||||
config = make_config('/path/to/my.conf')
|
||||
|
||||
config.get('foo.bar') # returns 'A'
|
||||
# this call.. ..returns this value
|
||||
|
||||
config.get('foo.baz') # returns '2'
|
||||
config.get_int('foo.baz') # returns 2
|
||||
config.get('foo.bar') # 'A'
|
||||
|
||||
config.get('foo.feature') # returns 'true'
|
||||
config.get_bool('foo.feature') # returns True
|
||||
config.get('foo.baz') # '2'
|
||||
config.get_int('foo.baz') # 2
|
||||
|
||||
config.get('foo.feature') # 'true'
|
||||
config.get_bool('foo.feature') # True
|
||||
|
||||
config.get('foo.words') # 'the quick brown fox'
|
||||
config.get_list('foo.words') # ['the', 'quick', 'brown', 'fox']
|
||||
|
||||
|
||||
Contents
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue