Change the --noattach switch to --attach on osimctrl start and restart commands. Always attaching by default is too annoying when you know that things work.

This commit is contained in:
Justin Clark-Casey
2014-06-05 17:48:37 +01:00
parent cb9f07840b
commit 066c1febd8
2 changed files with 9 additions and 8 deletions
+4 -3
View File
@@ -49,11 +49,12 @@ status - get the current status of the component.
There are also a few optional switches
-n, --noattach
-a, --attach
Do not automatically attach to the screen component once it has started.
Only valid for start and restart commands. If set then osimctrl automatically
attaches you to the screen of the [re]started component.
-a, --autorestart
-r, --autorestart
If a component fails, then automatically restart it. If you use this option
then you can only stop the component with the stop command instead of manually
@@ -132,7 +132,7 @@ class OSimCtrl:
print >> sys.stderr, "ERROR: %s did not start." % self._componentName
return False
if not opts.noattach:
if opts.attach:
execCmd("%s -x %s" % (self._screenPath, self._screenName))
return True
@@ -213,15 +213,15 @@ def main(binaryPath, screenPath, switches, monoPath, componentName, screenName):
help = "\n".join(["%s - %s" % (k, v['help']) for k, v in commands.iteritems()]))
parser.add_argument(
'-a',
'-r',
'--autorestart',
help = "Automatically restart component if it crashes. With this option, it can only be stopped via the stop command, not by manually attaching to the screen and shutting down the component.",
action = "store_true")
parser.add_argument(
'-n',
'--noattach',
help = "Start and restart commmands will not attach to the started screen instance.",
'-a',
'--attach',
help = "Start and restart commmands will also attach to the started screen instance.",
action = "store_true")
opts = parser.parse_args()