mirror of
https://github.com/denisidoro/navi
synced 2024-11-25 13:00:20 +00:00
Merge pull request #684 from ukautz/feature/disable-repo-management
Add build feature to disable repo management
This commit is contained in:
commit
6a76afc535
3 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,7 @@ license = "Apache-2.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
disable-command-execution = []
|
disable-command-execution = []
|
||||||
|
disable-repo-management = []
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
travis-ci = { repository = "denisidoro/navi", branch = "master" }
|
travis-ci = { repository = "denisidoro/navi", branch = "master" }
|
||||||
|
|
|
@ -153,6 +153,7 @@ pub enum Command {
|
||||||
args: Vec<String>,
|
args: Vec<String>,
|
||||||
},
|
},
|
||||||
/// Manages cheatsheet repositories
|
/// Manages cheatsheet repositories
|
||||||
|
#[cfg(not(feature = "disable-repo-management"))]
|
||||||
Repo {
|
Repo {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
cmd: RepoCommand,
|
cmd: RepoCommand,
|
||||||
|
|
|
@ -8,7 +8,9 @@ pub mod repo_add;
|
||||||
pub mod repo_browse;
|
pub mod repo_browse;
|
||||||
pub mod shell;
|
pub mod shell;
|
||||||
|
|
||||||
use crate::config::Command::{Fn, Info, Preview, PreviewVar, PreviewVarStdin, Repo, Widget};
|
#[cfg(not(feature = "disable-repo-management"))]
|
||||||
|
use crate::config::Command::Repo;
|
||||||
|
use crate::config::Command::{Fn, Info, Preview, PreviewVar, PreviewVarStdin, Widget};
|
||||||
use crate::config::{RepoCommand, CONFIG};
|
use crate::config::{RepoCommand, CONFIG};
|
||||||
use crate::handler;
|
use crate::handler;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
@ -38,6 +40,7 @@ pub fn handle() -> Result<()> {
|
||||||
handler::info::main(info).with_context(|| format!("Failed to fetch info `{:#?}`", info))
|
handler::info::main(info).with_context(|| format!("Failed to fetch info `{:#?}`", info))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "disable-repo-management"))]
|
||||||
Repo { cmd } => match cmd {
|
Repo { cmd } => match cmd {
|
||||||
RepoCommand::Add { uri } => {
|
RepoCommand::Add { uri } => {
|
||||||
handler::repo_add::main(uri.clone())
|
handler::repo_add::main(uri.clone())
|
||||||
|
|
Loading…
Reference in a new issue