maid icon indicating copy to clipboard operation
maid copied to clipboard

Passing flags to the tasks is conflicting

Open tunnckoCore opened this issue 6 years ago • 4 comments

So.

While implementing #4, i reconsider the #29. And realized that we only should support maidfile.md (from cwd to 5 dirs up) and .maidfile.md (from cwd to 10 dirs up) by default. One more thing that appeared is that we are a bit limited with what flags maid cli can have, because we are passing flags to the tasks e.g. maid lint --fix, so --fix is going to the eslint. I realized that is a bit conflicting while i changed the --path to more meaningful --config-path which ESLint has too.

So, if not another thing, we can rename the --path to, for example, --maidfile which would be the best. Then i can PR the #4 which is pretty fantastic by the way and works.

This issue is more just informatinve and opening the discussion that may appear in future.

tunnckoCore avatar Jun 06 '18 07:06 tunnckoCore

We definitely should have as low flags as possible. One more conflict may appear if you have bash task using git and you also want to pass the alias flag of --section which is -s and git also have -s which i extensively use always. Or at least all of this should be mentioned in comments.

tunnckoCore avatar Jun 06 '18 07:06 tunnckoCore

Could this work using the -- <flags to run task with> syntax instead, maybe automatically passing unknown flags at the top level into the task (with a warning).

DJMcNab avatar Jun 07 '18 07:06 DJMcNab

-- task arguments seems the best solution so far.

egoist avatar Jun 07 '18 14:06 egoist

Or treat flags before task name as maid flags, but treat arguments after the task name as task arguments:

maid --section foo lint --fix

This is also how npx and yarn work. -- task arguments is kinda annoying 😅

egoist avatar Jun 07 '18 14:06 egoist