Skip to content

Command Line Reference

Akira Sugiura edited this page Dec 31, 2015 · 12 revisions

Table of Content




SYNOPSIS

Specify options to start with Prig.

SYNTAX

run [-process] <string> [-help] [-arguments <string>]

DESCRIPTION

Executes the specified *.exe under the Prig. In the design of the unmanaged profiling API of .NET, it is also possible that by some environment variables is enabled. However, using this option makes it more easier.
You can filter the target process through environment variables if the process you want to apply Prig starts the child process of it. There are other ways to customize the behavior by some environment variables. For details, please see the below examples.
NOTE: Before you execute this option, you have to install the directory that target process exists as the scope of application of Prig in advance. See also Installer option.

PARAMETERS

-help

Display help message.

-process <arg>

Process to execute. If its path contains any spaces, you shall surround with "(double quotes).
This option is mandatory.

-arguments <arg>

Program options for process. If the option is plural, you shall separate each option with space and surround with "(double quotes).

EXAMPLES

EXAMPLE 1

CMD C:\> prig run -process "C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console-x86.exe" -arguments "Test.program1.dll /domain=None"  

This command executes the process designated by -process option with the program options designated by -arguments option.

EXAMPLE 2

PS C:\> 'prig run -process ".\packages\nunit.Runners.2.6.4\tools\nunit-console.exe" -arguments ".\ProfilersChainTest\bin\Debug\ProfilersChainTest.dll /domain=None /framework=v4.0"' | Out-File runtests.bat -Encoding default  
PS C:\> $env:URASANDESU_PRIG_CURRENT_DIRECTORY = (Resolve-Path .\ProfilersChainTest\bin\Debug).Path  
PS C:\> $env:URASANDESU_PRIG_TARGET_PROCESS_NAME = "nunit-agent"  
PS C:\> & .\packages\OpenCover.4.5.3723\OpenCover.Console.exe -target:runtests.bat -filter:+[ProfilersChain]*  

To measure code coverage, set working directory and the target process name to each environment variable and run tests with OpenCover. Note that this command has to be run in PowerShell.

EXAMPLE 3

CMD C:\> set URASANDESU_CPPANONYM_LOGGING_SEVERITY=0  
CMD C:\> prig run -process "C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console.exe" -arguments "ClassLibrary1Test.dll /domain=None"  

In this command, set logging severity DEBUG -- DEBUG:0, VERBOSE:1, INFO:2, WARNING:3 and ERROR:4. In default, it has been set to INFO -- and execute. Log file is output into the log directory of current directory.




SYNOPSIS

Specify options to disassemble with Prig.

SYNTAX

dasm -assembly <string> [-help]  
  
dasm -assemblyfrom <string> [-help]

DESCRIPTION

Disassembles the summary of specified assembly. The summary that is name, version, culture, public key token, processor architecture, full name, runtime version and location is returned as csv format. To format the result, using ConvertFrom-Csv in PowerShell is convenience. This option returns all summaries of the assemblies that are qualifying condition in spite of the processor architecture and runtime version of parent process. Therefore, note that it has difference behavior from .NET default Gacutil.exe tool or each type of System.Reflection namespace.

PARAMETERS

-help

Display help message.

-assembly <arg>

Assembly Display Name to disassemble. If its name contains any spaces, you shall surround with "(double quotes).
Either this option or 'assemblyfrom' is mandatory.

-assemblyfrom <arg>

Assembly Path to disassemble. If its path contains any spaces, you shall surround with "(double quotes).
Either this option or 'assembly' is mandatory.

EXAMPLES

EXAMPLE 1

CMD C:\> prig dasm -assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  

This command disassembles the assembly designated by -assembly option.

EXAMPLE 2

CMD C:\> prig dasm -assemblyfrom "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll"  

This command disassembles the assembly designated by -assemblyfrom option.




SYNOPSIS

Specify options to install as a target package of Prig.

SYNTAX

install [-package] <string> [-source] <string> [-help]

DESCRIPTION

To apply Prig against a *.exe, at first, you have to install the source as the package that is the scope of application of Prig. After only installing, you can execute any *.exe with Prig(About executing, please see the help for Runner option). This effect is enabled until uninstalling the package. In default, the source of the test execution engine for Visual Studio("C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow") has already installed.

PARAMETERS

-help

Display help message.

-package <arg>

Package to install. Currently, there is no convention, but easy to understand and globaly identified naming isrecommended. It is better to apply the package name same as Chocolatey or NuGet.
This option is mandatory.

-source <arg>

Package location to install. If its path contains any spaces, you shall surround with "(double quotes).
This option is mandatory.

EXAMPLES

EXAMPLE 1

CMD C:\> prig install NUnit -source "C:\Program Files (x86)\NUnit 2.6.3\bin"  

This command installs NUnit as a target packages of Prig. NUnit is located at "C:\Program Files (x86)\NUnit 2.6.3\bin", so you have to specify the directory path.




SYNOPSIS

Specify options to list the packages that Prig installed as targets.

SYNTAX

list [[-filter] <string>] [-help] [-localonly]

DESCRIPTION

Returns all installed packages, sources and additional delegates in list. The content is JSON format, so parsing by ConvertFrom-Json in PowerShell is convenience.

PARAMETERS

-help

Display help message.

-filter <arg>

Filter to list. Against the package name or source, it is used as regular expression pattern, and also the case is ignored. If this option is not specified, the command enumerates all installed packages.

-localonly

Indicates the search location is local only. In currentversion, this option is ignored if specified.

EXAMPLES

EXAMPLE 1

CMD C:\> prig list NUnit -localonly  

This command lists the packages that Prig installed as the method replacement targets. Packages are filtered by the name "NUnit".

EXAMPLE 2

PS C:\> prig list | ConvertFrom-Json | Format-Custom  

This command lists all packages and parses the results. Format-Custom can expand the hierarchical structure. Note that this command has to be run in PowerShell.




SYNOPSIS

Specify options to update a package.

SYNTAX

update [-package] <string> [[-delegate] <string>] [-help]

DESCRIPTION

Updates the information that installed package has. Updatable information is below:

  • delegate

For details, please see each description of sub option.

PARAMETERS

-help

Display help message.

-package <arg>

Specify the packages to update by semicolon delimited format. All indicates applying same update option to all installed packages.

-delegate <arg>

A configuration for update. This option adds the assembly that contains the Indirection Delegates. If you want to replace the method that has three or more out/ref parameters, you can add available delegates by using this. This option can only be specified when specifying -package option to All. If its path contains any spaces, you shall surround with "(double quotes). Also, if you want to use multiple assemblies, specify them by semicolon delimited format.
NOTE: You have to specify at least one configuration.

EXAMPLES

EXAMPLE 1

CMD C:\> prig update All -delegate "C:\Users\User\AdditionalDelegates\ThreeOrMoreRefOutDelegates\bin\Release\ThreeOrMoreRefOutDelegates.dll"  

This command updates all package to use additional delegates for a method replacement. Also you have to specify the -delegate option because the delegates is contained in ThreeOrMoreRefOutDelegates.dll




SYNOPSIS

Specify options to uninstall a package from Prig.

SYNTAX

uninstall [-package] <string> [-help]

DESCRIPTION

Uninstalls the installed package.

PARAMETERS

-help

Display help message.

-package <arg>

Package to uninstall. You have to specify the package name that is same as when installed. However, the case is insensitive. All indicates uninstalling all packages.
This option is mandatory.

EXAMPLES

EXAMPLE 1

CMD C:\> prig uninstall NUnit  

This command uninstalls NUnit from Prig.




Clone this wiki locally