Example #1
0
        /// <summary>
        /// Builds the command string for this particular command.
        /// </summary>
        /// <returns>
        /// The command string for this particular command.
        /// </returns>
        protected string getSpecificCommandArguments( )
        {
            StringBuilder arguments = new StringBuilder();

            arguments.Append("client ");

            if (!Delete && View == null)
            {
                throw new BuildException("<p4client> requires either a \"view\""
                                         + " to create, or \"delete\"=\"true\" to delete a client.",
                                         Location);
            }

            if (Delete)
            {
                arguments.Append("-d ");
                if (Force)
                {
                    arguments.Append("-f ");
                }
            }
            else
            {
                if (View == null || Root == null)
                {
                    throw new BuildException("A \"view\" and \"root\" are required for creating/editing with <p4client>.");
                }
                // this creates or edits the client, then the -o outputs to standard out
                Perforce.CreateClient(User, ClientName, Root, View);
                arguments.Append("-o ");
            }
            arguments.Append(ClientName);

            return(arguments.ToString());
        }