-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from BurntSushi/clap
Switch from Docopt to Clap.
- Loading branch information
Showing
14 changed files
with
1,173 additions
and
656 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#[macro_use] | ||
extern crate clap; | ||
#[macro_use] | ||
extern crate lazy_static; | ||
|
||
use std::fs; | ||
|
||
use clap::Shell; | ||
|
||
#[allow(dead_code)] | ||
#[path = "src/app.rs"] | ||
mod app; | ||
|
||
fn main() { | ||
fs::create_dir_all(env!("OUT_DIR")).unwrap(); | ||
|
||
let mut app = app::app_short(); | ||
app.gen_completions("rg", Shell::Bash, env!("OUT_DIR")); | ||
app.gen_completions("rg", Shell::Fish, env!("OUT_DIR")); | ||
// Zsh seems to fail with a panic. | ||
// app.gen_completions("rg", Shell::Zsh, env!("OUT_DIR")); | ||
app.gen_completions("rg", Shell::PowerShell, env!("OUT_DIR")); | ||
} |
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
Oops, something went wrong.