aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/client/init.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conrad.ludgate@truelayer.com>2022-04-21 10:12:56 +0100
committerGitHub <noreply@github.com>2022-04-21 09:12:56 +0000
commitd57f549855caf8ab90b5ea0ae7cc9445f3abedfc (patch)
tree0818ff405a3b697a0ca981d215ceb4dbb30cd15a /src/command/client/init.rs
parentFix SQL cache query (#318) (diff)
downloadatuin-d57f549855caf8ab90b5ea0ae7cc9445f3abedfc.zip
refactor commands for better separation (#313)
* refactor commands for better separation * fmt
Diffstat (limited to 'src/command/client/init.rs')
-rw-r--r--src/command/client/init.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/command/client/init.rs b/src/command/client/init.rs
new file mode 100644
index 00000000..a2c6378c
--- /dev/null
+++ b/src/command/client/init.rs
@@ -0,0 +1,36 @@
+use clap::Parser;
+
+#[derive(Parser)]
+pub enum Cmd {
+ /// Zsh setup
+ Zsh,
+ /// Bash setup
+ Bash,
+ /// Fish setup
+ Fish,
+}
+
+fn init_zsh() {
+ let full = include_str!("../../shell/atuin.zsh");
+ println!("{}", full);
+}
+
+fn init_bash() {
+ let full = include_str!("../../shell/atuin.bash");
+ println!("{}", full);
+}
+
+fn init_fish() {
+ let full = include_str!("../../shell/atuin.fish");
+ println!("{}", full);
+}
+
+impl Cmd {
+ pub fn run(&self) {
+ match self {
+ Self::Zsh => init_zsh(),
+ Self::Bash => init_bash(),
+ Self::Fish => init_fish(),
+ }
+ }
+}