Writing a macro with parameters

I'm trying to write a macro which should be able to do several different yet somewhat similar things. I thought that instead of writing different macros for every thing, I should be able to write just one macro and let me choose when I'm writing the document, which option to choose. I think an example is the best way to describe what I want: suppose I have a macro `\mark[2]` which can mark things. I want to be able to use it like this: `\mark[direction=up]{a}{b}` if I want it to mark the object above it, `\mark[arrow=yes, direction=right]{a}{b}` if I want an arrow (and the mark to be to the right of it), and so on. Obviously I'd want to be able to set what's the default, so in the first example, no arrow will show up.

I'll be glad for any help.