Skip to main content

GlobalOpts

Struct GlobalOpts 

Source
pub struct GlobalOpts { /* private fields */ }
Expand description

§Synopsis

Global options for Perforce commands; these options can be supplied on the command line before any Perforce command.

Implementations§

Source§

impl GlobalOpts

Source

pub fn new() -> Self

Source

pub fn setup_args<'a>(&self, command: &'a mut Command) -> &'a mut Command

Source§

impl GlobalOpts

Source

pub fn get_batch_size(&self) -> Option<&u32>

§Description

-b batchsize

Specifies a batch size (number of arguments) to use when processing a command from a file with the -x argfile option. By default, the batch size is 128.

Source

pub fn set_batch_size(&mut self, v: u32) -> &mut Self

§Description

-b batchsize

Specifies a batch size (number of arguments) to use when processing a command from a file with the -x argfile option. By default, the batch size is 128.

Source

pub fn batch_size(self, v: u32) -> Self

§Description

-b batchsize

Specifies a batch size (number of arguments) to use when processing a command from a file with the -x argfile option. By default, the batch size is 128.

Source

pub fn get_client(&self) -> Option<&String>

§Description

-c client

Overrides any P4CLIENT setting with the specified client name.

Source

pub fn set_client(&mut self, v: impl Into<String>) -> &mut Self

§Description

-c client

Overrides any P4CLIENT setting with the specified client name.

Source

pub fn client(self, v: impl Into<String>) -> Self

§Description

-c client

Overrides any P4CLIENT setting with the specified client name.

Source

pub fn get_dir(&self) -> Option<&PathBuf>

§Description

-d dir

Overrides any PWD setting (current working directory) and replaces it with the specified directory.

Source

pub fn set_dir(&mut self, v: PathBuf) -> &mut Self

§Description

-d dir

Overrides any PWD setting (current working directory) and replaces it with the specified directory.

Source

pub fn dir(self, v: PathBuf) -> Self

§Description

-d dir

Overrides any PWD setting (current working directory) and replaces it with the specified directory.

Source

pub fn get_progress_indicators(&self) -> bool

§Description

-I

Specify that progress indicators, if available, are desired. This option is not compatible with the -s and -G options.

The progress indicator with the -I option is available for p4 -I move, p4 -I reconcile, p4 -I status, p4 -I submit, and p4 -I sync -q. For p4 -I reconcile and p4 -I status, the progress indicator shows four phases: reconcile add, reconcile edit, matching digest, and matching content. The add phase displays the number of directories scanned. All other phases show a percentage of files processed against total of candidate (deleted) files. For p4 -I move, the progress indicator shows two phases: matching digest, and matching content.

Source

pub fn set_progress_indicators(&mut self, v: bool) -> &mut Self

§Description

-I

Specify that progress indicators, if available, are desired. This option is not compatible with the -s and -G options.

The progress indicator with the -I option is available for p4 -I move, p4 -I reconcile, p4 -I status, p4 -I submit, and p4 -I sync -q. For p4 -I reconcile and p4 -I status, the progress indicator shows four phases: reconcile add, reconcile edit, matching digest, and matching content. The add phase displays the number of directories scanned. All other phases show a percentage of files processed against total of candidate (deleted) files. For p4 -I move, the progress indicator shows two phases: matching digest, and matching content.

Source

pub fn progress_indicators(self, v: bool) -> Self

§Description

-I

Specify that progress indicators, if available, are desired. This option is not compatible with the -s and -G options.

The progress indicator with the -I option is available for p4 -I move, p4 -I reconcile, p4 -I status, p4 -I submit, and p4 -I sync -q. For p4 -I reconcile and p4 -I status, the progress indicator shows four phases: reconcile add, reconcile edit, matching digest, and matching content. The add phase displays the number of directories scanned. All other phases show a percentage of files processed against total of candidate (deleted) files. For p4 -I move, the progress indicator shows two phases: matching digest, and matching content.

Source

pub fn get_standard_in(&self) -> bool

§Description

-i

Although not global, the -i and -o options work with forms and represent standard in and standard out.

Source

pub fn set_standard_in(&mut self, v: bool) -> &mut Self

§Description

-i

Although not global, the -i and -o options work with forms and represent standard in and standard out.

Source

pub fn standard_in(self, v: bool) -> Self

§Description

-i

Although not global, the -i and -o options work with forms and represent standard in and standard out.

Source

pub fn get_marshalled_formatted(&self) -> bool

§Description

-G

Causes all output (and batch input for form commands with -i) to be formatted as marshaled Python dictionary objects. This is most often used when scripting.

§Note

Use the -G option with the -z tag option. Otherwise the marshaled output might be invalid.

See also the Usage notes.

Source

pub fn set_marshalled_formatted(&mut self, v: bool) -> &mut Self

§Description

-G

Causes all output (and batch input for form commands with -i) to be formatted as marshaled Python dictionary objects. This is most often used when scripting.

§Note

Use the -G option with the -z tag option. Otherwise the marshaled output might be invalid.

See also the Usage notes.

Source

