Adding docs in new files and functions

This commit is contained in:
João M. Bezerra 2021-10-31 03:03:31 -03:00
parent 95d38e99f6
commit 20e0067cad
5 changed files with 12 additions and 3 deletions

View File

@ -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},

View File

@ -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)
}

View File

@ -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;

View File

@ -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();

View File

@ -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