Skip to content

Commit

Permalink
Command line options
Browse files Browse the repository at this point in the history
  • Loading branch information
ZonnCash committed Nov 20, 2017
1 parent 4cf917b commit 31d7365
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def get_argarse():
parser = argparse.ArgumentParser()
parser.add_argument('--config', type=str, required=False)
parser.add_argument('--rpc-port', type=int, required=False)
parser.add_argument('--repair', action='store_true', default=False, required=False)
parser.add_argument('--sentinel', action='store_true', default=False, required=False)
return parser

def get_args():
Expand Down
12 changes: 11 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def fix_masternode(data_folder):

# It must have a masternodeprivkey
if 'masternodeprivkey' not in tokens:
print(colored('Your desire.conf does not contain a \'masternodeprivkey\' entry, please set it up before opening wallet', 'red'))
print(colored('Your desire.conf does not contain a \'masternodeprivkey\' entry, please set it up before opening your wallet', 'red'))

# Rewrite config
with open(config.desire_conf, 'w') as fp:
Expand Down Expand Up @@ -151,6 +151,16 @@ def flush_input():
msvcrt.getch()

def menu():
args = config.get_args()

if args.repair and args.sentinel:
print(colored('Do not specify --repair and --sentinel at the same time', 'red'))
sys.exit(1)
elif args.sentinel:
return 1
elif args.repair:
return 2

print('Select an option:')
print('\t1. Start sentinel')
print('\t2. Fix wallet and masternode')
Expand Down

0 comments on commit 31d7365

Please sign in to comment.