/******************************************************************************* Copyright (c) 2011, Perforce Software, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE SOFTWARE, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ /******************************************************************************* * Name : Repository.User.cs * * Author : dbb * * Description : User operations for the Repository. * ******************************************************************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Perforce.P4 { public partial class Repository { /// /// Create a new user in the repository. /// /// User specification for the new user /// The '-f' and '-i' flags are required when creating a new user /// The User object if new user was created, null if creation failed /// The '-i' flag is added if not specified by the caller ///
///
p4 help user ///
///
user -- Create or edit a user specification ///
///
p4 user [-f] [name] ///
p4 user -d [-f] name ///
p4 user -o [name] ///
p4 user -i [-f] ///
///
Create a new user specification or edit an existing user specification. ///
The specification form is put into a temporary file and the editor ///
(configured by the environment variable $P4EDITOR) is invoked. ///
///
Normally, a user specification is created automatically the first ///
time that the user issues any command that updates the depot. The ///
'p4 user' command is typically used to edit the user's subscription ///
list for change review. ///
///
The user specification form contains the following fields: ///
///
User: The user name (read-only). ///
///
Email: The user's email address (Default: user@client). ///
///
Update: The date the specification was last modified (read-only). ///
///
Access: The date that the user last issued a client command. ///
///
FullName: The user's real name. ///
///
JobView: Selects jobs that are displayed when the user creates ///
a changelist. These jobs can be closed automatically ///
when the user submits the changelist. For a description ///
of jobview syntax, see 'p4 help jobview' ///
///
Reviews: The subscription list for change review. There is no ///
limit on the number of lines that this field can contain. ///
You can include the following wildcards: ///
///
... matches any characters including / ///
* matches any character except / ///
///
Password: The user's password. See 'p4 help passwd'. ///
///
Type: Must be 'service', operator, or 'standard'. Default is ///
'standard'. Once set, the user type cannot be changed. ///
///
The -d flag deletes the specified user (unless the user has files ///
open). ///
///
The -o flag writes the user specification to the standard output. ///
The user's editor is not invoked. ///
///
The -i flag reads a user specification from the standard input. ///
The user's editor is not invoked. ///
///
The -f flag forces the creation, update or deletion of the specified ///
user, and enables you to change the Last Modified date. By default, ///
users can only delete or modify their own user specifications. The ///
-f flag requires 'super' access, which is granted by 'p4 protect'. ///
///
///
/// /// To create a user with the username bsmith (when connected with /// Connection.UserName = "bsmith"): /// /// User u = new User(); /// u.Id = "bsmith"; /// u.FullName = "Brian Smith"; /// u.EmailAddress = "bsmith@hotmail.com"; /// /// u = Repository.CreateUser(u, null); /// /// To create a user with the username bsmith (when connected with /// a user that has super access): /// /// User u = new User(); /// u.Id = "bsmith"; /// u.FullName = "Brian Smith"; /// u.EmailAddress = "bsmith@hotmail.com"; /// /// UserCmdOptions opts = new UserCmdOptions(UserCmdFlags.Force); /// /// u = Repository.CreateUser(u, opts); /// /// /// public User CreateUser(User user, Options options) { if (user == null) { throw new ArgumentNullException("user"); } P4Command cmd = new P4Command(this, "user", true); cmd.DataSet = user.ToString(); if (options == null) { options = new Options(); } options["-i"] = null; P4CommandResult results = cmd.Run(options); if (results.Success) { return user; } else { P4Exception.Throw(results.ErrorList); } return null; } /// /// Create a new user in the repository. /// /// User specification for the new user /// The User object if new user was created, null if creation failed /// The '-i' flag is added if not specified by the caller ///
///
p4 help user ///
///
user -- Create or edit a user specification ///
///
p4 user [-f] [name] ///
p4 user -d [-f] name ///
p4 user -o [name] ///
p4 user -i [-f] ///
///
Create a new user specification or edit an existing user specification. ///
The specification form is put into a temporary file and the editor ///
(configured by the environment variable $P4EDITOR) is invoked. ///
///
Normally, a user specification is created automatically the first ///
time that the user issues any command that updates the depot. The ///
'p4 user' command is typically used to edit the user's subscription ///
list for change review. ///
///
The user specification form contains the following fields: ///
///
User: The user name (read-only). ///
///
Email: The user's email address (Default: user@client). ///
///
Update: The date the specification was last modified (read-only). ///
///
Access: The date that the user last issued a client command. ///
///
FullName: The user's real name. ///
///
JobView: Selects jobs that are displayed when the user creates ///
a changelist. These jobs can be closed automatically ///
when the user submits the changelist. For a description ///
of jobview syntax, see 'p4 help jobview' ///
///
Reviews: The subscription list for change review. There is no ///
limit on the number of lines that this field can contain. ///
You can include the following wildcards: ///
///
... matches any characters including / ///
* matches any character except / ///
///
Password: The user's password. See 'p4 help passwd'. ///
///
Type: Must be 'service', operator, or 'standard'. Default is ///
'standard'. Once set, the user type cannot be changed. ///
///
The -d flag deletes the specified user (unless the user has files ///
open). ///
///
The -o flag writes the user specification to the standard output. ///
The user's editor is not invoked. ///
///
The -i flag reads a user specification from the standard input. ///
The user's editor is not invoked. ///
///
The -f flag forces the creation, update or deletion of the specified ///
user, and enables you to change the Last Modified date. By default, ///
users can only delete or modify their own user specifications. The ///
-f flag requires 'super' access, which is granted by 'p4 protect'. ///
///
///
/// /// To create a user with the username bsmith (when connected with /// Connection.UserName = "bsmith"): /// /// User u = new User(); /// u.Id = "bsmith"; /// u.FullName = "Brian Smith"; /// u.EmailAddress = "bsmith@hotmail.com"; /// /// u = Repository.CreateUser(u); /// /// /// public User CreateUser(User user) { return CreateUser(user, null); } /// /// Update the record for a user in the repository /// /// User specification for the user being updated /// The User object if new user was saved, null if creation failed /// The '-i' flag is added if not specified by the caller ///
///
p4 help user ///
///
user -- Create or edit a user specification ///
///
p4 user [-f] [name] ///
p4 user -d [-f] name ///
p4 user -o [name] ///
p4 user -i [-f] ///
///
Create a new user specification or edit an existing user specification. ///
The specification form is put into a temporary file and the editor ///
(configured by the environment variable $P4EDITOR) is invoked. ///
///
Normally, a user specification is created automatically the first ///
time that the user issues any command that updates the depot. The ///
'p4 user' command is typically used to edit the user's subscription ///
list for change review. ///
///
The user specification form contains the following fields: ///
///
User: The user name (read-only). ///
///
Email: The user's email address (Default: user@client). ///
///
Update: The date the specification was last modified (read-only). ///
///
Access: The date that the user last issued a client command. ///
///
FullName: The user's real name. ///
///
JobView: Selects jobs that are displayed when the user creates ///
a changelist. These jobs can be closed automatically ///
when the user submits the changelist. For a description ///
of jobview syntax, see 'p4 help jobview' ///
///
Reviews: The subscription list for change review. There is no ///
limit on the number of lines that this field can contain. ///
You can include the following wildcards: ///
///
... matches any characters including / ///
* matches any character except / ///
///
Password: The user's password. See 'p4 help passwd'. ///
///
Type: Must be 'service', operator, or 'standard'. Default is ///
'standard'. Once set, the user type cannot be changed. ///
///
The -d flag deletes the specified user (unless the user has files ///
open). ///
///
The -o flag writes the user specification to the standard output. ///
The user's editor is not invoked. ///
///
The -i flag reads a user specification from the standard input. ///
The user's editor is not invoked. ///
///
The -f flag forces the creation, update or deletion of the specified ///
user, and enables you to change the Last Modified date. By default, ///
users can only delete or modify their own user specifications. The ///
-f flag requires 'super' access, which is granted by 'p4 protect'. ///
///
///
/// /// To update a user with the username bsmith (when connected with /// Connection.UserName = "bsmith"): /// /// User u = Repository.GetUser("bsmith"); /// /// // update email address /// u.EmailAddress = "bsmith@hotmail.com"; /// /// u = Repository.UpdateUser(u, null); /// /// /// public User UpdateUser(User user) { return CreateUser(user, null); } /// /// Update the record for a user in the repository /// /// User specification for the user being updated /// The User object if new user was saved, null if creation failed /// The '-i' flag is added if not specified by the caller ///
///
p4 help user ///
///
user -- Create or edit a user specification ///
///
p4 user [-f] [name] ///
p4 user -d [-f] name ///
p4 user -o [name] ///
p4 user -i [-f] ///
///
Create a new user specification or edit an existing user specification. ///
The specification form is put into a temporary file and the editor ///
(configured by the environment variable $P4EDITOR) is invoked. ///
///
Normally, a user specification is created automatically the first ///
time that the user issues any command that updates the depot. The ///
'p4 user' command is typically used to edit the user's subscription ///
list for change review. ///
///
The user specification form contains the following fields: ///
///
User: The user name (read-only). ///
///
Email: The user's email address (Default: user@client). ///
///
Update: The date the specification was last modified (read-only). ///
///
Access: The date that the user last issued a client command. ///
///
FullName: The user's real name. ///
///
JobView: Selects jobs that are displayed when the user creates ///
a changelist. These jobs can be closed automatically ///
when the user submits the changelist. For a description ///
of jobview syntax, see 'p4 help jobview' ///
///
Reviews: The subscription list for change review. There is no ///
limit on the number of lines that this field can contain. ///
You can include the following wildcards: ///
///
... matches any characters including / ///
* matches any character except / ///
///
Password: The user's password. See 'p4 help passwd'. ///
///
Type: Must be 'service', operator, or 'standard'. Default is ///
'standard'. Once set, the user type cannot be changed. ///
///
The -d flag deletes the specified user (unless the user has files ///
open). ///
///
The -o flag writes the user specification to the standard output. ///
The user's editor is not invoked. ///
///
The -i flag reads a user specification from the standard input. ///
The user's editor is not invoked. ///
///
The -f flag forces the creation, update or deletion of the specified ///
user, and enables you to change the Last Modified date. By default, ///
users can only delete or modify their own user specifications. The ///
-f flag requires 'super' access, which is granted by 'p4 protect'. ///
///
///
/// /// To update a user with the username bsmith (when connected with /// a user that has super access): /// /// User u = Repository.GetUser("bsmith"); /// /// // update email address /// u.EmailAddress = "bsmith@hotmail.com"; /// /// UserCmdOptions opts = new UserCmdOptions(UserCmdFlags.Force); /// /// u = Repository.UpdateUser(u, opts); /// /// /// public User UpdateUser(User user, Options options) { return CreateUser(user, options); } /// /// Get the record for an existing user from the repository. /// /// User name /// There are no valid flags to use when fetching an existing user /// The User object if new user was found, null if creation failed /// The '-i' flag is added if not specified by the caller ///
///
p4 help user ///
///
user -- Create or edit a user specification ///
///
p4 user [-f] [name] ///
p4 user -d [-f] name ///
p4 user -o [name] ///
p4 user -i [-f] ///
///
Create a new user specification or edit an existing user specification. ///
The specification form is put into a temporary file and the editor ///
(configured by the environment variable $P4EDITOR) is invoked. ///
///
Normally, a user specification is created automatically the first ///
time that the user issues any command that updates the depot. The ///
'p4 user' command is typically used to edit the user's subscription ///
list for change review. ///
///
The user specification form contains the following fields: ///
///
User: The user name (read-only). ///
///
Email: The user's email address (Default: user@client). ///
///
Update: The date the specification was last modified (read-only). ///
///
Access: The date that the user last issued a client command. ///
///
FullName: The user's real name. ///
///
JobView: Selects jobs that are displayed when the user creates ///
a changelist. These jobs can be closed automatically ///
when the user submits the changelist. For a description ///
of jobview syntax, see 'p4 help jobview' ///
///
Reviews: The subscription list for change review. There is no ///
limit on the number of lines that this field can contain. ///
You can include the following wildcards: ///
///
... matches any characters including / ///
* matches any character except / ///
///
Password: The user's password. See 'p4 help passwd'. ///
///
Type: Must be 'service', operator, or 'standard'. Default is ///
'standard'. Once set, the user type cannot be changed. ///
///
The -d flag deletes the specified user (unless the user has files ///
open). ///
///
The -o flag writes the user specification to the standard output. ///
The user's editor is not invoked. ///
///
The -i flag reads a user specification from the standard input. ///
The user's editor is not invoked. ///
///
The -f flag forces the creation, update or deletion of the specified ///
user, and enables you to change the Last Modified date. By default, ///
users can only delete or modify their own user specifications. The ///
-f flag requires 'super' access, which is granted by 'p4 protect'. ///
///
///
/// /// To get a user's specification for a user with the username bsmith: /// /// User u = Repository.GetUser("bsmith", null); /// /// /// public User GetUser(string user, Options options) { if (user == null) { throw new ArgumentNullException("user"); } // first make sure the user exists, otherwise depending on the way it is // configured, the server might create a new user P4Command cmd = new P4Command(this, "users", true, user); Options usersOptions = new Options(); usersOptions["-a"] = null; P4CommandResult results = cmd.Run(usersOptions); if ((results.Success == false) || (results.TaggedOutput == null) || (results.TaggedOutput.Count <= 0)) { return null; } else { bool found = false; foreach (TaggedObject to in results.TaggedOutput) { if (to.ContainsKey("User") && to["User"] == user) { found = true; break; } } if (!found) { return null; } } cmd = new P4Command(this, "user", true, user); if (options == null) { options = new Options(); } options["-o"] = null; results = cmd.Run(options); if (results.Success) { if ((results.TaggedOutput == null) || (results.TaggedOutput.Count <= 0)) { return null; } User value = new User(); bool dst_mismatch = false; string offset = string.Empty; if (Server != null && Server.Metadata != null) { offset = Server.Metadata.DateTimeOffset; dst_mismatch = FormBase.DSTMismatch(Server.Metadata); } value.FromUserCmdTaggedOutput((results.TaggedOutput[0]),offset,dst_mismatch); return value; } else { P4Exception.Throw(results.ErrorList); } return null; } /// /// Get the record for an existing user from the repository. /// /// User name /// There are no valid flags to use when fetching an existing user /// The User object if new user was found, null if creation failed /// The '-i' flag is added if not specified by the caller ///
///
p4 help user ///
///
user -- Create or edit a user specification ///
///
p4 user [-f] [name] ///
p4 user -d [-f] name ///
p4 user -o [name] ///
p4 user -i [-f] ///
///
Create a new user specification or edit an existing user specification. ///
The specification form is put into a temporary file and the editor ///
(configured by the environment variable $P4EDITOR) is invoked. ///
///
Normally, a user specification is created automatically the first ///
time that the user issues any command that updates the depot. The ///
'p4 user' command is typically used to edit the user's subscription ///
list for change review. ///
///
The user specification form contains the following fields: ///
///
User: The user name (read-only). ///
///
Email: The user's email address (Default: user@client). ///
///
Update: The date the specification was last modified (read-only). ///
///
Access: The date that the user last issued a client command. ///
///
FullName: The user's real name. ///
///
JobView: Selects jobs that are displayed when the user creates ///
a changelist. These jobs can be closed automatically ///
when the user submits the changelist. For a description ///
of jobview syntax, see 'p4 help jobview' ///
///
Reviews: The subscription list for change review. There is no ///
limit on the number of lines that this field can contain. ///
You can include the following wildcards: ///
///
... matches any characters including / ///
* matches any character except / ///
///
Password: The user's password. See 'p4 help passwd'. ///
///
Type: Must be 'service', operator, or 'standard'. Default is ///
'standard'. Once set, the user type cannot be changed. ///
///
The -d flag deletes the specified user (unless the user has files ///
open). ///
///
The -o flag writes the user specification to the standard output. ///
The user's editor is not invoked. ///
///
The -i flag reads a user specification from the standard input. ///
The user's editor is not invoked. ///
///
The -f flag forces the creation, update or deletion of the specified ///
user, and enables you to change the Last Modified date. By default, ///
users can only delete or modify their own user specifications. The ///
-f flag requires 'super' access, which is granted by 'p4 protect'. ///
///
///
/// /// To get a user's specification for a user with the username bsmith: /// /// User u = Repository.GetUser("bsmith"); /// /// /// public User GetUser(string user) { return GetUser(user, null); } /// /// Get a list of users from the repository /// /// Options for the users command. See: /// Optional list of users. /// A list containing the matching users /// ///
p4 help users ///
///
users -- List Perforce users ///
///
p4 users [-l -a -r -c] [-m max] [user ...] ///
///
Lists all Perforce users or users that match the 'user' argument. ///
The report includes the last time that each user accessed the system. ///
///
The -m max flag limits output to the first 'max' number of users. ///
///
The -a flag includes service and operator users in the output. ///
///
The -l flag includes additional information in the output. The -l ///
flag requires 'super' access, which is granted by 'p4 protect'. ///
///
The -r and -c flags are only allowed on replica servers. When ///
-r is given only users who have used a replica are reported and ///
when -c is given only the user information from the central server ///
is reported. Otherwise on a replica server, the user list will ///
be slightly different from the master server as the user access times ///
will reflect replica usage or master usage whichever is newer. ///
///
///
/// /// To get the first 10 users that start with the letter 'A': /// /// UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.None, 10); /// IList<User> users = Repository.getUsers(opts, "A*"); /// /// To get the users for 'Bob', 'Ted', 'Carol' and 'Alice': /// /// UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.None, -1); /// IList<User> users = Repository.getUsers(opts, "Bob", "Ted", "Carol", "Alice"); /// /// To get all the users (WARNING, will fetch all users from the repository): /// /// UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.IncludeAll, -1); /// IList<User> users = Repository.getUsers(opts, null); /// /// /// public IList GetUsers(Options options, params string[] user) { P4Command cmd = null; if ((user != null) && (user.Length > 0)) { cmd = new P4Command(this, "users", true, user); } else { cmd = new P4Command(this, "users", true); } P4CommandResult results = cmd.Run(options); if (results.Success) { if ((results.TaggedOutput == null) || (results.TaggedOutput.Count <= 0)) { return null; } List value = new List(); foreach (TaggedObject obj in results.TaggedOutput) { bool dst_mismatch = false; string offset = string.Empty; if (Server != null && Server.Metadata != null) { offset = Server.Metadata.DateTimeOffset; dst_mismatch = FormBase.DSTMismatch(Server.Metadata); } User u = new User(); u.FromUserCmdTaggedOutput(obj,offset,dst_mismatch); value.Add(u); } return value; } else { P4Exception.Throw(results.ErrorList); } return null; } /// /// Get a list of users from the repository /// /// Options for the users command. See: /// Optional list of users. /// A list containing the matching users /// ///
p4 help users ///
///
users -- List Perforce users ///
///
p4 users [-l -a -r -c] [-m max] [user ...] ///
///
Lists all Perforce users or users that match the 'user' argument. ///
The report includes the last time that each user accessed the system. ///
///
The -m max flag limits output to the first 'max' number of users. ///
///
The -a flag includes service and operator users in the output. ///
///
The -l flag includes additional information in the output. The -l ///
flag requires 'super' access, which is granted by 'p4 protect'. ///
///
The -r and -c flags are only allowed on replica servers. When ///
-r is given only users who have used a replica are reported and ///
when -c is given only the user information from the central server ///
is reported. Otherwise on a replica server, the user list will ///
be slightly different from the master server as the user access times ///
will reflect replica usage or master usage whichever is newer. ///
///
///
/// /// To get the first 10 users that start with the letter 'A': /// /// UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.None, 10); /// /// IList<String> names = new List<String>(); /// names.Add("A*"); /// /// IList<User> users = Repository.getUsers(names, opts); /// /// To get the users for 'Bob', 'Ted', 'Carol' and 'Alice': /// /// UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.None, -1); /// /// IList<String> names = new List<String>(); /// names.Add("Bob"); /// names.Add("Ted"); /// names.Add("Carol"); /// names.Add("Alice"); /// /// IList<User> users = Repository.getUsers(names, opts); /// /// To get all the users (WARNING, will fetch all users from the repository): /// /// UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.IncludeAll, -1); /// IList<User> users = Repository.getUsers(null, opts); /// /// /// public IList GetUsers( IList users, Options options) { if (users != null) { return GetUsers(options, users.ToArray()); } return GetUsers(options, null); } /// /// Delete a user from the repository /// /// The user to be deleted /// Only the '-f' flag is valid when deleting an existing user /// ///
///
p4 help user ///
///
user -- Create or edit a user specification ///
///
p4 user [-f] [name] ///
p4 user -d [-f] name ///
p4 user -o [name] ///
p4 user -i [-f] ///
///
Create a new user specification or edit an existing user specification. ///
The specification form is put into a temporary file and the editor ///
(configured by the environment variable $P4EDITOR) is invoked. ///
///
Normally, a user specification is created automatically the first ///
time that the user issues any command that updates the depot. The ///
'p4 user' command is typically used to edit the user's subscription ///
list for change review. ///
///
The user specification form contains the following fields: ///
///
User: The user name (read-only). ///
///
Email: The user's email address (Default: user@client). ///
///
Update: The date the specification was last modified (read-only). ///
///
Access: The date that the user last issued a client command. ///
///
FullName: The user's real name. ///
///
JobView: Selects jobs that are displayed when the user creates ///
a changelist. These jobs can be closed automatically ///
when the user submits the changelist. For a description ///
of jobview syntax, see 'p4 help jobview' ///
///
Reviews: The subscription list for change review. There is no ///
limit on the number of lines that this field can contain. ///
You can include the following wildcards: ///
///
... matches any characters including / ///
* matches any character except / ///
///
Password: The user's password. See 'p4 help passwd'. ///
///
Type: Must be 'service', operator, or 'standard'. Default is ///
'standard'. Once set, the user type cannot be changed. ///
///
The -d flag deletes the specified user (unless the user has files ///
open). ///
///
The -o flag writes the user specification to the standard output. ///
The user's editor is not invoked. ///
///
The -i flag reads a user specification from the standard input. ///
The user's editor is not invoked. ///
///
The -f flag forces the creation, update or deletion of the specified ///
user, and enables you to change the Last Modified date. By default, ///
users can only delete or modify their own user specifications. The ///
-f flag requires 'super' access, which is granted by 'p4 protect'. ///
///
///
/// /// To delete a user with the username bsmith (when connected with /// Connection.UserName = "bsmith"): /// /// User u = Repository.GetUser("bsmith"); /// Repository.DeleteUser(u, null); /// /// To delete a user with the username bsmith (when connected with /// a user that has super access): /// /// UserCmdOptions opts = new UserCmdOptions(UserCmdFlags.Force); /// /// User u = Repository.GetUser("bsmith"); /// Repository.DeleteUser(u, opts); /// /// /// public void DeleteUser(User user, Options options) { if (user == null) { throw new ArgumentNullException("user"); } P4Command cmd = new P4Command(this, "user", true, user.Id); if (options == null) { options = new Options(); } options["-d"] = null; P4CommandResult results = cmd.Run(options); if (results.Success == false) { P4Exception.Throw(results.ErrorList); } } } }