Skip to content

Commit

Permalink
Added command 'offline'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Mar 12, 2024
1 parent 7ba455d commit 3e882b7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion gossip-bin/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Command {
}
}

const COMMANDS: [Command; 29] = [
const COMMANDS: [Command; 30] = [
Command {
cmd: "oneshot",
usage_params: "{depends}",
Expand Down Expand Up @@ -105,6 +105,11 @@ const COMMANDS: [Command; 29] = [
usage_params: "",
desc: "login on the command line before starting the gossip GUI",
},
Command {
cmd: "offline",
usage_params: "",
desc: "login on the command line before starting the gossip GUI",
},
Command {
cmd: "print_event",
usage_params: "<idhex>",
Expand Down Expand Up @@ -212,6 +217,10 @@ pub fn handle_command(mut args: env::Args, runtime: &Runtime) -> Result<bool, Er
login()?;
return Ok(false);
}
"offline" => {
offline()?;
return Ok(false);
}
"print_event" => print_event(command, args)?,
"print_followed" => print_followed(command)?,
"print_muted" => print_muted(command)?,
Expand Down Expand Up @@ -934,3 +943,8 @@ pub fn login() -> Result<(), Error> {
}
Ok(())
}

pub fn offline() -> Result<(), Error> {
GLOBALS.storage.write_setting_offline(&true, None)?;
Ok(())
}

0 comments on commit 3e882b7

Please sign in to comment.