X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-quote.c;h=02df6781d319fe626ccff733bc2ca0c0dcc9f4e1;hb=f95bbd4578ad67bd09e925bd91da2b0ab159ef9c;hp=97e4fe641420cdca4859d2e2984ff851a308ebef;hpb=f99d78f674887b2fe0d7a6114954d2318b2845b7;p=zpackage diff --git a/zpm-quote.c b/zpm-quote.c index 97e4fe6..02df678 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,9 +88,15 @@ int main(int ac, char **av) { repl = "\"\""; } + count = 0; for (i=argn;i 0 ? separator : "", quoted); + free(quoted); + count++; + } + if (count > 0) { + printf("\n"); } return 0; }