diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-06-28 12:55:05 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-06-28 22:54:05 +0900 |
commit | 1262ead05ce575328799da217866a8f38a26ed3e (patch) | |
tree | 278a01e3b7f628f298c2b2f6d81feecc793caf51 /bin | |
parent | bead388d470925f3475c9a79840ef017017d1df4 (diff) |
add '--version' command line option
Just output version information and exit.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ryu-manager | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/ryu-manager b/bin/ryu-manager index bb945570..cfa56a0a 100755 --- a/bin/ryu-manager +++ b/bin/ryu-manager @@ -27,6 +27,7 @@ monkey.patch_all() from ryu import log log.early_init_log(logging.DEBUG) +from ryu import version from ryu import utils from ryu.app import wsgi from ryu.base.app_manager import AppManager @@ -34,6 +35,7 @@ from ryu.controller import controller FLAGS = gflags.FLAGS +gflags.DEFINE_bool('version', False, 'output version information and exit') gflags.DEFINE_multistring('app_lists', [], 'application module name to run') @@ -42,6 +44,11 @@ gflags.DEFINE_multistring('app_lists', def main(): utils.find_flagfile() args = FLAGS(sys.argv) + + if FLAGS.version: + print 'ryu-manager %s' % version + sys.exit(0) + log.init_log() if len(args) > 1: |