question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Think about smarter usage of double-dash

See original GitHub issue

There are a some quantity of issues about parameterization tasks in gulp and probably I have an idea that can be suitable for everyone.

By default it marks the end of parameter (option) list.

…a double dash (–) is used in bash built-in commands and many other commands to signify the end of command options, after which only positional parameters are accepted. © http://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash

But npm run-script passes arguments after the first -- directly to the script and it feels like this one is really familiar for nodejs community. Fellows uses -- as a delimiter for passing arguments inside like we need to pass them in tasks.

https://github.com/npm/npm/blob/d081cc6c8d73f2aa698aab36605377c95e916224/lib/run-script.js#L14

Similar logic exists in yarn: https://github.com/yarnpkg/yarn/blob/3dc9cf43448da51d3b8890de339a0ed27b12ca62/src/cli/index.js#L31

Gulp is the thing full of tasks and I don’t see a real reason why we can’t use -- as like npm or yarn do. I’m just curious if someone already uses tasks beginning with minus signs like -js or --hello (it’s hard to even imagines because of that: gulp -- --hello) but if we really need it we can go yarn way and use the second double dash as a marker for args for tasks: gulp -- --still-a-task --and-this-one-too -- arguments for tasks.

It’s a bunch of very simple fixes in code and I’m ready to make a PR.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
qfoxcommented, Feb 9, 2017

@contra Can we ignore anything after -- and not treat as commands for gulp? I guess there are a lot of people who really need it.

0reactions
phatedcommented, Feb 9, 2017

Because that isn’t our philosophy. I don’t understand why you continue to harp on this. We’ve already made this decision and you aren’t going to convince me to change it.

You say that bash isn’t for task runners but you keep referencing ~task~package managers as your examples, which is an insane double-standard.

We aren’t going to do this so you can just stop.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stop Mac to convert typing double dash to emdash?
Go to System Preferences, then "Language & Region" then click the "Keyboard Preferences..." button and to go to "Text" tab. It is no...
Read more >
How to Use — and Not Use — the Almighty Em Dash - Medium
You can achieve that thought-break in two primary ways: using the em dash as a bridge, or as a bookend. We're going to...
Read more >
Dash-dash it all! Apple's bad beta decision on em and en ...
Terrible news. Apple is replacing the long-running convention of typing two hyphens to obtain an em dash or “long dash.
Read more >
What the Heck Is an Em Dash and How Do You Use It Correctly?
A double hyphen is a punctuation mark that uses two parallel hyphens, like this: ⸗. It looks more like an angled equal sign...
Read more >
Outsmarting the smart dash - Practically Efficient
I like writing dashes—both the en dash (–) and the em dash (—). ... I truly believe it's a great feature because it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found