From 05ed5fc8622888dffd27778c08d66e2ce50a1c68 Mon Sep 17 00:00:00 2001 From: tkral Date: Wed, 3 Aug 2011 08:03:24 -0700 Subject: [PATCH] [#1009] Add play version command --- documentation/commands/cmd-version.txt | 12 ++++++++++++ framework/pym/play/commands/version.py | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 documentation/commands/cmd-version.txt create mode 100644 framework/pym/play/commands/version.py diff --git a/documentation/commands/cmd-version.txt b/documentation/commands/cmd-version.txt new file mode 100644 index 0000000000..8bbfb0baed --- /dev/null +++ b/documentation/commands/cmd-version.txt @@ -0,0 +1,12 @@ +~ Name: +~ ~~~~~ +~ version -- Print the framework version +~ +~ Synopsis: +~ ~~~~~~~~~ +~ play version +~ +~ Description: +~ ~~~~~~~~~~~~ +~ Prints the version of the Play framework currently being used. +~ diff --git a/framework/pym/play/commands/version.py b/framework/pym/play/commands/version.py new file mode 100644 index 0000000000..309d6e187c --- /dev/null +++ b/framework/pym/play/commands/version.py @@ -0,0 +1,14 @@ + +COMMANDS = ['version'] + +HELP = { + 'version': 'Print the framework version' +} + +def execute(**kargs): + env = kargs.get("env") + showLogo = kargs.get("showLogo") + + # If we've shown the logo, then the version has already been printed + if not showLogo: + print env["version"]