1# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2# vim: set filetype=python: 3# This Source Code Form is subject to the terms of the Mozilla Public 4# License, v. 2.0. If a copy of the MPL was not distributed with this 5# file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 7option("--set-foo", help="set foo") 8 9 10@depends("--set-foo") 11def foo(value): 12 if value: 13 return True 14 15 16set_config("FOO", foo) 17 18 19option("--set-bar", help="set bar") 20 21 22@depends("--set-bar") 23def bar(value): 24 return bool(value) 25 26 27set_config("BAR", bar) 28 29 30option("--set-value", nargs=1, help="set value") 31 32 33@depends("--set-value") 34def set_value(value): 35 if value: 36 return value[0] 37 38 39set_config("VALUE", set_value) 40 41 42option("--set-name", nargs=1, help="set name") 43 44 45@depends("--set-name") 46def set_name(value): 47 if value: 48 return value[0] 49 50 51set_config(set_name, True) 52