aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/client
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/command/client.rs8
-rw-r--r--src/command/client/history.rs16
-rw-r--r--src/command/client/import.rs2
-rw-r--r--src/command/client/search.rs20
-rw-r--r--src/command/client/stats.rs2
-rw-r--r--src/command/client/sync.rs4
-rw-r--r--src/command/client/sync/login.rs3
-rw-r--r--src/command/client/sync/register.rs3
8 files changed, 28 insertions, 30 deletions
diff --git a/src/command/client.rs b/src/command/client.rs
index 94148c09..f7b9d6fb 100644
--- a/src/command/client.rs
+++ b/src/command/client.rs
@@ -14,14 +14,14 @@ mod search;
mod stats;
#[derive(Subcommand)]
-#[clap(infer_subcommands = true)]
+#[command(infer_subcommands = true)]
pub enum Cmd {
/// Manipulate shell history
- #[clap(subcommand)]
+ #[command(subcommand)]
History(history::Cmd),
/// Import shell history from file
- #[clap(subcommand)]
+ #[command(subcommand)]
Import(import::Cmd),
/// Calculate statistics for your history
@@ -31,7 +31,7 @@ pub enum Cmd {
Search(search::Cmd),
#[cfg(feature = "sync")]
- #[clap(flatten)]
+ #[command(flatten)]
Sync(sync::Cmd),
}
diff --git a/src/command/client/history.rs b/src/command/client/history.rs
index 07f4b319..6a78adc9 100644
--- a/src/command/client/history.rs
+++ b/src/command/client/history.rs
@@ -20,7 +20,7 @@ use log::debug;
use super::search::format_duration;
#[derive(Subcommand)]
-#[clap(infer_subcommands = true)]
+#[command(infer_subcommands = true)]
pub enum Cmd {
/// Begins a new command in the history
Start { command: Vec<String> },
@@ -28,33 +28,33 @@ pub enum Cmd {
/// Finishes a new command in the history (adds time, exit code)
End {
id: String,
- #[clap(long, short)]
+ #[arg(long, short)]
exit: i64,
},
/// List all items in history
List {
- #[clap(long, short)]
+ #[arg(long, short)]
cwd: bool,
- #[clap(long, short)]
+ #[arg(long, short)]
session: bool,
- #[clap(long)]
+ #[arg(long)]
human: bool,
/// Show only the text of the command
- #[clap(long)]
+ #[arg(long)]
cmd_only: bool,
},
/// Get the last command ran
Last {
- #[clap(long)]
+ #[arg(long)]
human: bool,
/// Show only the text of the command
- #[clap(long)]
+ #[arg(long)]
cmd_only: bool,
},
}
diff --git a/src/command/client/import.rs b/src/command/client/import.rs
index 60fd536d..b0375acd 100644
--- a/src/command/client/import.rs
+++ b/src/command/client/import.rs
@@ -14,7 +14,7 @@ use atuin_client::{
};
#[derive(Parser)]
-#[clap(infer_subcommands = true)]
+#[command(infer_subcommands = true)]
pub enum Cmd {
/// Import history for the current shell
Auto,
diff --git a/src/command/client/search.rs b/src/command/client/search.rs
index 1cef1ffc..26026f34 100644
--- a/src/command/client/search.rs
+++ b/src/command/client/search.rs
@@ -18,45 +18,45 @@ pub use duration::format_duration;
#[derive(Parser)]
pub struct Cmd {
/// Filter search result by directory
- #[clap(long, short)]
+ #[arg(long, short)]
cwd: Option<String>,
/// Exclude directory from results
- #[clap(long = "exclude-cwd")]
+ #[arg(long = "exclude-cwd")]
exclude_cwd: Option<String>,
/// Filter search result by exit code
- #[clap(long, short)]
+ #[arg(long, short)]
exit: Option<i64>,
/// Exclude results with this exit code
- #[clap(long = "exclude-exit")]
+ #[arg(long = "exclude-exit")]
exclude_exit: Option<i64>,
/// Only include results added before this date
- #[clap(long, short)]
+ #[arg(long, short)]
before: Option<String>,
/// Only include results after this date
- #[clap(long)]
+ #[arg(long)]
after: Option<String>,
/// How many entries to return at most
- #[clap(long)]
+ #[arg(long)]
limit: Option<i64>,
/// Open interactive search UI
- #[clap(long, short)]
+ #[arg(long, short)]
interactive: bool,
/// Use human-readable formatting for time
- #[clap(long)]
+ #[arg(long)]
human: bool,
query: Vec<String>,
/// Show only the text of the command
- #[clap(long)]
+ #[arg(long)]
cmd_only: bool,
}
diff --git a/src/command/client/stats.rs b/src/command/client/stats.rs
index 157496de..a00eb369 100644
--- a/src/command/client/stats.rs
+++ b/src/command/client/stats.rs
@@ -13,7 +13,7 @@ use atuin_client::{
};
#[derive(Parser)]
-#[clap(infer_subcommands = true)]
+#[command(infer_subcommands = true)]
pub struct Cmd {
/// compute statistics for the specified period, leave blank for statistics since the beginning
period: Vec<String>,
diff --git a/src/command/client/sync.rs b/src/command/client/sync.rs
index af809f3e..51fcbf63 100644
--- a/src/command/client/sync.rs
+++ b/src/command/client/sync.rs
@@ -8,12 +8,12 @@ mod logout;
mod register;
#[derive(Subcommand)]
-#[clap(infer_subcommands = true)]
+#[command(infer_subcommands = true)]
pub enum Cmd {
/// Sync with the configured server
Sync {
/// Force re-download everything
- #[clap(long, short)]
+ #[arg(long, short)]
force: bool,
},
diff --git a/src/command/client/sync/login.rs b/src/command/client/sync/login.rs
index 29222563..333a1514 100644
--- a/src/command/client/sync/login.rs
+++ b/src/command/client/sync/login.rs
@@ -1,6 +1,6 @@
use std::io;
-use clap::{AppSettings, Parser};
+use clap::Parser;
use eyre::Result;
use tokio::{fs::File, io::AsyncWriteExt};
@@ -9,7 +9,6 @@ use atuin_common::api::LoginRequest;
use rpassword::prompt_password;
#[derive(Parser)]
-#[clap(setting(AppSettings::DeriveDisplayOrder))]
pub struct Cmd {
#[clap(long, short)]
pub username: Option<String>,
diff --git a/src/command/client/sync/register.rs b/src/command/client/sync/register.rs
index 2b5b9ced..6b51fac8 100644
--- a/src/command/client/sync/register.rs
+++ b/src/command/client/sync/register.rs
@@ -1,11 +1,10 @@
-use clap::{AppSettings, Parser};
+use clap::Parser;
use eyre::Result;
use tokio::{fs::File, io::AsyncWriteExt};
use atuin_client::{api_client, settings::Settings};
#[derive(Parser)]
-#[clap(setting(AppSettings::DeriveDisplayOrder))]
pub struct Cmd {
#[clap(long, short)]
pub username: Option<String>,