diff options
author | Chris Johns <chris@kaka.contemporary.net.au> | 2012-10-30 02:40:18 +1100 |
---|---|---|
committer | Chris Johns <chris@kaka.contemporary.net.au> | 2012-10-30 02:40:18 +1100 |
commit | 864360e67e96984e2317f3e4d4ba6640a774f26b (patch) | |
tree | c9e8879ff7ddc14228e1d9df043afb7fba681485 /tb/defaults.py | |
parent | Merged in SpecBuilder FreeBSD support. (diff) | |
download | rtems-source-builder-864360e67e96984e2317f3e4d4ba6640a774f26b.tar.bz2 |
Add a force option.
Diffstat (limited to 'tb/defaults.py')
-rw-r--r-- | tb/defaults.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tb/defaults.py b/tb/defaults.py index 78a56d1..a4c4940 100644 --- a/tb/defaults.py +++ b/tb/defaults.py @@ -190,6 +190,7 @@ class command_line: _defaults = { 'params' : [], 'warn-all' : '0', 'quiet' : '0', + 'force' : '0', 'trace' : '0', 'dry-run' : '0', 'no-clean' : '0', @@ -210,7 +211,8 @@ class command_line: '--targetcxxflags' : '_targetcxxflags', '--libstdcxxflags' : '_libstdcxxflags' } - _long_true_opts = { '--trace' : '_trace', + _long_true_opts = { '--force' : '_force', + '--trace' : '_trace', '--dry-run' : '_dry_run', '--warn-all' : '_warn_all', '--no-clean' : '_no_clean', @@ -224,6 +226,7 @@ class command_line: def _help(self): print '%s: [options] [args]' % (self.command_name) print 'Options and arguments:' + print '--force : Create directories that are not present' print '--trace : Trace the execution (not current used)' print '--dry-run : Do everything but actually run the build' print '--warn-all : Generate warnings' @@ -360,7 +363,9 @@ class command_line: if not lo: raise error.general('invalid argument: ' + a) else: - if a == '-n': + if a == '-f': + self.opts['force'] = '1' + elif a == '-n': self.opts['dry-run'] = '1' elif a == '-q': self.opts['quiet'] = '1' @@ -395,6 +400,9 @@ class command_line: def command(self): return os.path.join(self.command_path, self.command_name) + def force(self): + return self.opts['force'] != '0' + def dry_run(self): return self.opts['dry-run'] != '0' |