-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
614 additions
and
39 deletions.
There are no files selected for viewing
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,15 +1,36 @@ | ||
use clap::{load_yaml, App}; | ||
use clap_generate::{generate_to, generators::Bash}; | ||
use clap_generate::{ | ||
generate_to, | ||
generators::{Bash, Fish, Zsh}, | ||
}; | ||
|
||
const BIN_NAME: &str = "phylum"; | ||
const OUT_DIR: &str = "src/bin/"; | ||
|
||
fn main() { | ||
println!("Running build"); | ||
let yml = load_yaml!("src/bin/.conf/cli.yaml"); | ||
let mut app = App::from(yml); | ||
|
||
// Create tab completions files for some popular shells | ||
generate_to::<Bash, _, _>( | ||
&mut app, // We need to specify what generator to use | ||
"phylum", // We need to specify the bin name manually | ||
"src/bin/", // We need to specify where to write to | ||
&mut app, // We need to specify what generator to use | ||
BIN_NAME, // We need to specify the bin name manually | ||
OUT_DIR, // We need to specify where to write to | ||
) | ||
.unwrap(); | ||
|
||
generate_to::<Zsh, _, _>( | ||
&mut app, // We need to specify what generator to use | ||
BIN_NAME, // We need to specify the bin name manually | ||
OUT_DIR, // We need to specify where to write to | ||
) | ||
.unwrap(); | ||
|
||
generate_to::<Fish, _, _>( | ||
&mut app, // We need to specify what generator to use | ||
BIN_NAME, // We need to specify the bin name manually | ||
OUT_DIR, // We need to specify where to write to | ||
) | ||
.unwrap(); | ||
} |
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
Oops, something went wrong.