Add --version command line argument

pull/292/merge
Paulus Schoutsen 2015-08-30 00:59:27 -07:00
parent a3812a324c
commit 81466246cf
1 changed files with 2 additions and 1 deletions

View File

@ -7,7 +7,7 @@ import argparse
from homeassistant import bootstrap
import homeassistant.config as config_util
from homeassistant.const import EVENT_HOMEASSISTANT_START
from homeassistant.const import __version__, EVENT_HOMEASSISTANT_START
def ensure_config_path(config_dir):
@ -54,6 +54,7 @@ def get_arguments():
""" Get parsed passed in arguments. """
parser = argparse.ArgumentParser(
description="Home Assistant: Observe, Control, Automate.")
parser.add_argument('--version', action='version', version=__version__)
parser.add_argument(
'-c', '--config',
metavar='path_to_config_dir',