added missing command test message

This commit is contained in:
Kevin Froman 2017-12-28 14:30:15 -05:00
parent 0aa1318146
commit c158d3804c
1 changed files with 10 additions and 2 deletions

View File

@ -15,9 +15,16 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' '''
import sys, os, threading, configparser, base64, random import sys, os, threading, configparser, base64, random
import gui, api import gui, api, colors
from colors import Colors
# Detect python 2
if sys.version.major == '2':
print "Onion requires Python 3"
class Onionr: class Onionr:
def __init__(self): def __init__(self):
colors = Colors()
# Get configuration and Handle commands # Get configuration and Handle commands
@ -47,7 +54,7 @@ class Onionr:
command = sys.argv[1].lower() command = sys.argv[1].lower()
except IndexError: except IndexError:
command = '' command = ''
else: finally:
if command == 'start': if command == 'start':
self.daemon() self.daemon()
elif command == 'stop': elif command == 'stop':
@ -57,6 +64,7 @@ class Onionr:
elif command == 'help' or command == '--help': elif command == 'help' or command == '--help':
self.showHelp() self.showHelp()
else: else:
print(colors.RED, 'Invalid Command', colors.RESET)
return return
return return
def daemon(self): def daemon(self):