aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/clump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/clump.c')
-rw-r--r--src/bin/clump.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/clump.c b/src/bin/clump.c
index 18c8e5b..ec06d17 100644
--- a/src/bin/clump.c
+++ b/src/bin/clump.c
@@ -8,17 +8,19 @@
//printf "a a\na b\na c\nb a\nb b\nc a\nc b\n" | clump
//still working on the name.
-int main() {
+int main(int argc,char *argv[]) {
char line[256];
char *id;
+ char sep=' ';
char *value;
char *oldid=malloc(1);
*oldid=0;
+ if(argc > 1) sep=argv[1][0];
while(fgets(line,sizeof(line),stdin)) {
id=line;
if(strchr(line,'\n')) *strchr(line,'\n')=0;
- if(strchr(id,' ')) {
- value=strchr(id,' ');
+ if(strchr(id,sep)) {
+ value=strchr(id,sep);
*value=0;
value++;
}