Skip to content

Commit

Permalink
Merge branch 'ar/improve-helps' into 'master'
Browse files Browse the repository at this point in the history
[qol] Adds short helps to all commands when no arguments are provided

See merge request machine-learning/modkit!148
  • Loading branch information
ArtRand committed Mar 4, 2024
2 parents c6dd700 + 3835c87 commit b2d6f2c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use mod_kit::commands::Commands;

#[derive(Parser)]
#[command(version)]
/// Modkit is a bioinformatics tool for working with modified bases from Oxford
/// Nanopore
struct Cli {
#[command(subcommand)]
command: Commands,
Expand Down
6 changes: 6 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ fn get_sampling_options(
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct Adjust {
/// BAM file to collapse mod call from. Can be a path to a file or one of
/// `-` or `stdin` to specify a stream from standard input.
Expand Down Expand Up @@ -308,6 +309,7 @@ fn parse_percentiles(
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct SampleModBaseProbs {
/// Input BAM with modified base tags. If a index is found
/// reads will be sampled evenly across the length of the
Expand Down Expand Up @@ -575,6 +577,7 @@ impl SampleModBaseProbs {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct ModSummarize {
/// Input modBam, can be a path to a file or one of `-` or
/// `stdin` to specify a stream from standard input.
Expand Down Expand Up @@ -850,6 +853,7 @@ impl ModSummarize {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct MotifBed {
/// Input FASTA file
fasta: PathBuf,
Expand Down Expand Up @@ -887,6 +891,7 @@ impl ModMode {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct Update {
/// BAM to update modified base tags in. Can be a path to a file or one of
/// `-` or `stdin` to specify a stream from standard input.
Expand Down Expand Up @@ -1035,6 +1040,7 @@ impl Update {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct CallMods {
// running args
/// Input BAM, may be sorted and have associated index available. Can be a
Expand Down
2 changes: 2 additions & 0 deletions src/dmr/subcommands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl BedMethylDmr {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct PairwiseDmr {
/// Bgzipped bedMethyl file for the first (usually control) sample. There
/// should be a tabix index with the same name and .tbi next to this
Expand Down Expand Up @@ -354,6 +355,7 @@ impl PairwiseDmr {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct MultiSampleDmr {
/// Two or more named samples to compare. Two arguments are required <path>
/// <name>. This option should be repeated at least two times.
Expand Down
1 change: 1 addition & 0 deletions src/extract/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use crate::util::{
use crate::writers::TsvWriter;

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct ExtractMods {
/// Path to modBAM file to extract read-level information from, or one of
/// `-` or `stdin` to specify a stream from standard input. If a file
Expand Down
2 changes: 2 additions & 0 deletions src/pileup/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use crate::writers::{
};

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct ModBamPileup {
// running args
/// Input BAM, should be sorted and have associated index available.
Expand Down Expand Up @@ -794,6 +795,7 @@ enum Presets {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct DuplexModBamPileup {
// running args
/// Input BAM, should be sorted and have associated index available.
Expand Down
1 change: 1 addition & 0 deletions src/repair_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use std::path::PathBuf;
use std::sync::Arc;

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct RepairTags {
/// Donor modBAM with original MM/ML tags. Must be sorted by read name.
#[arg(long, short = 'd', alias = "donor")]
Expand Down
1 change: 1 addition & 0 deletions src/validate/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ fn print_table(status_probs: &StatusProbs, show_percentages: bool) {
}

#[derive(Args)]
#[command(arg_required_else_help = true)]
pub struct ValidateFromModbam {
// running args
// convert to list of bam bed inputs
Expand Down

0 comments on commit b2d6f2c

Please sign in to comment.