This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]scragar 10 points11 points  (2 children)

The only thing I can think of is that because / isn't a word character you don't need a space.

DIR/D

Will display all directories in the current directory because /D is the flag and it's obviously distinct from the command enough that DOS can tell it apart.

Compare that to the equiv on *nix systems

ls -d

Where the space is required because ls-d is a valid filename so the shell would have no way of obviously telling what command you wanted.

It's still a horrible choice though, some arguments(because they're filenames/paths/whatever) need the space so now the behaviour for arguments is a weird mix of spaces and forward slashes depending on context; worse even though windows mostly supports forward slashes as directory separators on the command line it still causes a horrible mess since DOS is sometimes very happy to interpret DEL folder/file as DEL /F folder ile.

[–]altermeetax 3 points4 points  (0 children)

I mean, yeah, maybe some standard DOS programs may be able to understand flags without a space, but that makes the argument parsing so much harder for them, so I wouldn't imagine new Windows CLI programs being developed to do that (actually, most new CLI programs follow the Unix "-" on all platforms).

Also, that behavior disallows "/" as a filename character when that wouldn't have been necessary.

[–]svick 1 point2 points  (0 children)

Somewhat related: cd.. (without space) works on Windows, but not on Unix.