Skip to content

Commit

Permalink
Add a -V/--version flag and fix bigwigvaluesoverbed about.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Apr 23, 2024
1 parent ccc8849 commit ea88d5f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
21 changes: 11 additions & 10 deletions bigtools/src/bin/bigtools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,57 +42,58 @@ struct ChromIntersectArgs {
}

#[derive(Clone, Debug, PartialEq, Subcommand)]
#[command(version)]
enum SubCommands {
Intersect {
#[command(flatten)]
args: IntersectArgs,
},
#[command(name = "chromintersect")]
#[command(name = "chromintersect", version)]
ChromIntersect {
#[command(flatten)]
args: ChromIntersectArgs,
},
#[command(name = "bedgraphtobigwig")]
#[command(name = "bedgraphtobigwig", version)]
BedGraphToBigWig {
#[command(flatten)]
args: BedGraphToBigWigArgs,
},
#[command(name = "bedtobigbed")]
#[command(name = "bedtobigbed", version)]
BedToBigBed {
#[command(flatten)]
args: BedToBigBedArgs,
},
#[command(name = "bigbedinfo")]
#[command(name = "bigbedinfo", version)]
BigBedInfo {
#[command(flatten)]
args: BigBedInfoArgs,
},
#[command(name = "bigbedtobed")]
#[command(name = "bigbedtobed", version)]
BigBedToBed {
#[command(flatten)]
args: BigBedToBedArgs,
},
#[command(name = "bigwigaverageoverbed")]
#[command(name = "bigwigaverageoverbed", version)]
BigWigAverageOverBed {
#[command(flatten)]
args: BigWigAverageOverBedArgs,
},
#[command(name = "bigwiginfo")]
#[command(name = "bigwiginfo", version)]
BigWigInfo {
#[command(flatten)]
args: BigWigInfoArgs,
},
#[command(name = "bigwigmerge")]
#[command(name = "bigwigmerge", version)]
BigWigMerge {
#[command(flatten)]
args: BigWigMergeArgs,
},
#[command(name = "bigwigtobedgraph")]
#[command(name = "bigwigtobedgraph", version)]
BigWigToBedGraph {
#[command(flatten)]
args: BigWigToBedGraphArgs,
},
#[command(name = "bigwigvaluesoverbed")]
#[command(name = "bigwigvaluesoverbed", version)]
BigWigValuesOverBed {
#[command(flatten)]
args: BigWigValuesOverBedArgs,
Expand Down
8 changes: 7 additions & 1 deletion bigtools/src/utils/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ pub fn compat_args(mut args: impl Iterator<Item = OsString>) -> impl Iterator<It
.unwrap_or(false)
{
let second = args.next();
let second = second.map(|a| a.to_ascii_lowercase());
let second = second.map(|a| {
if a.eq_ignore_ascii_case("-V") {
a
} else {
a.to_ascii_lowercase()
}
});
if let Some(command) = second
.as_ref()
.and_then(|f| Path::new(f).file_name())
Expand Down
2 changes: 1 addition & 1 deletion bigtools/src/utils/cli/bigwigvaluesoverbed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{BBIFileRead, BBIReadError};
#[derive(Clone, Debug, PartialEq, Parser)]
#[command(
name = "bigwigvaluesoverbed",
about = "Converts a bed to a bigBed.",
about = "For each bed interval, gets the base-resolution values from a bigWig.",
long_about = None,
)]
pub struct BigWigValuesOverBedArgs {
Expand Down

0 comments on commit ea88d5f

Please sign in to comment.