<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -6,6 +6,8 @@ DATABASE_USER = &quot;root&quot;
 DATABASE_PASSWORD = &quot;&quot;
 DATABASE_NAME = &quot;migration_example&quot;
 
+###############################################################################
+
 # There is an alternative and convenient way to create your configuration
 # files making it possible to override values. If you use 'os.getenv' like
 # in the example below, you can pass value to override the default settings
@@ -24,6 +26,14 @@ DATABASE_NAME = &quot;migration_example&quot;
 
 ###############################################################################
 
+# In some cases you will not want to write database passwords in the config
+# files (e.g. production databases passwords). You can configure the password 
+# to be asked for you in the command line.
+#
+# DATABASE_PASSWORD = &quot;&lt;&lt;ask_me&gt;&gt;&quot;
+
+###############################################################################
+
 # Relative path from the location of this file.
 # You can put multiple directories if you want, separated by ':'.
 # The path can be absolute or relative (recommended).</diff>
      <filename>example/simple-db-migrate.conf</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+from getpass import getpass
 import codecs
 import sys
 
@@ -11,12 +12,13 @@ SIMPLE_DB_MIGRATE_VERSION = '1.3.7'
 sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
 
 def run():
+    cli = CLI()
     try:
-        (options, args) = CLI().parse()
+        (options, args) = cli.parse()
 
         if options.simple_db_migrate_version:
             msg = 'simple-db-migrate v%s' % SIMPLE_DB_MIGRATE_VERSION
-            CLI().info_and_exit(msg)
+            cli.info_and_exit(msg)
 
         if options.show_colors:
             CLI.show_colors()
@@ -36,11 +38,20 @@ def run():
             log_level = 2
         
         config.put('log_level', log_level)
+        
+        # Ask the password for user if configured
+        if config.get('db_password') == '&lt;&lt;ask_me&gt;&gt;':
+            cli.msg('\nPlease inform password to connect to database &quot;%s@%s:%s&quot;' % (config.get('db_user'), config.get('db_host'), config.get('db_name')))
+            passwd = getpass()
+            config.remove('db_password')
+            config.put('db_password', passwd)
 
         # If CLI was correctly parsed, execute db-migrate.
         Main(config).execute()
+    except KeyboardInterrupt:
+        cli.info_and_exit(&quot;\nExecution interrupted by user...&quot;)
     except Exception, e:
-        CLI().error_and_exit(str(e))
+        cli.error_and_exit(str(e))
         
 if __name__ == '__main__':
     run()</diff>
      <filename>src/__init__.py</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,13 @@ class Config(object):
         if config_key in self._config:
             raise Exception(&quot;the configuration key '%s' already exists and you cannot override any configuration&quot; % config_key)
         self._config[config_key] = config_value
-        
+    
+    def remove(self, config_key):
+        try:
+            del self._config[config_key]
+        except KeyError:
+            raise Exception(&quot;invalid configuration key ('%s')&quot; % config_key)
+    
     def _parse_migrations_dir(self, dirs, config_dir=''):
         abs_dirs = []
         for dir in dirs.split(':'):</diff>
      <filename>src/config.py</filename>
    </modified>
    <modified>
      <diff>@@ -106,10 +106,7 @@ class Main(object):
                 
                 # paused mode
                 if self.config.get(&quot;paused_mode&quot;):
-                    try:
-                        raw_input(&quot;* press &lt;enter&gt; to continue... &quot;)
-                    except KeyboardInterrupt:
-                        self.cli.info_and_exit(&quot;\nExecution interrupted by the user...&quot;)
+                    raw_input(&quot;* press &lt;enter&gt; to continue... &quot;)
 
             # recording the last statement executed
             sql_statements_executed.append(sql)</diff>
      <filename>src/main.py</filename>
    </modified>
    <modified>
      <diff>@@ -101,6 +101,17 @@ MIGRATIONS_DIR = os.getenv('MIGRATIONS_DIR') or 'example'
         result = config.get_variable(locals(), 'weird_variable', 'weirdest_variable')
         
         assert result == weird_variable
+        
+    def test_it_should_delete_config(self):
+        config_path = os.path.abspath('sample.conf')
+        config = FileConfig(config_path)
+        config.put('sample_config', 'TEST')
+        
+        assert config.get('sample_config') == 'TEST'
+        
+        config.remove('sample_config')
+        
+        self.assertRaises(Exception, config.get, 'sample_config')
 
 class InPlaceConfigTest(unittest.TestCase):
     </diff>
      <filename>tests/config_test.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>21427d0de461921f60a5d867438b170eaa43b05c</id>
    </parent>
  </parents>
  <author>
    <name>Guilherme Chapiewski</name>
    <email>guilherme.chapiewski@gmail.com</email>
  </author>
  <url>http://github.com/guilhermechapiewski/simple-db-migrate/commit/56e0183cad7dd9afcdca8261b8b61a5a0e242925</url>
  <id>56e0183cad7dd9afcdca8261b8b61a5a0e242925</id>
  <committed-date>2009-10-06T13:05:57-07:00</committed-date>
  <authored-date>2009-10-06T13:05:57-07:00</authored-date>
  <message>#48: New option to ask for passwords instead of configuring them on the config file.</message>
  <tree>2944642a42afcca8af11eb789be6662372c9374b</tree>
  <committer>
    <name>Guilherme Chapiewski</name>
    <email>guilherme.chapiewski@gmail.com</email>
  </committer>
</commit>
