7
from charms.layer import options
10
parser = argparse.ArgumentParser(description='Access layer options.')
11
parser.add_argument('section',
12
help='the section, or layer, the option is from')
13
parser.add_argument('option',
14
help='the option to access')
16
args = parser.parse_args()
17
value = options(args.section).get(args.option, '')
18
if isinstance(value, bool):
19
sys.exit(0 if value else 1)
20
elif isinstance(value, list):