ref-filter: align: introduce long-form syntax
[gitweb.git] / ref-filter.c
index 797f9fe2d883d9568259507e394cfe290fc4adde..2255dcc6c58bd7ac216a66bd3c15baa6167810c5 100644 (file)
@@ -78,7 +78,15 @@ static void align_atom_parser(struct used_atom *atom, const char *arg)
                const char *s = params.items[i].string;
                int position;
 
-               if (!strtoul_ui(s, 10, &width))
+               if (skip_prefix(s, "position=", &s)) {
+                       position = parse_align_position(s);
+                       if (position < 0)
+                               die(_("unrecognized position:%s"), s);
+                       align->position = position;
+               } else if (skip_prefix(s, "width=", &s)) {
+                       if (strtoul_ui(s, 10, &width))
+                               die(_("unrecognized width:%s"), s);
+               } else if (!strtoul_ui(s, 10, &width))
                        ;
                else if ((position = parse_align_position(s)) >= 0)
                        align->position = position;