import sys
import os

HOME = os.path.expanduser('~')
KEEP_FILE = HOME + '/.keep'  # File to store commands
KEEPN_FILE = HOME + '/.keep_info'  # File to store number of commands


def print_error_message():
    print("Usages :\n1. keep [options]")
    print("Options: show | list ")
    print("2. keep <command_name> \n <brief_description_of_the_command>")

def main():
    command = sys.argv[1:]
    if not command:
        print_error_message()
        sys.exit(2)
    elif command[0] == 'list':
        try:
            f = open(KEEP_FILE, 'r')
        except IOError:
            print("You have no saved commands.")
            sys.exit(2)
        cmdno = 0
        for line in f.readlines():
            cmdno += 1
            print(str(cmdno) + "." + line[1:], end="")
        f.close()
    elif command[0] == 'reset':
        try:
            os.remove(KEEP_FILE)
        except FileNotFoundError:
            pass
        try:
            os.remove(KEEPN_FILE)
        except FileNotFoundError:
            pass
    else:
        if not os.path.exists(KEEPN_FILE):
            f = open(KEEPN_FILE, 'w')
            f.write('0\n')
            f.close()

        f = open(KEEP_FILE, 'a')
        new = ' '.join(command)
        desc = input("Description : ")
        f.write('$ ' + new + ' : ')
        f.write(desc + '\n')
        f.close()

        f = open(KEEPN_FILE, 'r')
        n = int(f.readline())
        f.close()
        f = open(KEEPN_FILE, 'w')
        f.write(str(n+1) + '\n')
        f.close()


"""
    Structure of the file ~/.keep
    -----------------------------

    $ + Command + : + Description

    Structure of the file ~/.keep_info
    ----------------------------------

    Total count of commands saved
"""


@@ -264,18 +264,19 @@
 ns: 
-show %7C lis
+list %7C rese
 t %22)
@@ -819,37 +819,199 @@
 reset':%0A        
-try:%0A
+prompt = input(%22This will erase all of your stored commands. %22%0A                       %22Proceed ? (y/N)%22)%0A        if prompt.strip() in ('y', 'Y'):%0A            try:%0A    
             os.r
@@ -1023,24 +1023,28 @@
 (KEEP_FILE)%0A
+    
         exce
@@ -1073,29 +1073,37 @@
             
+    
 pass%0A
+    
         try:
@@ -1107,32 +1107,36 @@
 ry:%0A            
+    
 os.remove(KEEPN_
@@ -1137,24 +1137,28 @@
 KEEPN_FILE)%0A
+    
         exce
@@ -1187,28 +1187,78 @@
             
-pass
+    pass%0A        else:%0A            print(%22Aborted.%5Cn%22)
 %0A    else:%0A 

Add info about keep reset