Python command: Command line arguments

The cmdargs commands in Python allow you to confirm whether an argument exists, get the value of a command line argument, or view the entire argument string.

See Python commands for other commands you can use with GainSeeker.

Syntax

Example

Description/Remarks

cmdargs.getargstring()

When the command line is
 pccollect.exe mycmd="value" close

then the command
  cmdargs.getargstring()

returns
  mycmd="value" close

Returns the full argument string. Any dashes in front of arguments are removed.

cmdargs.getargvalue(argument)

When the command line is
 pccollect.exe mycmd="value" close

then the command
  cmdargs.getargvalue("mycmd")

returns
  value

Returns the value of a command line argument as a string.

If no such argument value exists, it returns None.

cmdargs.hasarg(argument)

When the command line is
  pccollect.exe mycmd="value" close

then the command
  cmdargs.hasarg("close")

returns
  True

Returns True when the specified command line argument exists. Otherwise it returns False.