Skip to content

Commit

Permalink
Merge pull request #513 from BoostCookie/betterCompletions
Browse files Browse the repository at this point in the history
Better completions
  • Loading branch information
str4d authored Aug 28, 2024
2 parents b179b7c + d483e0b commit 51760e3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
7 changes: 6 additions & 1 deletion rage/src/bin/rage-keygen/cli.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use clap::{builder::Styles, ArgAction, Parser};
use clap::{
builder::{Styles, ValueHint},
ArgAction, Parser,
};

use crate::fl;

Expand All @@ -22,6 +25,7 @@ pub(crate) struct AgeOptions {
#[arg(help_heading = fl!("args-header"))]
#[arg(value_name = fl!("input"))]
#[arg(help = fl!("help-arg-input"))]
#[arg(value_hint = ValueHint::FilePath)]
pub(crate) input: Option<String>,

#[arg(action = ArgAction::Help, short, long)]
Expand All @@ -35,6 +39,7 @@ pub(crate) struct AgeOptions {
#[arg(short, long)]
#[arg(value_name = fl!("output"))]
#[arg(help = fl!("keygen-help-flag-output"))]
#[arg(value_hint = ValueHint::DirPath)]
pub(crate) output: Option<String>,

#[arg(short = 'y')]
Expand Down
8 changes: 7 additions & 1 deletion rage/src/bin/rage-mount/cli.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use clap::{builder::Styles, ArgAction, Parser};
use clap::{
builder::{Styles, ValueHint},
ArgAction, Parser,
};

use crate::fl;

Expand All @@ -24,11 +27,13 @@ pub(crate) struct AgeMountOptions {
#[arg(help_heading = fl!("args-header"))]
#[arg(value_name = fl!("mnt-filename"))]
#[arg(help = fl!("help-arg-mnt-filename"))]
#[arg(value_hint = ValueHint::FilePath)]
pub(crate) filename: String,

#[arg(help_heading = fl!("args-header"))]
#[arg(value_name = fl!("mnt-mountpoint"))]
#[arg(help = fl!("help-arg-mnt-mountpoint"))]
#[arg(value_hint = ValueHint::DirPath)]
pub(crate) mountpoint: String,

#[arg(action = ArgAction::Help, short, long)]
Expand All @@ -51,5 +56,6 @@ pub(crate) struct AgeMountOptions {
#[arg(short, long)]
#[arg(value_name = fl!("identity"))]
#[arg(help = fl!("help-flag-identity"))]
#[arg(value_hint = ValueHint::FilePath)]
pub(crate) identity: Vec<String>,
}
9 changes: 8 additions & 1 deletion rage/src/bin/rage/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::path::Path;

use clap::{builder::Styles, ArgAction, Parser};
use clap::{
builder::{Styles, ValueHint},
ArgAction, Parser,
};

use crate::fl;

Expand Down Expand Up @@ -99,6 +102,7 @@ pub(crate) struct AgeOptions {
#[arg(help_heading = fl!("args-header"))]
#[arg(value_name = fl!("input"))]
#[arg(help = fl!("help-arg-input"))]
#[arg(value_hint = ValueHint::FilePath)]
pub(crate) input: Option<String>,

#[arg(action = ArgAction::Help, short, long)]
Expand Down Expand Up @@ -137,11 +141,13 @@ pub(crate) struct AgeOptions {
#[arg(short = 'R', long)]
#[arg(value_name = fl!("recipients-file"))]
#[arg(help = fl!("help-flag-recipients-file"))]
#[arg(value_hint = ValueHint::FilePath)]
pub(crate) recipients_file: Vec<String>,

#[arg(short, long)]
#[arg(value_name = fl!("identity"))]
#[arg(help = fl!("help-flag-identity"))]
#[arg(value_hint = ValueHint::FilePath)]
pub(crate) identity: Vec<String>,

#[arg(short = 'j')]
Expand All @@ -152,5 +158,6 @@ pub(crate) struct AgeOptions {
#[arg(short, long)]
#[arg(value_name = fl!("output"))]
#[arg(help = fl!("help-flag-output"))]
#[arg(value_hint = ValueHint::AnyPath)]
pub(crate) output: Option<String>,
}

0 comments on commit 51760e3

Please sign in to comment.