forked from leftwm/leftwm-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autocomplete(*): Attempt to begin adding autocomplete support, leftwm#45
- Loading branch information
Showing
5 changed files
with
69 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
mod config; | ||
mod leftwm; | ||
mod theme; | ||
mod shells; | ||
|
||
pub use config::{Config, Repo, THEMES_DIR}; | ||
pub use leftwm::LeftWm; | ||
pub use theme::{DependencyL, Theme}; | ||
pub use shells::Shell; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use clap::{App, ArgEnum}; | ||
use clap_generate::{generators::*, generate}; | ||
|
||
#[derive(ArgEnum, Copy, Clone, Debug)] | ||
pub enum Shell { | ||
Bash, | ||
Zsh, | ||
Fish, | ||
PowerShell, | ||
Elvish | ||
} | ||
|
||
impl Shell{ | ||
pub fn generate(&self, mut app: App) { | ||
let mut fd = std::io::stdout(); | ||
match self{ | ||
Shell::Bash => generate::<Bash, _>(Bash, &mut app, "leftwm-theme", &mut fd), | ||
Shell::Zsh => generate::<Zsh, _>(Zsh, &mut app, "leftwm-theme", &mut fd), | ||
Shell::Fish => generate::<Fish, _>(Fish, &mut app, "leftwm-theme", &mut fd), | ||
Shell::PowerShell => generate::<PowerShell, _>(PowerShell, &mut app, "leftwm-theme", &mut fd), | ||
Shell::Elvish => generate::<Elvish, _>(Elvish, &mut app, "leftwm-theme", &mut fd), | ||
} | ||
} | ||
} | ||
|
||
|