Browse Source

Refactor some parser code

Rename scheduler_parser to start_engine parser to make more sense,
also add the -p (purge) option that an earlier commit needs.

Change-Id: I5058e6f60804166e71fd5fefb2e298d27630b3d8
Pranesh Pandurangan 4 years ago
parent
commit
b1ca5a4c91
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      entropy/__main__.py

+ 8
- 6
entropy/__main__.py View File

@@ -162,12 +162,14 @@ def parse():
162 162
                                         help='Engine')
163 163
     register_repair_parser.set_defaults(func=register_repair)
164 164
 
165
-    scheduler_parser = subparsers.add_parser('start-engine',
166
-                                             help='Start an entropy engine')
167
-    scheduler_parser.add_argument('-n', dest='name', help='Name')
168
-    scheduler_parser.add_argument('-c', dest='engine_cfg',
169
-                                  help='path to engine cfg')
170
-    scheduler_parser.set_defaults(func=start_engine)
165
+    start_engine_parser = subparsers.add_parser('start-engine',
166
+                                                help='Start an entropy engine')
167
+    start_engine_parser.add_argument('-n', dest='name', help='Name')
168
+    start_engine_parser.add_argument('-c', dest='engine_cfg',
169
+                                     help='path to engine cfg')
170
+    start_engine_parser.add_argument('-p', dest='purge', action='store_true',
171
+                                     help='Purge disabled engines')
172
+    start_engine_parser.set_defaults(func=start_engine)
171 173
 
172 174
     stop_engine_parser = subparsers.add_parser('stop-engine',
173 175
                                                help='Stop an entropy engine')

Loading…
Cancel
Save