X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=zpm-quote.c;h=d0006e391a9beeade7a49e6dc4567dbe9c74dacb;hp=1aea24b4dbb0811a769b0e37f9c0b1ea005459be;hb=884d3cefd3b5d5ba5c6f5af0f0c87168005af3f3;hpb=1201f879e78f874973e2d90aa73f9cadfe9e8438 diff --git a/zpm-quote.c b/zpm-quote.c index 1aea24b..d0006e3 100644 --- a/zpm-quote.c +++ b/zpm-quote.c @@ -65,12 +65,15 @@ int main(int ac, char **av) { int ch = '\''; int opt, shellmode = 0, addquotes = 0, ident = 0; char *repl = "''"; + int count = 0; + char *separator = "\n"; - while ((opt = getopt(ac, av, "sqi")) != -1) { + while ((opt = getopt(ac, av, "sqid:")) != -1) { switch (opt) { case 's': shellmode = 1; break; case 'q': addquotes = 1; break; case 'i': ident = 1; break; + case 'd': separator = optarg; break; default: exit(EXIT_FAILURE); break; @@ -85,10 +88,13 @@ int main(int ac, char **av) { repl = "\"\""; } + count = 0; for (i=argn;i 0 ? separator : "", quoted); free(quoted); + count++; } + printf("\n"); return 0; }