pub fn marshalled_formatted(self, v: bool) -> Self

§Description

-G

Causes all output (and batch input for form commands with -i) to be formatted as marshaled Python dictionary objects. This is most often used when scripting.

§Note

Use the -G option with the -z tag option. Otherwise the marshaled output might be invalid.

See also the Usage notes.

Source

pub fn get_json_formatted(&self) -> bool

§Description

-Mj

Formats output as line-delimited JSON objects, with non-UTF8 characters replaced with U+FFFD

§Note

Use the -Mj option with the -z tag option. Otherwise the marshaled output might be invalid.

Source

pub fn set_json_formatted(&mut self, v: bool) -> &mut Self

§Description

-Mj

Formats output as line-delimited JSON objects, with non-UTF8 characters replaced with U+FFFD

§Note

Use the -Mj option with the -z tag option. Otherwise the marshaled output might be invalid.

Source

pub fn json_formatted(self, v: bool) -> Self

§Description

-Mj

Formats output as line-delimited JSON objects, with non-UTF8 characters replaced with U+FFFD

§Note

Use the -Mj option with the -z tag option. Otherwise the marshaled output might be invalid.

Source

pub fn get_host(&self) -> Option<&String>

§Description

-H host

Overrides any P4HOST setting and replaces it with the specified hostname.

Source

pub fn set_host(&mut self, v: impl Into<String>) -> &mut Self

§Description

-H host

Overrides any P4HOST setting and replaces it with the specified hostname.

Source

pub fn host(self, v: impl Into<String>) -> Self

§Description

-H host

Overrides any P4HOST setting and replaces it with the specified hostname.

Source

pub fn get_standard_out(&self) -> bool

§Description

-o

Although not global, the -i and -o options work with forms and represent standard in and standard out.

Source

pub fn set_standard_out(&mut self, v: bool) -> &mut Self

§Description

-o

Although not global, the -i and -o options work with forms and represent standard in and standard out.

Source

pub fn standard_out(self, v: bool) -> Self

§Description

-o

Although not global, the -i and -o options work with forms and represent standard in and standard out.

Source

pub fn get_port(&self) -> Option<&String>

§Description

-p port

Overrides any P4PORT setting with the specified protocol:host:port.

Source

pub fn set_port(&mut self, v: impl Into<String>) -> &mut Self

§Description

-p port

Overrides any P4PORT setting with the specified protocol:host:port.

Source

pub fn port(self, v: impl Into<String>) -> Self

§Description

-p port

Overrides any P4PORT setting with the specified protocol:host:port.

Source

pub fn get_pass(&self) -> Option<&String>

§Description

-P pass

Enables a password (or ticket) to be passed on the command line, thus bypassing the password associated with P4PASSWD. If a valid ticket exists, using this option with an invalid pass causes access to be granted by the valid ticket.

Source

pub fn set_pass(&mut self, v: impl Into<String>) -> &mut Self

§Description

-P pass

Enables a password (or ticket) to be passed on the command line, thus bypassing the password associated with P4PASSWD. If a valid ticket exists, using this option with an invalid pass causes access to be granted by the valid ticket.

Source

pub fn pass(self, v: impl Into<String>) -> Self

§Description

-P pass

Enables a password (or ticket) to be passed on the command line, thus bypassing the password associated with P4PASSWD. If a valid ticket exists, using this option with an invalid pass causes access to be granted by the valid ticket.

Source

pub fn get_retries(&self) -> Option<&u32>

§Description

-r retries

Specifies the number of times to retry a command (notably, p4 sync) if the network times out.

Source

pub fn set_retries(&mut self, v: u32) -> &mut Self

§Description

-r retries

Specifies the number of times to retry a command (notably, p4 sync) if the network times out.

Source

pub fn retries(self, v: u32) -> Self

§Description

-r retries

Specifies the number of times to retry a command (notably, p4 sync) if the network times out.

Source

pub fn get_prepend_descriptive(&self) -> bool

§Description

-s

Prepends a descriptive field (for example, text:, info:, error:, exit:) to each line of output produced by a P4 Server command. This is most often used when scripting.

Source

pub fn set_prepend_descriptive(&mut self, v: bool) -> &mut Self

§Description

-s

Prepends a descriptive field (for example, text:, info:, error:, exit:) to each line of output produced by a P4 Server command. This is most often used when scripting.

Source

pub fn prepend_descriptive(self, v: bool) -> Self

§Description

-s

Prepends a descriptive field (for example, text:, info:, error:, exit:) to each line of output produced by a P4 Server command. This is most often used when scripting.

Source

pub fn get_user(&self) -> Option<&String>

§Description

-u user

Overrides any P4USER, USER, or USERNAME setting with the specified user name.

Source

pub fn set_user(&mut self, v: impl Into<String>) -> &mut Self

§Description

-u user

Overrides any P4USER, USER, or USERNAME setting with the specified user name.

Source

pub fn user(self, v: impl Into<String>) -> Self

§Description

-u user

Overrides any P4USER, USER, or USERNAME setting with the specified user name.

Source

pub fn get_argfile(&self) -> Option<&PathBuf>

