Commit graph

166 commits

Author SHA1 Message Date
Steven Schveighoffer
79cbde1ab6
Fix #10680 - Instead of passing receiver into the conversion function, (#10684)
just return the value and assign it to the receiver. Renamed the
conversion function and also cleaned up all the `typeof` calls, which
were very verbose.
2025-03-18 06:38:36 +08:00
Robert Schadek
ffb70c5580
Name argument if data conversion fails getopt (#10593)
Fixes #9662

whitespace
2025-02-07 10:19:20 -08:00
Vladimir Panteleev
cca8661113 Fix Issue 23940 - std.getopt does not assert with options that only differ in case with config.caseInsensitive 2023-05-27 17:38:25 +02:00
Nathan Sashihara
68c7ec8d25 Fix recent isPointer changes to use is(T == U*, U) instead of is(T : U*, U)
The behaviors are different and the changes appear accidental rather
than deliberate. In at least one case the change would result in wrong
behavior:

https://github.com/dlang/phobos/pull/8635#issuecomment-1433898162

Affected PRs: #8635, #8636, #8637, #8638, #8639
2023-02-16 19:46:24 -05:00
Walter Bright
3eb542c91c remove use of isPointer from std.getopt 2022-12-01 11:32:06 +01:00
Walter Bright
525ed52486 getopt: make unittest @system because of delegate 2022-08-12 20:09:13 +00:00
Luís Ferreira
e7f45309b5
getopt: mark defaultGetoptPrinter as @safe
Fix issue 22798.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2022-02-22 00:38:36 +00:00
Vladimir Panteleev
461101dfa0 Fix Issue 22394 - std.getopt cannot handle "-" 2021-10-17 01:48:51 +00:00
dkorpel
d0a0cdb0a2 use icmp instead of toUpper in getopt 2021-06-01 13:36:56 +02:00
dkorpel
5f7816a77e use splitter instead of split in getopt 2021-05-30 03:00:56 +02:00
berni44
b2019ebab0 Narrow imports of std.math in the rest of phobos. 2021-04-21 03:00:57 +02:00
berni44
6f2a0934a7 Adapt imports of std.format to new structure of std.format. 2021-03-19 13:22:00 +01:00
Tobias Pankrath
cb3f5e29ab getopt: throw the correct exception on missing values 2021-03-05 03:06:14 +01:00
Bernhard Seckinger
9cb7755041 Replace approxEqual with isClose 2021-01-28 10:39:50 +01:00
Florian
c216486512
std.getopt: Fix link to perl docs (#7572)
The line break is encoded as part of the hyperlink:

`http://%20%20%20%20%20%20%20%20%20%20%20perldoc.perl.org/Getopt/Long.html`
2020-07-31 10:11:06 +08:00
Steven Schveighoffer
a9fc331652 Clarify getopt behavior with arraySep. 2020-07-15 06:11:18 +02:00
H. S. Teoh
8812bb5449 Fix bug 12521: update docs to match current getopt behaviour. 2020-07-13 12:13:49 -07:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
aG0aep6G
f5f23b3d0d many existing tests can be @safe now 2020-01-05 01:32:03 +01:00
aG0aep6G
36ca83737a fix issue 20480 - make std.getopt ready for DIP 1000 2020-01-05 01:28:26 +01:00
Jonathan Samson
f14cc0bcdd Added a style parameter to defaultGetoptFormatter. 2019-12-11 19:05:00 +01:00
Robert Schadek
3fbe0233e3 assert messages for std.getopt 2019-05-24 14:38:06 +01:00
Sebastian Wilzbach
b56db9a061 Use selective top-level module imports in std.{functional,getopt,math,net,outbuffer} 2019-05-23 13:20:04 +02:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Sebastian Wilzbach
44735dd39f Remove staticIota: std_getopt 2018-01-22 17:18:53 +01:00
Jon Degenhardt
296184f541 Fix issue 17650: std.getopt range violation when option value is a hyphen. 2017-07-15 13:08:53 -07:00
Hackerpilot
59108e6d3a Unit test for 17574. 2017-06-30 13:33:06 -07:00
Hackerpilot
bb0340766b Fix issue 17574 - Avoid range error by checking the result of indexOf 2017-06-29 15:20:32 -07:00
Vladimir Panteleev
d0b9555a06
Revert "Sort selective imports"
This reverts commit 998ad51fd7.
2017-06-13 17:51:52 +00:00
Sebastian Wilzbach
998ad51fd7 Sort selective imports 2017-06-12 08:12:09 +02:00
Sebastian Wilzbach
61717ecc7d Sort imports 2017-06-12 07:54:38 +02:00
Jonathan M Davis
4e8cab7cdf Fix some bad/slangy English in std.getopt.
I don't think that it makes sense to use slang like "dunno" in a
standard library.
2017-05-13 02:14:33 -07:00
Jon Degenhardt
69cfa938ee std.getopt: make setConfig safe, pure, nothrow, nogc 2017-04-26 10:56:48 -07:00
Jon Degenhardt
a976764d54 std.getopt: Make private functions safe. 2017-04-25 23:10:40 -07:00
Jon Degenhardt
cacf586e93 std.getopt unit tests: No trailing whitespace. 2017-04-24 00:54:21 -07:00
Jon Degenhardt
b0b63869a3 std.getopt unit tests: No trailing whitespace. 2017-04-24 00:48:32 -07:00
Jon Degenhardt
9d59d8cd73 std.getopt: Add unit tests for delegates as callbacks. 2017-04-24 00:32:47 -07:00
Jon Degenhardt
684f41b64e Fix issue 17327. Review comments: drop continue statement. 2017-04-16 08:01:49 -07:00
Jon Degenhardt
c1d49fc494 Fix issue 17327 - std.getopt: Repeated boolean command option fails. 2017-04-16 00:21:49 -07:00
Amaury SECHET
d84a86d1a7 Interpret single letter argument as short 2017-03-14 19:28:14 -04:00
Sebastian Wilzbach
a2c6398332 Automatically add spaces to binary operators (==)
command:

sed -E "s/([[:alnum:]]) == ([[:alnum:]])/\1 == \2/g" -i **/*.d
sed -E "s/([[:alnum:]])== ([[:alnum:]])/\1 == \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) ==([[:alnum:]])/\1 == \2/g" -i **/*.d
2017-02-23 00:57:47 +01:00
Sebastian Wilzbach
a36cec8686 DScanner: automatially set all unattributed unittests to @safe or @system 2017-02-22 05:42:04 +01:00
Nick Sabalausky
b41721df86 getopt.config: Document which options are default. 2017-02-20 13:40:42 -05:00
Jack Stouffer
824bbee70d Merge pull request #5010 from Chaosus/master
Make std.getopt.autoIncrementChar use private modifier
2017-01-05 14:55:09 -05:00
Chaosus
281e4e09fa Make std.getopt.autoIncrementChar use private modifier 2017-01-02 21:22:42 +03:00
Andrej Mitrovic
43880932f5 Throw error on duplicate long/short options
Fixes Issue 16048
2016-11-23 01:27:54 +01:00
jmdeschenes
024b751547 Fix Issue 16443 - Prevent segmentation fault
If the option name is an empty string an Exception will be raised instead.
2016-08-28 13:58:55 -04:00
anonymous
2be9e31ef6 fix issue 16420 - Incorrect example in std.getopt docs 2016-08-23 22:54:13 +02:00
anonymous
d9a0fdaa2e minor spelling/grammar corrections
comma before "etc."
"til" -> "until"
2016-08-23 22:53:17 +02:00