Release 0.5.0

Rename to rups
This commit is contained in:
Aram 🍐 2021-08-01 03:17:17 -04:00
parent 539d11848e
commit feef67255f
21 changed files with 51 additions and 47 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "rupsc"
version = "0.4.0"
version = "0.5.0"
authors = ["Aram Peres <aram.peres@wavy.fm>"]
edition = "2018"
description = "A demo program to display UPS variables"
@ -16,7 +16,7 @@ license = "MIT"
clap = "2.33.3"
anyhow = "1"
[dependencies.nut-client]
version = "0.4.0"
path = "../nut-client"
[dependencies.rups]
version = "0.5.0"
path = "../rups"
features = ["ssl"]

View file

@ -1,14 +1,14 @@
# rupsc
[![crates.io](https://img.shields.io/crates/v/rupsc.svg)](https://crates.io/crates/rupsc)
[![Documentation](https://docs.rs/nut-client/badge.svg)](https://docs.rs/nut-client)
[![Documentation](https://docs.rs/rups/badge.svg)](https://docs.rs/rups)
[![MIT licensed](https://img.shields.io/crates/l/rupsc.svg)](./LICENSE)
[![CI](https://github.com/aramperes/nut-client-rs/workflows/CI/badge.svg)](https://github.com/aramperes/nut-client-rs/actions?query=workflow%3ACI)
A Rust clone of [upsc](https://networkupstools.org/docs/man/upsc.html),
the [Network UPS Tools](https://github.com/networkupstools/nut) (NUT) demo program to display UPS variables.
Written using the [nut-client](https://github.com/aramperes/nut-client-rs) crate.
Written using the [rups](https://github.com/aramperes/nut-client-rs) crate.
- Connect to `upsd`/`nut-server` using TCP
- List UPS devices

View file

@ -1,7 +1,7 @@
use anyhow::Context;
use nut_client::blocking::Connection;
use nut_client::Config;
use rups::blocking::Connection;
use rups::Config;
/// Lists each UPS on the upsd server, one per line.
pub fn list_devices(config: Config, with_description: bool) -> anyhow::Result<()> {

View file

@ -82,7 +82,7 @@ fn main() -> anyhow::Result<()> {
let ssl = insecure_ssl || args.is_present("ssl");
let host = server.try_into()?;
let config = nut_client::ConfigBuilder::new()
let config = rups::ConfigBuilder::new()
.with_host(host)
.with_debug(debug)
.with_ssl(ssl)

View file

@ -64,10 +64,10 @@ impl<'a> TryFrom<&'a str> for UpsdName<'a> {
}
}
impl<'a> TryInto<nut_client::Host> for UpsdName<'a> {
impl<'a> TryInto<rups::Host> for UpsdName<'a> {
type Error = anyhow::Error;
fn try_into(self) -> anyhow::Result<nut_client::Host> {
fn try_into(self) -> anyhow::Result<rups::Host> {
(self.hostname.to_owned(), self.port)
.try_into()
.with_context(|| "Invalid hostname/port")