Command Line Arguments

Glossary Item Box

Microsoft Robotics Developer Studio Send feedback on this topic

Command Line Arguments

This section contains general information that is applicable to all the tools and utilities.

Getting Help

Tools and utilities take arguments from the command line. You can see a simple description of the arguments that they support by using the /? command line argument, for example:

dsshost /?

This generates an output that looks like the following:

Microsoft (R) DSS Service Host Version 1.0.0.0
Copyright (c) Microsoft Corporation. All rights reserved.

/manifest:{<uri>|<path>}  Initial manifest(s) to load. (short form /m)
/dll:{<uri>|<path>}       Initial Dss Service dll to load. (short form /d)
/contract:{<uri>|<path>}  Initial Dss Service contract to load. (short form /c)
/port:<int>               TCP port to listen for HTTP requests. (short form /p)
/tcpport:<int>            TCP port to listen for SOAP requests. Default value:'-1' (short form /t)
/hostname:<string>        IPv4 or IPv6 address or an Internet host name identifying this host. (short form /h)
/security:<string>        File containing security settings (short form /s)
@<file>                   Name of a text file containing arguments. Multiple arguments per line are allowed. An
                          unquoted hash ('#') comments out the remainder of a line. An argument file is processed by
                          removing comments, leading and trailing spaces and tabs, processing quotation marks and
                          escape sequences, and then processing the arguments as if they were on the command line.

The help page is also displayed if required command line arguments are missing or arguments are malformed.

Command Line Arguments

There are two types of command line arguments: Named and Unnamed arguments. Named arguments can be entered in any order but unnamed arguments must be at the end of the command line. Named arguments can use their long name, which typically is more descriptive, or their short name which may be faster and more convenient for day-to-day use.

Arguments with values that include spaces must be put in quotes:

/name:"value with spaces"

Nested quotes must be escaped using the \, backslash, character like the following:

/name:"value with \"quotes\""

Parameter values that are either file names or Uniform Resource Identifiers are expanded relative to the current working directory and environment variables are expanded for all parameter values. For example, a parameter line can looking like this

/filename:"example.txt"

would resolve to the file example.txt in the current directory.

In addition to passing command line arguments from the command line, they can be added to an argument file which makes it easier to deal with long command lines. An argument file is a plain text file which can be passed to a utility using the @ character, followed by the filename. For example:

dsshost @input.txt

Within an argument file, an unquoted hash, #, comments out the remainder of a line which can be useful for documentation purposes. An argument file is processed by first removing comments, leading and trailing spaces, and tabs. Then quotation marks and escape sequences are processed and the arguments are passed as if they were on the command line. For example, the parameters in this command line

dsshost /p:50000 /m:"..\config\sample.manifest.xml"

can be written in an argument file as:

/p:50000                              # We use port 50000
/m:"..\config\sample.manifest.xml"    # Our sample manifest 

Command line arguments can be passed from a file and from the command line at the same time:

dsshost /t:50001 @input.txt

Command Exit Codes

The Decentralized Software Services command line utilities return a status code when exiting. This status code can be inspected to verify whether the command succeeded or failed. Success is indicated by an exit code of 0. Errors are indicated using one of these values:

  • 1 = Usage Error
  • 2 = Invalid Argument
  • 10 = Internal Error
  • 20 = Command Failed

 

 

© 2012 Microsoft Corporation. All Rights Reserved.