1.1.3 added warning before flushing config, etc.

This commit is contained in:
k4yt3x 2018-10-17 13:56:25 -04:00
parent 9a2814893d
commit 0b20fd4356

View File

@ -19,7 +19,7 @@ import subprocess
import sys import sys
import traceback import traceback
VERSION = '1.1.2' VERSION = '1.1.3'
COMMANDS = [ COMMANDS = [
'Interactive', 'Interactive',
'ShowPeers', 'ShowPeers',
@ -178,6 +178,14 @@ class ProfileManager(object):
def new_profile(self): def new_profile(self):
""" Create new profile and flush the peers list """ Create new profile and flush the peers list
""" """
# Warn the user before flushing configurations
avalon.warning('This will flush the currently loaded profile!')
if len(self.peers) != 0:
if not avalon.ask('Continue?', False):
return
# Reset self.peers and start enrolling new peer data
self.peers = [] self.peers = []
get_peers_settings() get_peers_settings()
@ -339,13 +347,13 @@ def print_help():
""" """
help_lines = [ help_lines = [
'\n{}Commands are not case-sensitive{}'.format(avalon.FM.BD, avalon.FM.RST), '\n{}Commands are not case-sensitive{}'.format(avalon.FM.BD, avalon.FM.RST),
'Interactive', 'Interactive // launch interactive shell',
'ShowPeers', 'ShowPeers // show all peer information',
'LoadProfile [profile path]', 'LoadProfile [profile path] // load profile from profile_path',
'SaveProfile [profile path]', 'SaveProfile [profile path] // save profile to profile_path',
'NewProfile', 'NewProfile // create new profile',
'AddPeers', 'AddPeers // add new peers into the current profile',
'GenerateConfigs [output directory]', 'GenerateConfigs [output directory] // generate configuration files',
'Exit', 'Exit',
'Quit', 'Quit',
'', '',