diff options
author | Jack Bracewell <jack.bracewell@unboxedconsulting.com> | 2016-03-29 13:47:30 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-17 17:47:33 +0100 |
commit | 2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec (patch) | |
tree | b0d34745e7573d285340fdf147d9afcf098fb096 /test/functional/fixtures/shell-test.c | |
parent | 0c1f7831649e92b6904ca580ee90acd6ba89d1a8 (diff) | |
download | rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.tar.gz rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.tar.bz2 rneovim-2ea7bfc627e57bc1dfc1a86b66a4be5c7eed2bec.zip |
terminal: Support extra arguments in 'shell'. #4504
Tokenize p_sh if used as default in ex_terminal(). Previously p_sh was
used as the first arg in a list when calling termopen(), this would try
to call an untokenized version of shell, meaning if you had an argument
in 'shell':
set shell=/bin/bash\ --login
the command would fail.
Helped-by: oni-link <knil.ino@gmail.com>
Closes #3999
Diffstat (limited to 'test/functional/fixtures/shell-test.c')
-rw-r--r-- | test/functional/fixtures/shell-test.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c index d9ec254aff..3f3976ece5 100644 --- a/test/functional/fixtures/shell-test.c +++ b/test/functional/fixtures/shell-test.c @@ -12,8 +12,12 @@ static void help(void) puts(" shell-test"); puts(" shell-test EXE"); puts(" Prints \"ready $ \" to stderr."); + puts(" shell-test -t {prompt text}"); + puts(" Prints \"{prompt text} $ \" to stderr."); puts(" shell-test EXE \"prog args...\""); puts(" Prints \"ready $ prog args...\\n\" to stderr."); + puts(" shell-test -t {prompt text} EXE \"prog args...\""); + puts(" Prints \"{prompt text} $ progs args...\" to stderr."); puts(" shell-test REP {byte} \"line line line\""); puts(" Prints \"{lnr}: line line line\\n\" to stdout {byte} times."); puts(" I.e. for `shell-test REP ab \"test\"'"); @@ -30,7 +34,17 @@ int main(int argc, char **argv) } if (argc >= 2) { - if (strcmp(argv[1], "EXE") == 0) { + if (strcmp(argv[1], "-t") == 0) { + if (argc < 3) { + fprintf(stderr,"Missing prompt text for -t option\n"); + return 5; + } else { + fprintf(stderr, "%s $ ", argv[2]); + if (argc >= 5 && (strcmp(argv[3], "EXE") == 0)) { + fprintf(stderr, "%s\n", argv[4]); + } + } + } else if (strcmp(argv[1], "EXE") == 0) { fprintf(stderr, "ready $ "); if (argc >= 3) { fprintf(stderr, "%s\n", argv[2]); |