mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
Adding docs in new files and functions
This commit is contained in:
parent
95d38e99f6
commit
20e0067cad
@ -1,4 +1,6 @@
|
||||
//! CLI arg parser configuration, command detection and input treatment.
|
||||
//! CLI configuration step, uses definitions from `opts.rs`.
|
||||
//!
|
||||
//! Also used to treat some inputs.
|
||||
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
|
@ -21,6 +21,7 @@ pub enum CompressionFormat {
|
||||
}
|
||||
|
||||
impl CompressionFormat {
|
||||
/// Currently supported archive formats are .tar (and aliases to it) and .zip
|
||||
pub fn is_archive_format(&self) -> bool {
|
||||
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zip)
|
||||
}
|
||||
|
@ -6,13 +6,15 @@
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
// Macros should be declared before
|
||||
pub mod macros;
|
||||
|
||||
pub mod archive;
|
||||
pub mod cli;
|
||||
pub mod commands;
|
||||
pub mod dialogs;
|
||||
pub mod error;
|
||||
pub mod extension;
|
||||
pub mod macros;
|
||||
pub mod opts;
|
||||
pub mod utils;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Macros used on ouch.
|
||||
|
||||
#[macro_export]
|
||||
/// Macro that prints message in INFO mode
|
||||
#[macro_export]
|
||||
macro_rules! info {
|
||||
($($arg:tt)*) => {
|
||||
$crate::macros::_info_helper();
|
||||
|
@ -1,7 +1,9 @@
|
||||
//! CLI configuration step, uses definitions from `opts.rs`, also used to treat some inputs.
|
||||
use clap::{Parser, ValueHint};
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Command line options
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(version, about)]
|
||||
pub struct Opts {
|
||||
@ -13,10 +15,12 @@ pub struct Opts {
|
||||
#[clap(short, long)]
|
||||
pub no: bool,
|
||||
|
||||
/// Action to take
|
||||
#[clap(subcommand)]
|
||||
pub cmd: Subcommand,
|
||||
}
|
||||
|
||||
/// Actions to take
|
||||
#[derive(Parser, PartialEq, Eq, Debug)]
|
||||
pub enum Subcommand {
|
||||
/// Compress files. Alias: c
|
||||
|
Loading…
x
Reference in New Issue
Block a user