aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'nitrocli/src/commands.rs')
-rw-r--r--nitrocli/src/commands.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/nitrocli/src/commands.rs b/nitrocli/src/commands.rs
index 125b344..e1c88c8 100644
--- a/nitrocli/src/commands.rs
+++ b/nitrocli/src/commands.rs
@@ -584,6 +584,15 @@ pub fn pws_get(
Ok(())
}
+/// Write a PWS slot.
+pub fn pws_set(slot: u8, name: &str, login: &str, password: &str) -> Result<()> {
+ let device = get_device()?;
+ let pws = get_password_safe(&device)?;
+ pws
+ .write_slot(slot, name, login, password)
+ .map_err(|err| get_error("Could not write PWS slot", &err))
+}
+
#[cfg(test)]
mod tests {
use super::*;