Skip to content

Commit

Permalink
Prints version on -v
Browse files Browse the repository at this point in the history
  • Loading branch information
tcr3dr committed Oct 23, 2015
1 parent c09973a commit 74a3b1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dronekit_sitl/__init__.py
Original file line number Diff line number Diff line change
@@ -335,6 +335,11 @@ def main(args=None):
print(system + '-' + k)
sys.exit(0)

if len(args) > 0 and (args[0] == '--version' or args[0] == '-v'):
import pkg_resources
print(pkg_resources.get_distribution(sys.modules[__name__].__package__).version)
sys.exit(0)

if len(args) > 0 and args[0] == '--help':
print('You can look up help for a particular vehicle, e.g.:', file=sys.stderr)
print(' dronekit-sitl copter --help')

0 comments on commit 74a3b1b

Please sign in to comment.