Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1876 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

text.Arguments: empty arguments are dropped

Reported by: Deewiant Assigned to: kris
Priority: major Milestone: 1.0
Component: Tango Version: trunk
Keywords: Cc:

Description

import tango.io.Stdout;
import tango.text.Arguments;
void main() {
	auto parser = new Arguments;
	parser.parse(["", "1", "", "", "4", ""]);
	auto args = parser("").assigned;
	foreach (i, arg; args)
		Stdout.formatln("{}: `{}`", i, arg);
}

The above currently prints:

0: `1`
1: `4`

It should print:

0: ``
1: `1`
2: ``
3: ``
4: `4`
5: ``

Change History

03/12/10 04:55:07 changed by kris

all empty string are currently ignored e.g. "prog..........-x.................-y.........." treats the whitespace as meaningless (where '.' == whitespace)

03/12/10 09:10:44 changed by Deewiant

That's fine and typical: arguments are separated by any amount of whitespace. But if I give parse() a char[][] it should treat each char[] as a complete argument, regardless of what they contain: they've already been separated, that's why it's a char[][] and not a char[].

03/12/10 17:37:13 changed by kris

perhaps you have good reason for desiring empty parameters?

03/20/10 20:34:08 changed by kris

  • status changed from new to closed.
  • resolution set to fixed.

(In [5411]) fixes #1876 :: text.Arguments: empty arguments are dropped

thanks to deewiant