diff options
| author | Matias Linares <matiaslina@openmailbox.org> | 2015-05-07 09:31:49 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-05-07 09:31:49 +0200 |
| commit | 55b1175aa7ee4c3f790c23dcca279dc5ed209725 (patch) | |
| tree | 1dad75f6afafb4c794ea74840ca548ed06b777ae /vis.c | |
| parent | 87c01a74d507885346dc89bfc103870903e56b64 (diff) | |
| download | vis-55b1175aa7ee4c3f790c23dcca279dc5ed209725.tar.gz vis-55b1175aa7ee4c3f790c23dcca279dc5ed209725.tar.xz | |
Add '--' as end of options
Now it works properly, `vis -- -v` edit a file named `-v`. Also added the
proper info to the man page.
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2026,9 +2026,13 @@ int main(int argc, char *argv[]) { die("Could not load syntax highlighting definitions\n"); char *cmd = NULL; + bool end_of_options = false; for (int i = 1; i < argc; i++) { - if (argv[i][0] == '-') { + if (argv[i][0] == '-' && !end_of_options) { switch (argv[i][1]) { + case '-': + end_of_options = true; + break; case 'v': die("vis %s, compiled " __DATE__ " " __TIME__ "\n", VERSION); break; |
