Skip to content

Commit

Permalink
Merge pull request #881 from nextstrain/feat/cli-improve-help
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov authored Jun 22, 2022
2 parents b8abb99 + 5d45010 commit ef842bb
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 6 deletions.
25 changes: 22 additions & 3 deletions packages_rs/nextclade-cli/src/cli/nextalign_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,15 @@ pub enum NextalignOutputSelection {

#[derive(Parser, Debug)]
pub struct NextalignRunArgs {
/// Path to a FASTA file with input sequences
/// Path to one or multiple FASTA files with input sequences
///
/// Accepts plain or compressed FASTA files. If a compressed fasta file is provided, it will be transparently
/// decompressed. Supported compression formats: `gz`, `bz2`, `xz`, `zstd`. Decompressor is chosen based on file
/// extension. If there's multiple input files, then different files can have different compression formats.
///
/// If no input files provided, the plain fasta input is read from standard input (stdin).
///
/// See: https://en.wikipedia.org/wiki/FASTA_format
#[clap(value_hint = ValueHint::FilePath)]
pub input_fastas: Vec<PathBuf>,

Expand Down Expand Up @@ -143,8 +151,7 @@ pub struct NextalignRunArgs {
/// Output files can be optionally included or excluded using `--output-selection` flag.
/// The base filename can be set using `--output-basename` flag.
///
/// If both the `--output-all` and individual `--output-*` flags are provided, each
// individual flag overrides the corresponding default output path.
/// If both the `--output-all` and individual `--output-*` flags are provided, each individual flag overrides the corresponding default output path.
///
/// At least one of the output flags is required: `--output-all`, `--output-fasta`, `--output-translations`, `--output-insertions`, `--output-errors`
///
Expand Down Expand Up @@ -184,6 +191,9 @@ pub struct NextalignRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'o')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -195,6 +205,9 @@ pub struct NextalignRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// Example for bash shell:
///
/// --output-translations='output_dir/gene_{{gene}}.translation.fasta'
Expand All @@ -208,6 +221,9 @@ pub struct NextalignRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'I')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -217,6 +233,9 @@ pub struct NextalignRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'e')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand Down
40 changes: 37 additions & 3 deletions packages_rs/nextclade-cli/src/cli/nextclade_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,15 @@ pub enum NextcladeOutputSelection {

#[derive(Parser, Debug, Clone)]
pub struct NextcladeRunArgs {
/// Path to a FASTA file with input sequences
/// Path to one or multiple FASTA files with input sequences
///
/// Accepts plain or compressed FASTA files. If a compressed fasta file is provided, it will be transparently
/// decompressed. Supported compression formats: `gz`, `bz2`, `xz`, `zstd`. Decompressor is chosen based on file
/// extension. If there's multiple input files, then different files can have different compression formats.
///
/// If no input files provided, the plain fasta input is read from standard input (stdin).
///
/// See: https://en.wikipedia.org/wiki/FASTA_format
#[clap(value_hint = ValueHint::FilePath)]
pub input_fastas: Vec<PathBuf>,

Expand Down Expand Up @@ -337,8 +345,7 @@ pub struct NextcladeRunArgs {
/// Output files can be optionally included or excluded using `--output-selection` flag.
/// The base filename can be set using `--output-basename` flag.
///
/// If both the `--output-all` and individual `--output-*` flags are provided, each
// individual flag overrides the corresponding default output path.
/// If both the `--output-all` and individual `--output-*` flags are provided, each individual flag overrides the corresponding default output path.
///
/// At least one of the output flags is required: `--output-all`, `--output-fasta`, `--output-ndjson`, `--output-json`, `--output-csv`, `--output-tsv`, `--output-tree`, `--output-translations`, `--output-insertions`, `--output-errors`
///
Expand Down Expand Up @@ -378,6 +385,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'o')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -389,6 +399,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// Example for bash shell:
///
/// --output-translations='output_dir/gene_{{gene}}.translation.fasta'
Expand All @@ -404,6 +417,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'N')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -415,6 +431,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'J')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -428,6 +447,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'c')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -441,6 +463,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 't')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -455,6 +480,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'T')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -464,6 +492,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'I')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand All @@ -473,6 +504,9 @@ pub struct NextcladeRunArgs {
///
/// Takes precedence over paths configured with `--output-all`, `--output-basename` and `--output-selection`.
///
/// If filename ends with one of the supported file extensions: `gz`, `bz2`, `xz`, `zstd`, it will be transparently
/// compressed. If a filename is "-" then the output will be written uncompressed to standard output (stdout).
///
/// If the required directory tree does not exist, it will be created.
#[clap(long, short = 'e')]
#[clap(value_hint = ValueHint::AnyPath)]
Expand Down

1 comment on commit ef842bb

@vercel
Copy link

@vercel vercel bot commented on ef842bb Jun 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextclade – ./

nextclade-nextstrain.vercel.app
nextclade.vercel.app
nextclade-git-master-nextstrain.vercel.app

Please sign in to comment.