pub struct AddArgs {Show 15 fields
pub name: Option<String>,
pub host: Option<String>,
pub port: Option<u16>,
pub socket: Option<PathBuf>,
pub user: Option<String>,
pub password_stdin: bool,
pub pin_database: Option<bool>,
pub auth: Option<String>,
pub client_cert: Option<PathBuf>,
pub client_key: Option<PathBuf>,
pub ca: Option<PathBuf>,
pub require_tls: Option<bool>,
pub session_setup: Vec<String>,
pub read_only_profile: Option<bool>,
pub check: bool,
}Expand description
Fields accepted when creating a profile.
The secret never travels as a flag value, because a flag value is visible in the process list of the whole machine.
Fields§
§name: Option<String>Profile name.
Optional to the argument layer and required to the command, for the
reason given on NameArgs.
host: Option<String>Server host.
port: Option<u16>Server port.
socket: Option<PathBuf>Local socket path, preferred over the network when present.
Also spelled --pipe, which is the name the manual publishes for the
same thing on the local channel Windows offers. The requirement number
is deliberately not written here: a number in a comment counts as a
citation to the coverage walk, and that requirement is still waiting on
a host this suite does not have. Naming it would discharge it.
One field carries both spellings, deliberately:
the driver has a single setting for it, documented as “path to unix
socket (or named pipe on Windows)”, so two fields would be two names
for one destination and the caller could set one while the work read
the other. That is precisely how --db and --database came to lose a
parameter in silence, and an alias cannot do it.
user: Option<String>User the credential belongs to.
password_stdin: boolRead the secret from the standard input.
pin_database: Option<bool>Fix the database, so the profile stops taking a database parameter.
The database itself is named by the global --database, which the
manual publishes for this command. A second local flag for the same
idea used to sit here and it silently won: the global absorbed the
value the caller wrote and the local field it filled was a different
one, so conn add p --database loja stored no database at all and
still succeeded.
Takes an optional value, like the two truth values below it. Creating a
profile has no third state to carry — there is nothing stored yet to
leave alone — so --pin-database false and leaving it out mean the same
thing here. It accepts the value anyway, because the alternative was
measured and is worse: on this one command --require-tls true was
accepted while --pin-database true ended in 2 with unexpected argument 'true', a message that names the value rather than the flag
and leaves the caller to guess which of three siblings takes one. The
spelling conn edit publishes has to work here too, or the caller
learns a form that breaks when they move it one command sideways.
auth: Option<String>Declared authentication method.
client_cert: Option<PathBuf>Client certificate presented to the server.
client_key: Option<PathBuf>Key matching the client certificate.
ca: Option<PathBuf>Authority used to verify the server certificate.
require_tls: Option<bool>Refuse to open unless the channel is encrypted.
Three states, because two cannot carry the answer. Written bare it
demands encryption, written --require-tls false it states this
destination does not, and left out it says nothing and lets the stored
conn.require_tls decide. A bare truth value here would make the stored
key unbeatable, which is the precedence the product publishes inverted.
session_setup: Vec<String>Session adjustments applied when opening.
read_only_profile: Option<bool>Refuse any change through this profile.
Takes an optional value for the reason given on --pin-database above:
creating a profile has no third state, but the spelling has to match the
one conn edit publishes.
check: boolConfirm the connection right away.
Trait Implementations§
Source§impl Args for AddArgs
impl Args for AddArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for AddArgs
impl FromArgMatches for AddArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.