Skip to content

Issue 16409 - Add support for assign-style switches#6070

Merged
WalterBright merged 1 commit intodlang:masterfrom
AndrejMitrovic:assign-switch
Aug 22, 2016
Merged

Issue 16409 - Add support for assign-style switches#6070
WalterBright merged 1 commit intodlang:masterfrom
AndrejMitrovic:assign-switch

Conversation

@AndrejMitrovic
Copy link
Contributor

All switches taking values now allow the -switch=<value> syntax.

Note: The old-style -switch**Value** syntax is still supported. That being said you won't be able to use = as an actual name of a file or directory with the old-style syntax anymore but will have to use e.g. -of==.

I don't know who in their right mind would name files or directories with = in their name, but we should add this breaking change to the change log nevertheless.

The list of switches which now have this support includes:

-Dd=<directory>
-Df=<filename>
-Hd=<directory>
-Hf=<filename>
-I=<directory>
-J=<directory>
-L=<linkerflag>
-od=<dirname>
-of=<objname>
-Xf=<filename>

Fixes https://issues.dlang.org/show_bug.cgi?id=16409

Tested on Ubuntu (via Win 10's bash!)

@dlang-bot
Copy link
Contributor

dlang-bot commented Aug 21, 2016

Fix Bugzilla Description
16409 Add support for assign-style switches

@dlang-bot
Copy link
Contributor

@AndrejMitrovic, thanks for your PR! By analyzing the annotation information on this pull request, we identified @yebblies, @leandro-lucarella-sociomantic and @mathias-lang-sociomantic to be potential reviewers. @yebblies: The PR was automatically assigned to you, please reassign it if you were identified mistakenly.

(The DLang Bot is under development. If you experience any issues, please open an issue at its repo.)

All switches taking values now allow the -switch=<name> syntax.
The list of new switches which support this include:

-Dd=<directory>
-Df=<filename>
-Hd=<directory>
-Hf=<filename>
-I=<directory>
-J=<directory>
-L=<linkerflag>
-od=<dirname>
-of=<objname>
-Xf=<filename>
@codecov-io
Copy link

Current coverage is 87.41% (diff: 100%)

Merging #6070 into master will not change coverage

@@             master      #6070   diff @@
==========================================
  Files            96         96          
  Lines         55799      55799          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          48779      48779          
  Misses         7020       7020          
  Partials          0          0          

Powered by Codecov. Last update 03a8430...3897ec1

@AndrejMitrovic
Copy link
Contributor Author

So what is this new CircleCi about and can we restart it? It seems like an unrelated error:

curl: (22) The requested URL returned error: 403

@wilzbach
Copy link
Contributor

So what is this new CircleCi about and can we restart it? It seems like an unrelated error:

It runs the testsuite with coverage analysis and sends the results to CodeCov as we are already overusing Travis and the auto-tester. The failure is due to the rate-limiting of the Github Api (CircleCi doesn't expose the upstream branch against which the PR was made). Normally you can just go to CircleCi, login and restart the job, but unfortunately the rate-limit is hourly.
In any case this problem will be fixed soon though (see #6053 for a fix).

@AndrejMitrovic
Copy link
Contributor Author

Thanks, it's green now.

@leandro-lucarella-sociomantic
Copy link
Contributor

Why not using space as separator? That way there are no braking changes at all and it feels more natural.

@AndrejMitrovic
Copy link
Contributor Author

Why not using space as separator? That way there are no braking changes at all and it feels more natural.

The prime reason: consistency with the other switches.

Also, I'm not sure how well this will interact with existing tools. RDMD expects a file name after which all arguments will be passed to the executable instead of the compiler. For example:

rdmd -c main.d -foo -bar

-foo and bar will be passed to the executable, not the compiler.

Now if we implement spaces around switches and someone calls RDMD Like so:

rdmd -Hf main.d -c 

rdmd won't know whether main.d is a source file or if it's an argument to -Hf. I see potentially more breaking changes with the spaces approach.

@AndrejMitrovic
Copy link
Contributor Author

AndrejMitrovic commented Aug 22, 2016

Btw we could just change all switches to support both spaces and = (I would prefer having both). It's not hard to extend this PR with it at all.

@WalterBright
Copy link
Member

I would prefer having both

This is just pointless complexity.

@WalterBright WalterBright merged commit cf44ea0 into dlang:master Aug 22, 2016
@AndrejMitrovic
Copy link
Contributor Author

This is just pointless complexity.

Hehe, fair enough. Thanks for merging this!

@AndrejMitrovic AndrejMitrovic deleted the assign-switch branch August 22, 2016 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Comments