From fd8e2f7ecc6e6d8a42184ba1f9cce8261d01659a Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Tue, 2 Aug 2016 21:39:29 +0530 Subject: [PATCH 1/4] Created the global steam command --- steam | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 steam diff --git a/steam b/steam new file mode 100644 index 0000000..49dba8a --- /dev/null +++ b/steam @@ -0,0 +1,6 @@ +#!/usr/local/lib/steam/bin/steam +int main() +{ + return 0; +} + From c3b98a5e86a550067d238ee28d4ba6395f3c5735 Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Tue, 2 Aug 2016 21:39:38 +0530 Subject: [PATCH 2/4] Copied steam command to /usr/bin during installation --- Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.in b/Makefile.in index 62dbc4f..1b7810a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,6 +75,7 @@ install: install_steam force $(INSTALL) -m755 tools/export_users $(DESTDIR)/$(STEAMDIR)/tools $(INSTALL) -m755 tools/debug.pike $(DESTDIR)/$(STEAMDIR)/tools $(INSTALL) -m644 tools/applauncher.pike $(DESTDIR)/$(STEAMDIR)/tools + $(INSTALL) -m755 steam /usr/bin $(INSTALL) -m755 sources/steam/steam $(DESTDIR)/$(STEAMDIR)/bin/$(STEAMBRAND) $(INSTALL) -m755 start $(DESTDIR)/$(STEAMDIR) From 1e08fe72a61a92636050048b188091201355a709 Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Wed, 3 Aug 2016 21:04:21 +0530 Subject: [PATCH 3/4] Processing args and implementing shell sub command --- steam | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/steam b/steam index 49dba8a..fd6f683 100644 --- a/steam +++ b/steam @@ -1,6 +1,17 @@ -#!/usr/local/lib/steam/bin/steam -int main() +#!/usr/local/pike/7.8.866/bin/pike + +void resolveParam(int argc,array(string) argv) +{ + if(argv[1]=="shell") + { + mapping response = Process.run("/usr/local/lib/steam/tools/steam-shell.pike"); + } +} + +int main(int argc,array(string) argv) { + if(argc==1)write("No arguments provided\n");//print help + else resolveParam(argc,argv); return 0; } From ba48caf996bcc71e6f58e27ca3ed8ea49779eb95 Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Thu, 4 Aug 2016 23:53:02 +0530 Subject: [PATCH 4/4] Fixed the working of the shell when started as a sub command. --- steam | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/steam b/steam index fd6f683..6eab8ee 100644 --- a/steam +++ b/steam @@ -4,8 +4,10 @@ void resolveParam(int argc,array(string) argv) { if(argv[1]=="shell") { - mapping response = Process.run("/usr/local/lib/steam/tools/steam-shell.pike"); - } + array command =({"/usr/local/lib/steam/tools/steam-shell.pike"}); + object shell = Process.create_process(command,(["stdin":Stdio.stdin,"stdout":Stdio.stdout,"stderr":Stdio.stderr])); + shell->wait(); + } } int main(int argc,array(string) argv)