ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] [RFC PATCH 2/2] add execr command


From: Ali Gholami Rudi
Subject: [RP] [RFC PATCH 2/2] add execr command
Date: Wed, 19 Nov 2008 11:52:41 +0330
User-agent: Mutt/1.5.18 (2008-05-17)

The execr (short for raw exec) command, executes a program without
forking a sh.
---
 doc/ratpoison.texi |    4 ++++
 src/actions.c      |    9 +++++++++
 src/actions.h      |    1 +
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index aa0e3c1..83c5059 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -1548,6 +1548,10 @@ window will open in. The client must be netwm compliant 
for this to
 work.
 @end deffn
 
address@hidden Command execr @var{command}
+Execute a command without forking a shell.
address@hidden deffn
+
 @deffn Command getenv @var{env}
 Display the value of the environment variable, @var{env}.
 @end deffn
diff --git a/src/actions.c b/src/actions.c
index 12eddd3..777609a 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -229,6 +229,8 @@ init_user_commands(void)
   add_command ("execf",                cmd_execf,      2, 2, 2, 
               "frame to execute in:", arg_FRAME,
               "/bin/sh -c ", arg_SHELLCMD);
+  add_command ("execr",                cmd_execr,      1, 1, 1,
+               "", arg_SHELLCMD);
   add_command ("fdump",         cmd_fdump,      1, 0, 0,
                "", arg_NUMBER);
   add_command ("focus",         cmd_next_frame, 0, 0, 0);
@@ -2574,6 +2576,13 @@ cmd_execf (int interactive, struct cmdarg **args)
   return cmdret_new (RET_SUCCESS, NULL);
 }
 
+cmdret *
+cmd_execr (int interactive, struct cmdarg **args)
+{
+  spawn (ARG_STRING (0), 1, current_frame());
+  return cmdret_new (RET_SUCCESS, NULL);
+}
+
 #define MAXARGCNT      16
 #define MAXARGLEN      64
 
diff --git a/src/actions.h b/src/actions.h
index 3fcd3b7..d7094ce 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -117,6 +117,7 @@ RP_CMD (escape);
 RP_CMD (exec);
 RP_CMD (execa);
 RP_CMD (execf);
+RP_CMD (execr);
 RP_CMD (fdump);
 RP_CMD (focusdown);
 RP_CMD (focuslast);
-- 
1.6.0.2.GIT





reply via email to

[Prev in Thread] Current Thread [Next in Thread]