Compare commits

...

7 Commits
v0.1.1 ... main

5 changed files with 19 additions and 13 deletions

6
Cargo.lock generated
View File

@ -319,9 +319,9 @@ dependencies = [
[[package]]
name = "crossbeam-deque"
version = "0.8.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [
"cfg-if",
"crossbeam-epoch",
@ -1229,7 +1229,7 @@ dependencies = [
[[package]]
name = "mxadm"
version = "0.1.0"
version = "0.1.2"
dependencies = [
"anyhow",
"clap",

View File

@ -1,7 +1,7 @@
[package]
name = "mxadm"
description = "A simple CLI interface to basic Matrix room admin tasks"
version = "0.1.0"
version = "0.1.2"
authors = ["Jez Cope <j.cope@erambler.co.uk>"]
edition = "2018"
license = "GPL-3.0-or-later"

View File

@ -8,7 +8,14 @@
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ rustup pkgconfig openssl.dev ];
buildInputs = with pkgs; [
rustup
rustracer
cargo-outdated
cargo-audit
pkgconfig
openssl.dev
];
};
});
}

View File

@ -1,4 +1,4 @@
#[deny(unsafe_code)]
#![deny(unsafe_code)]
#[macro_use]
extern crate clap;
#[macro_use]
@ -18,7 +18,7 @@ async fn main() -> Result<()> {
.subcommand(
SubCommand::with_name("login")
.about("authenticates and saves the session details")
.args_from_usage("-U, --user=[USERNAME] 'Specifies the username to log in with'"),
.args_from_usage("-U, --user=[MXID] 'Specifies the Matrix ID (like @you:example.com) to log in with'"),
)
.subcommand(SubCommand::with_name("logout").about("ends the current session"))
.subcommand(SubCommand::with_name("status").about("displays current session status"))
@ -34,8 +34,8 @@ async fn main() -> Result<()> {
SubCommand::with_name("tombstone")
.about("add a tombstone redirecting one room to another")
.args_from_usage(
"<OLD_ROOM_ID> 'The ID of the source room'
<NEW_ROOM_ID> 'The ID of the target room'",
"<OLD_ROOM_ID> 'The ID (like !aBcD:example.com) of the source room'
<NEW_ROOM_ID> 'The ID (like !pQrS:example.com) of the target room'",
)
.arg(
Arg::with_name("MSG")
@ -53,14 +53,14 @@ async fn main() -> Result<()> {
SubCommand::with_name("add")
.about("adds an alias to a room")
.args_from_usage(
"<ROOM_ID> 'The ID of the room to alias'
<ALIAS> 'The new alias to add'",
"<ROOM_ID> 'The ID (like !aBcD:example.com) of the room to alias'
<ALIAS> 'The new alias (like #alias:example.com) to add'",
),
)
.subcommand(
SubCommand::with_name("delete")
.about("deletes an existing alias")
.args_from_usage("<ALIAS> 'The alias to delete'"),
.args_from_usage("<ALIAS> 'The alias (like #alias:example.com) to delete'"),
),
);
let matches = app.get_matches();

View File

@ -1,7 +1,6 @@
use anyhow::{Context, Result};
use directories::ProjectDirs;
use matrix_sdk::{Client, ClientConfig, Session};
use serde_lexpr;
use std::fs::{create_dir_all, File};
use std::io::ErrorKind;