Anonymous avatar Anonymous committed c2feadd

switch debug/reload

Comments (0)

Files changed (1)

flaskext/script.py

     
     def get_options(self):
 
-        return (
+        # TBD : if use_debugger or use_reloader is true 
+
+        options = (
+
                 Option('-t', '--host',
                        dest='host',
                        default=self.host),
                        type=int,
                        default=self.port),
 
-                Option('-d', '--debug',
-                       action='store_true',
-                       dest='use_debugger',
-                       default=self.use_debugger),
-        
-                Option('-r', '--reload',
-                       action='store_true',
-                       dest='use_reloader',
-                       default=self.use_reloader))
+        ) 
+
+        if self.use_debugger:
+            options += (Option('-d', '--no-debug',
+                               action='store_false',
+                               dest='use_debugger',
+                               default=self.use_debugger),)
+
+        else:
+            options += (Option('-d', '--debug',
+                               action='store_true',
+                               dest='use_debugger',
+                               default=self.use_debugger),)
+
+        if self.use_reloader:
+            options += (Option('-r', '--no-reload',
+                               action='store_false',
+                               dest='use_reloader',
+                               default=self.use_reloader),)
+
+        else:
+            options += (Option('-r', '--reload',
+                               action='store_true',
+                               dest='use_debugger',
+                               default=self.use_debugger),)
+
+        return options
 
     def run(self, host, port, use_debugger, use_reloader):
         app = _request_ctx_stack.top.app
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.