§Description

-x argfile

Instructs P4 Server to read arguments, one per line, from the specified file. If argfile is a single hyphen (-), instructs P4 Server to read from standard input instead of from a file.

Source

pub fn set_argfile(&mut self, v: PathBuf) -> &mut Self

§Description

-x argfile

Instructs P4 Server to read arguments, one per line, from the specified file. If argfile is a single hyphen (-), instructs P4 Server to read from standard input instead of from a file.

Source

pub fn argfile(self, v: PathBuf) -> Self

§Description

-x argfile

Instructs P4 Server to read arguments, one per line, from the specified file. If argfile is a single hyphen (-), instructs P4 Server to read from standard input instead of from a file.

Source

pub fn get_charset(&self) -> Option<&String>

§Description

-C charset

Overrides any P4CHARSET setting with the specified character set.

Source

pub fn set_charset(&mut self, v: impl Into<String>) -> &mut Self

§Description

-C charset

Overrides any P4CHARSET setting with the specified character set.

Source

pub fn charset(self, v: impl Into<String>) -> Self

§Description

-C charset

Overrides any P4CHARSET setting with the specified character set.

Source

pub fn get_command_charset(&self) -> Option<&String>

§Description

-Q charset

Overrides any P4COMMANDCHARSET setting with the specified character set.

Source

pub fn set_command_charset(&mut self, v: impl Into<String>) -> &mut Self

§Description

-Q charset

Overrides any P4COMMANDCHARSET setting with the specified character set.

Source

pub fn command_charset(self, v: impl Into<String>) -> Self

§Description

-Q charset

Overrides any P4COMMANDCHARSET setting with the specified character set.

Source

pub fn get_language(&self) -> Option<&String>

§Description

-L language

This feature is reserved for system integrators.

Source

pub fn set_language(&mut self, v: impl Into<String>) -> &mut Self

§Description

-L language

This feature is reserved for system integrators.

Source

pub fn language(self, v: impl Into<String>) -> Self

§Description

-L language

This feature is reserved for system integrators.

Source

pub fn get_tagged_format(&self) -> bool

§Description

-z tag

Causes output of many reporting commands to be in the same tagged format as that generated by p4 fstat.

§Note

Use this option for all marshaled output, such as that of -G and -Mj. Otherwise the marshaled output might be invalid.

See also the Timestamp and Unix epoch information.

Source

pub fn set_tagged_format(&mut self, v: bool) -> &mut Self

§Description

-z tag

Causes output of many reporting commands to be in the same tagged format as that generated by p4 fstat.

§Note

Use this option for all marshaled output, such as that of -G and -Mj. Otherwise the marshaled output might be invalid.

See also the Timestamp and Unix epoch information.

Source

pub fn tagged_format(self, v: bool) -> Self

§Description

-z tag

Causes output of many reporting commands to be in the same tagged format as that generated by p4 fstat.

§Note

Use this option for all marshaled output, such as that of -G and -Mj. Otherwise the marshaled output might be invalid.

See also the Timestamp and Unix epoch information.

Source

pub fn get_quiet_mode(&self) -> bool

§Description

-q

Quiet mode, which suppresses informational messages and reports only warnings or errors.

Source

pub fn set_quiet_mode(&mut self, v: bool) -> &mut Self

§Description

-q

Quiet mode, which suppresses informational messages and reports only warnings or errors.

Source

pub fn quiet_mode(self, v: bool) -> Self

§Description

-q

Quiet mode, which suppresses informational messages and reports only warnings or errors.

Source

pub fn get_debug_variable(&self) -> Option<&[String]>

§Description

-v var

Debug level or configurable represented by var, such as: p4 -v 1 info or p4 -v net.autotune=0 info. This option can be specified more than once; each call appends another var.

Source

pub fn set_debug_variable(&mut self, v: impl Into<String>) -> &mut Self

§Description

-v var

Debug level or configurable represented by var, such as: p4 -v 1 info or p4 -v net.autotune=0 info. This option can be specified more than once; each call appends another var.

Source

pub fn debug_variable(self, v: impl Into<String>) -> Self

§Description

-v var

Debug level or configurable represented by var, such as: p4 -v 1 info or p4 -v net.autotune=0 info. This option can be specified more than once; each call appends another var.

Source

pub fn get_display_version(&self) -> bool

§Description

-V

Displays the version of the p4 application and exits.

Source

pub fn set_display_version(&mut self, v: bool) -> &mut Self

§Description

-V

Displays the version of the p4 application and exits.

Source

pub fn display_version(self, v: bool) -> Self

§Description

-V

Displays the version of the p4 application and exits.

Source

pub fn get_display_help(&self) -> bool

§Description

-h

Displays basic usage information and exits.

Source

pub fn set_display_help(&mut self, v: bool) -> &mut Self

§Description

-h

Displays basic usage information and exits.

Source

pub fn display_help(self, v: bool) -> Self

§Description

-h

Displays basic usage information and exits.

Trait Implementations§

Source§

impl Clone for GlobalOpts

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GlobalOpts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GlobalOpts

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.