aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/history.rs
diff options
context:
space:
mode:
authorJamie Quigley <jamie@quigley.xyz>2022-04-07 06:32:11 +0100
committerGitHub <noreply@github.com>2022-04-07 06:32:11 +0100
commitf861893293629f4f8c315b8042295df049973e29 (patch)
tree995af6417a0e02a05478703023f9c9438f9ac500 /src/command/history.rs
parentAdd compact mode (#288) (diff)
downloadatuin-f861893293629f4f8c315b8042295df049973e29.zip
Update to clap 3.1.x (#289)
Diffstat (limited to 'src/command/history.rs')
-rw-r--r--src/command/history.rs41
1 files changed, 16 insertions, 25 deletions
diff --git a/src/command/history.rs b/src/command/history.rs
index b644b9ac..6eaa6407 100644
--- a/src/command/history.rs
+++ b/src/command/history.rs
@@ -2,8 +2,8 @@ use std::env;
use std::io::Write;
use std::time::Duration;
+use clap::Subcommand;
use eyre::Result;
-use structopt::StructOpt;
use tabwriter::TabWriter;
use atuin_client::database::Database;
@@ -11,51 +11,42 @@ use atuin_client::history::History;
use atuin_client::settings::Settings;
use atuin_client::sync;
-#[derive(StructOpt)]
+#[derive(Subcommand)]
+#[clap(infer_subcommands = true)]
pub enum Cmd {
- #[structopt(
- about="begins a new command in the history",
- aliases=&["s", "st", "sta", "star"],
- )]
+ /// Begins a new command in the history
Start { command: Vec<String> },
- #[structopt(
- about="finishes a new command in the history (adds time, exit code)",
- aliases=&["e", "en"],
- )]
+ /// Finishes a new command in the history (adds time, exit code)
End {
id: String,
- #[structopt(long, short)]
+ #[clap(long, short)]
exit: i64,
},
- #[structopt(
- about="list all items in history",
- aliases=&["l", "li", "lis"],
- )]
+ /// List all items in history
List {
- #[structopt(long, short)]
+ #[clap(long, short)]
cwd: bool,
- #[structopt(long, short)]
+ #[clap(long, short)]
session: bool,
- #[structopt(long, short)]
+ #[clap(long)]
human: bool,
- #[structopt(long, help = "Show only the text of the command")]
+ /// Show only the text of the command
+ #[clap(long)]
cmd_only: bool,
},
- #[structopt(
- about="get the last command ran",
- aliases=&["la", "las"],
- )]
+ /// Get the last command ran
Last {
- #[structopt(long, short)]
+ #[clap(long)]
human: bool,
- #[structopt(long, help = "Show only the text of the command")]
+ /// Show only the text of the command
+ #[clap(long)]
cmd_only: bool,
},
}