ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Double quoted command line arguments

<< < (2/2)

Eóin:
Generally speaking with technical details like that localizations issues aren't considered. Why? Well I guess the discussion had here is relevant.

After all, quote's were just an arbitrary choice, undoubtedly related to the fact that a lot of programming languages use them to denote string. For example, still in English, “Unicode Quotes” aren't accepted either.

daddydave:
Well I guess the discussion had here is relevant.
-Eóin (May 25, 2010, 01:11 PM)
--- End quote ---

That's a funny discussion. Makes me glad HTML wasn't invented by an Urdu speaker, we'd all have to type from right to left (and in a different alphabet). With regard to color vs. colour, I've seen some libraries where they used defines or inline functions or something so either would work.

EDIT
This quote is suitable for framing:

"Yes, I am proposing that if you don't want your native language mutated in another land, don't bring it with you when you conquer it. " --app103

MilesAhead:
Of course the whole question would be obviated if the moron, er, I mean, decision-maker, didn't allow spaces in file paths in the first place. A lot of OS work perfectly fine without them.  I guess it's too easy if you don't have to test every string for an embedded space.

daddydave:
Of course the whole question would be obviated if the moron, er, I mean, decision-maker, didn't allow spaces in file paths in the first place. A lot of OS work perfectly fine without them.  I guess it's too easy if you don't have to test every string for an embedded space.

-MilesAhead (May 25, 2010, 04:55 PM)
--- End quote ---

What OS doesn't allow spaces in the file paths?

Besides, not all command line arguments are file paths so that wouldn't solve the problem.

I'd have to say

taskdaddy @@ErrandGotothemarket
and then it would show up that way in Outlook, too.

daddydave:
Here is a little background.

I kicked off TaskDaddy as a GUI app.

Then I thought, it would be nice to take the task specification on the command line as well, and using the same syntax that the GUI uses.

Then I started adding command line parameters and my custom command line parsing started to break down when I started thinking of command line option switches I wanted to add.

So I started using a third party set of functions to simplify the command line parsing. I decided to require the main argument to be in quotes so that that it would pick it up as a single argument.

So overnight the syntax changed from

taskdaddy @@Errand Go to the market

to

taskdaddy "@@Errand Go to the market".

But there is one problem.

What if I have this?

taskdaddy @@Someday Make another "King Kong" sequel

I'm back to multiple parameters again because I can't have double quotes within double quotes.

So one way to tackle it, is that if a parameter has a space in it, go ahead and add double quotes to the outside of it. Additionally, concatenate all the non-option parameters into one (with spaces added, of course).

There is a flaw in this, though (can you spot it?), but that was my thinking.


Navigation

[0] Message Index

[*] Previous page

Go to full version