mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +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::{
|
use std::{
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
@ -21,6 +21,7 @@ pub enum CompressionFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl CompressionFormat {
|
impl CompressionFormat {
|
||||||
|
/// Currently supported archive formats are .tar (and aliases to it) and .zip
|
||||||
pub fn is_archive_format(&self) -> bool {
|
pub fn is_archive_format(&self) -> bool {
|
||||||
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zip)
|
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zip)
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,15 @@
|
|||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
|
// Macros should be declared before
|
||||||
|
pub mod macros;
|
||||||
|
|
||||||
pub mod archive;
|
pub mod archive;
|
||||||
pub mod cli;
|
pub mod cli;
|
||||||
pub mod commands;
|
pub mod commands;
|
||||||
pub mod dialogs;
|
pub mod dialogs;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod extension;
|
pub mod extension;
|
||||||
pub mod macros;
|
|
||||||
pub mod opts;
|
pub mod opts;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//! Macros used on ouch.
|
//! Macros used on ouch.
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
/// Macro that prints message in INFO mode
|
/// Macro that prints message in INFO mode
|
||||||
|
#[macro_export]
|
||||||
macro_rules! info {
|
macro_rules! info {
|
||||||
($($arg:tt)*) => {
|
($($arg:tt)*) => {
|
||||||
$crate::macros::_info_helper();
|
$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 clap::{Parser, ValueHint};
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
/// Command line options
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[clap(version, about)]
|
#[clap(version, about)]
|
||||||
pub struct Opts {
|
pub struct Opts {
|
||||||
@ -13,10 +15,12 @@ pub struct Opts {
|
|||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
pub no: bool,
|
pub no: bool,
|
||||||
|
|
||||||
|
/// Action to take
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
pub cmd: Subcommand,
|
pub cmd: Subcommand,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Actions to take
|
||||||
#[derive(Parser, PartialEq, Eq, Debug)]
|
#[derive(Parser, PartialEq, Eq, Debug)]
|
||||||
pub enum Subcommand {
|
pub enum Subcommand {
|
||||||
/// Compress files. Alias: c
|
/// Compress files. Alias: c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user