cli/terminal: remove Help struct
The `Help` struct is no longer needed thanks to `clap`, so it is removed.
This commit is contained in:
parent
e359435040
commit
fec8a27a36
|
|
@ -1,6 +1,6 @@
|
||||||
pub mod args;
|
pub mod args;
|
||||||
|
|
||||||
pub use args::{Args, Error, Help};
|
pub use args::{Args, Error};
|
||||||
pub mod format;
|
pub mod format;
|
||||||
pub mod io;
|
pub mod io;
|
||||||
pub use io::signer;
|
pub use io::signer;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ use radicle::node::{Address, Alias};
|
||||||
use radicle::prelude::{Did, NodeId, RepoId};
|
use radicle::prelude::{Did, NodeId, RepoId};
|
||||||
|
|
||||||
use crate::git::Rev;
|
use crate::git::Rev;
|
||||||
use crate::terminal as term;
|
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
|
@ -36,20 +35,6 @@ pub enum Error {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Help {
|
|
||||||
pub name: &'static str,
|
|
||||||
pub description: &'static str,
|
|
||||||
pub version: &'static str,
|
|
||||||
pub usage: &'static str,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Help {
|
|
||||||
/// Print help to stdout.
|
|
||||||
pub fn print(&self) {
|
|
||||||
term::help(self.name, self.version, self.description, self.usage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait Args: Sized {
|
pub trait Args: Sized {
|
||||||
fn from_env() -> anyhow::Result<Self> {
|
fn from_env() -> anyhow::Result<Self> {
|
||||||
let args: Vec<_> = std::env::args_os().skip(1).collect();
|
let args: Vec<_> = std::env::args_os().skip(1).collect();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue