diff options
author | Basile Starynkevitch <basile.starynkevitch@inria.fr> | 2003-10-29 15:08:59 +0000 |
---|---|---|
committer | Basile Starynkevitch <basile.starynkevitch@inria.fr> | 2003-10-29 15:08:59 +0000 |
commit | a4564cec5560b2ba726bd63dddd6b0ce31a71fe3 (patch) | |
tree | 87a667ba34a26ebbc23f44f8ee2c05e86a085eaa | |
parent | 9e46ceb9e22e16bd3625a880f432278bb9f01ae3 (diff) |
added shell command for user
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5890 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | debugger/command_line.ml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/debugger/command_line.ml b/debugger/command_line.ml index 0fbaa5275..939f64ceb 100644 --- a/debugger/command_line.ml +++ b/debugger/command_line.ml @@ -209,6 +209,11 @@ let instr_cd ppf lexbuf = | Sys_error s -> error s +let instr_shell ppf lexbuf = + let cmd = argument_eol argument lexbuf in + let err = Sys.command cmd in + if (err != 0) then eprintf "Shell ommand %S failed with exit code %d\n%!" cmd err + let instr_pwd ppf lexbuf = eol lexbuf; ignore(system "/bin/pwd") @@ -891,6 +896,9 @@ With no argument, reset the search path." }; { instr_name = "quit"; instr_prio = false; instr_action = instr_quit; instr_repeat = false; instr_help = "exit the debugger." }; + { instr_name = "shell"; instr_prio = false; + instr_action = instr_shell; instr_repeat = true; instr_help = +"Execute a given COMMAND thru the usual shell (using system call)." }; (* Displacements *) { instr_name = "run"; instr_prio = true; instr_action = instr_run; instr_repeat = true; instr_help = |