Lamest command line tool ever
Today I needed to add Subversion as a Windows service. The docs pointed me to the "sc" tool. This seemed like a simple tool but for the life of me I couldn't get it to work. Every time I ran the tool I would get a help message back. Here is an example of what I was trying to run:
sc create svnserve binpath="c:\svnserve\svnserve.exe --service
--root c:\repos" displayname="Subversion" depend=tcpip start=auto
I noticed something odd in the help message though:
The option name includes the equal sign.
I looked again at the web site instructions and noticed that after every option there was a space. I was convinced that was just a typo, or formatting used to wrap nicely in a browser. However, on a whim I tried it:
sc create svnserve binpath= "c:\svnserve\svnserve.exe --service
--root c:\repos" displayname= "Subversion" depend= tcpip start= auto
Guess what? It worked. For some reason the person who created sc.exe decided to make the syntax: opt1= val1. I was just crazy thinking that this syntax would be fine: opt1=val1.
Seriously - can someone tell me why this syntax would be used? Would it have been so hard to support a simple opt1=val1 type syntax like, oh, most other command line tools?
Comments
http://www.excastle.com/blog/archive/2005/05/31/10...
http://www.thecrumb.com/2006/10/24/svnservice-no-l...
The 'sc' command is a Windows shell command - and in regards to Ray's frustration - it's a feature, not a bug :)
I never noticed this as I cut-n-pasted the command string - but I'm going to add a note to my blog post and mention it!
Which docs did you use? The ones at
http://svn.collab.net/repos/svn/trunk/notes/window...
warn you about this..
"Note that the command-line syntax for SC is rather
odd. Key/value pairs are specified as "key= value"
(without the double-quotes). The "key=" part must
not have any spaces, and the "value" part MUST be
separated from the "key=" by a space."
I used these docs as a reference: http://support.microsoft.com/kb/251192
I have also noticed the strange syntacsis they used in the examples, but I didn't think it was important.
