aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd-launch.c
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2024-01-11 23:07:18 -0600
committerLibravatar bigfoot547 <[email protected]>2024-01-11 23:07:18 -0600
commit8667391ffee160409cfb857e7bba5e2df58ecb06 (patch)
tree87fb302520451f8d3da276d12965ff17700496e9 /src/cmd-launch.c
parentoops forgot to update profile (diff)
add detach stuff
Diffstat (limited to 'src/cmd-launch.c')
-rw-r--r--src/cmd-launch.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cmd-launch.c b/src/cmd-launch.c
index 2d44b44..02a4231 100644
--- a/src/cmd-launch.c
+++ b/src/cmd-launch.c
@@ -12,8 +12,14 @@ unsigned cmd_launch2(struct l2_context_node *ctx, char **args)
unsigned ures;
int res;
- if (*args) {
- CMD_FATAL0("sorry launch settings aren't implemented yet");
+ bool detach = true;
+
+ for (char **cur = args; *cur; ++cur) {
+ if (!strcmp(*cur, "--nodetach")) {
+ detach = false;
+ } else {
+ CMD_FATAL(CMD_MSG_UNKNOWN_ARGUMENT, *cur);
+ }
}
char *instancename = NULL;
@@ -62,6 +68,10 @@ unsigned cmd_launch2(struct l2_context_node *ctx, char **args)
if (l2_user_update_profile(user) < 0) {
CMD_FATAL0("Failed to update profile");
}
+
+ if (l2_user_save() < 0) {
+ CMD_FATAL0("Failed to save user");
+ }
}
struct l2_launch launch = { 0 };
@@ -70,6 +80,7 @@ unsigned cmd_launch2(struct l2_context_node *ctx, char **args)
}
launch.user = user;
+ launch.detach = detach;
if (l2_launch_init_substitutor(&launch) < 0) {
CMD_FATAL0("Failed to initialize argument substitutor");