mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-20 03:57:03 +00:00
Added command 'offline'
This commit is contained in:
parent
7ba455d1f9
commit
3e882b7416
@ -29,7 +29,7 @@ impl Command {
|
||||
}
|
||||
}
|
||||
|
||||
const COMMANDS: [Command; 29] = [
|
||||
const COMMANDS: [Command; 30] = [
|
||||
Command {
|
||||
cmd: "oneshot",
|
||||
usage_params: "{depends}",
|
||||
@ -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>",
|
||||
@ -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)?,
|
||||
@ -934,3 +943,8 @@ pub fn login() -> Result<(), Error> {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn offline() -> Result<(), Error> {
|
||||
GLOBALS.storage.write_setting_offline(&true, None)?;
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user