pub struct Args {Show 15 fields
pub interface_name: Option<String>,
pub status: Vec<String>,
pub mm_url: Option<String>,
pub mm_user: Option<String>,
pub secret_type: Option<SecretType>,
pub keyring_service: Option<String>,
pub mm_secret: Option<String>,
pub mm_secret_cmd: Option<String>,
pub state_dir: Option<PathBuf>,
pub begin: Option<String>,
pub end: Option<String>,
pub expires_at: Option<String>,
pub delay: Option<u32>,
pub verbose: QuietVerbose,
pub offdays: OffDays,
}Expand description
Automate mattermost status with the help of wifi network
Use current visible wifi SSID to automate your mattermost status.
This program is meant to either be running in background or be call regularly
with option --delay 0.
It will then update your mattermost custom status according to the config file
Fields§
§interface_name: Option<String>wifi interface name
status: Vec<String>Status configuration triplets (:: separated)
Each triplet shall have the format:
“wifi_substring::emoji_name::status_text”. If wifi_substring is empty, the ssociated
status will be used for off time.
mm_url: Option<String>mattermost URL
mm_user: Option<String>User name used for mattermost login or for password or private token lookup in OS keyring.
secret_type: Option<SecretType>Type of secret. Either Password (default) or Token
keyring_service: Option<String>Service name used for mattermost secret lookup in OS keyring.
The secret is either a password (default) or atoken according to
secret_type option
mm_secret: Option<String>mattermost private Token
Usage of this option may leak your personal token. It is recommended to
use mm_token_cmd or keyring_service.
The secret is either a password (default) or atoken according to
secret_type option
mm_secret_cmd: Option<String>mattermost secret command
The secret is either a password (default) or atoken according to
secret_type option
state_dir: Option<PathBuf>directory for state file
Will use content of XDG_CACHE_HOME if unset.
begin: Option<String>beginning of status update with the format hh:mm
Before this time the status won’t be updated
end: Option<String>end of status update with the format hh:mm
After this time the status won’t be updated
expires_at: Option<String>Expiration time with the format hh:mm
This parameter is used to set the custom status expiration time Set to “0” to avoid setting expiration time
delay: Option<u32>delay between wifi SSID polling in seconds
verbose: QuietVerbose§offdays: OffDaysDays off for which the custom status shall not be changed
Implementations§
Source§impl Args
impl Args
Sourcepub fn update_secret_with_keyring(self) -> Result<Self>
pub fn update_secret_with_keyring(self) -> Result<Self>
Update args.mm_secret with the one fetched from OS keyring
Sourcepub fn update_secret_with_command(self) -> Result<Args>
pub fn update_secret_with_command(self) -> Result<Args>
Update args.mm_secret with the standard output of
args.mm_secret_cmd if defined.
If the secret is a password, secret will be updated later when login to the mattermost
server
Sourcepub fn merge_config_and_params(&self) -> Result<Args>
pub fn merge_config_and_params(&self) -> Result<Args>
Merge with precedence default Args, config file and command line parameters.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Args
impl<'de> Deserialize<'de> for Args
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl StructOpt for Args
impl StructOpt for Args
Source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches. It’s guaranteed to succeed
if matches originates from an App generated by StructOpt::clap called on
the same type, otherwise it must panic.Source§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
std::env::args_os).
Calls clap::Error::exit on failure, printing the error message and aborting the program.Source§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
std::env::args_os).
Unlike StructOpt::from_args, returns clap::Error on failure instead of aborting the program,
so calling .exit is up to you.Source§fn from_iter<I>(iter: I) -> Self
fn from_iter<I>(iter: I) -> Self
Vec of your making.
Print the error message and quit the program in case of failure. Read more