From d93b93fece4991a39e8b8747d6e795611d69e3e4 Mon Sep 17 00:00:00 2001 From: mario Date: Wed, 2 Nov 2016 19:43:27 +0100 Subject: [PATCH 01/18] Change from types implementing build_ui to a mod for every binary. Works with all available binaries. Code cleanup --- bin/build.rs | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 bin/build.rs diff --git a/bin/build.rs b/bin/build.rs new file mode 100644 index 00000000..d762f6bf --- /dev/null +++ b/bin/build.rs @@ -0,0 +1,93 @@ +extern crate clap; +extern crate libimagrt; +extern crate libimagentrytag; +extern crate libimagutil; +#[macro_use] extern crate version; + +use clap::Shell; +use libimagrt::runtime::Runtime; + +macro_rules! gen_types_buildui { + ($(($p:expr, $n:ident)$(,)*)*) => ( + $( + mod $n { + include!($p); + } + )* + ) +} + +gen_types_buildui!( + ("../imag-bookmark/src/ui.rs", imagbookmark), + ("../imag-counter/src/ui.rs", imagcounter), + ("../imag-diary/src/ui.rs", imagdiary), + ("../imag-link/src/ui.rs", imaglink), + ("../imag-notes/src/ui.rs", imagnotes), + ("../imag-ref/src/ui.rs", imagref), + ("../imag-store/src/ui.rs", imagstore), + ("../imag-tag/src/ui.rs", imagtag), + ("../imag-todo/src/ui.rs", imagtodo), + ("../imag-view/src/ui.rs", imagview) + ); + +fn main() { + let mut app = Runtime::get_default_cli_builder( + "imag", + &version!()[..], + "imag") + .subcommand( + imagbookmark::build_ui(Runtime::get_default_cli_builder( + "bookmark", + &version!()[..], + "bookmark"))) + .subcommand( + imagcounter::build_ui(Runtime::get_default_cli_builder( + "counter", + &version!()[..], + "counter"))) + .subcommand( + imagdiary::build_ui(Runtime::get_default_cli_builder( + "diary", + &version!()[..], + "diary"))) + .subcommand( + imaglink::build_ui(Runtime::get_default_cli_builder( + "link", + &version!()[..], + "link"))) + .subcommand( + imagnotes::build_ui(Runtime::get_default_cli_builder( + "notes", + &version!()[..], + "notes"))) + .subcommand( + imagref::build_ui(Runtime::get_default_cli_builder( + "ref", + &version!()[..], + "ref"))) + .subcommand( + imagstore::build_ui(Runtime::get_default_cli_builder( + "store", + &version!()[..], + "store"))) + .subcommand( + imagtag::build_ui(Runtime::get_default_cli_builder( + "tag", + &version!()[..], + "tag"))) + .subcommand( + imagtodo::build_ui(Runtime::get_default_cli_builder( + "todo", + &version!()[..], + "todo"))) + .subcommand( + imagview::build_ui(Runtime::get_default_cli_builder( + "view", + &version!()[..], + "view"))) + ; + app.gen_completions("imag", Shell::Bash, env!("OUT_DIR")); + app.gen_completions("imag", Shell::Fish, env!("OUT_DIR")); + app.gen_completions("imag", Shell::Zsh, env!("OUT_DIR")); + +} From a825f4aba6130812c66f78ef5c52819b8f62ed72 Mon Sep 17 00:00:00 2001 From: mario Date: Wed, 2 Nov 2016 20:02:26 +0100 Subject: [PATCH 02/18] Add additional dependencies --- bin/Cargo.toml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 bin/Cargo.toml diff --git a/bin/Cargo.toml b/bin/Cargo.toml new file mode 100644 index 00000000..76cc0636 --- /dev/null +++ b/bin/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "imag" +version = "0.2.0" +authors = ["Matthias Beyer "] + +description = "Part of the imag core distribution: imag command" + +keywords = ["imag", "PIM", "personal", "information", "management"] +readme = "../README.md" +license = "LGPL-2.1" + +documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.html" +repository = "https://github.com/matthiasbeyer/imag" +homepage = "http://imag-pim.org" + +build = "build.rs" + +[build-dependencies] +clap = ">=2.16.1" +version = "2.0" +libimagrt = { path = "../libimagrt" } +libimagentrytag = { path = "../libimagentrytag" } +libimagutil = { path = "../libimagutil" } + +[profile.dev] +codegen-units = 2 + +[dependencies] +version = "2.0" +walkdir = "0.1" +crossbeam = "0.2" +clap = "2.*" +log = "0.3" + +[dependencies.libimagrt] +path = "../libimagrt" + +[dependencies.libimagerror] +path = "../libimagerror" + From 85cd326818a959d186270be370cc4b12417bc419 Mon Sep 17 00:00:00 2001 From: mario Date: Sat, 5 Nov 2016 11:09:42 +0100 Subject: [PATCH 03/18] Add build_subcommand! macro --- bin/build.rs | 74 ++++++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 52 deletions(-) diff --git a/bin/build.rs b/bin/build.rs index d762f6bf..47430eef 100644 --- a/bin/build.rs +++ b/bin/build.rs @@ -17,6 +17,15 @@ macro_rules! gen_types_buildui { ) } +macro_rules! build_subcommand { + ($name:expr, $module:ident) => ( + $module::build_ui(Runtime::get_default_cli_builder( + $name, + &version!()[..], + $name)) + ) +} + gen_types_buildui!( ("../imag-bookmark/src/ui.rs", imagbookmark), ("../imag-counter/src/ui.rs", imagcounter), @@ -28,66 +37,27 @@ gen_types_buildui!( ("../imag-tag/src/ui.rs", imagtag), ("../imag-todo/src/ui.rs", imagtodo), ("../imag-view/src/ui.rs", imagview) - ); +); fn main() { let mut app = Runtime::get_default_cli_builder( "imag", &version!()[..], "imag") - .subcommand( - imagbookmark::build_ui(Runtime::get_default_cli_builder( - "bookmark", - &version!()[..], - "bookmark"))) - .subcommand( - imagcounter::build_ui(Runtime::get_default_cli_builder( - "counter", - &version!()[..], - "counter"))) - .subcommand( - imagdiary::build_ui(Runtime::get_default_cli_builder( - "diary", - &version!()[..], - "diary"))) - .subcommand( - imaglink::build_ui(Runtime::get_default_cli_builder( - "link", - &version!()[..], - "link"))) - .subcommand( - imagnotes::build_ui(Runtime::get_default_cli_builder( - "notes", - &version!()[..], - "notes"))) - .subcommand( - imagref::build_ui(Runtime::get_default_cli_builder( - "ref", - &version!()[..], - "ref"))) - .subcommand( - imagstore::build_ui(Runtime::get_default_cli_builder( - "store", - &version!()[..], - "store"))) - .subcommand( - imagtag::build_ui(Runtime::get_default_cli_builder( - "tag", - &version!()[..], - "tag"))) - .subcommand( - imagtodo::build_ui(Runtime::get_default_cli_builder( - "todo", - &version!()[..], - "todo"))) - .subcommand( - imagview::build_ui(Runtime::get_default_cli_builder( - "view", - &version!()[..], - "view"))) - ; + .subcommand(build_subcommand!("bookmark", imagbookmark)) + .subcommand(build_subcommand!("counter", imagcounter)) + .subcommand(build_subcommand!("diary", imagdiary)) + .subcommand(build_subcommand!("link", imaglink)) + .subcommand(build_subcommand!("notes", imagnotes)) + .subcommand(build_subcommand!("ref", imagref)) + .subcommand(build_subcommand!("store", imagstore)) + .subcommand(build_subcommand!("tag", imagtag)) + .subcommand(build_subcommand!("todo", imagtodo)) + .subcommand(build_subcommand!("view", imagview)); + app.gen_completions("imag", Shell::Bash, env!("OUT_DIR")); app.gen_completions("imag", Shell::Fish, env!("OUT_DIR")); app.gen_completions("imag", Shell::Zsh, env!("OUT_DIR")); } + From 0f22941cd05b3279436b82cb2b79ea4535adaeae Mon Sep 17 00:00:00 2001 From: mario Date: Sat, 5 Nov 2016 11:25:25 +0100 Subject: [PATCH 04/18] Add comments about functionality, increase verbosity of some variables --- bin/build.rs | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/bin/build.rs b/bin/build.rs index 47430eef..183f2351 100644 --- a/bin/build.rs +++ b/bin/build.rs @@ -7,16 +7,35 @@ extern crate libimagutil; use clap::Shell; use libimagrt::runtime::Runtime; -macro_rules! gen_types_buildui { - ($(($p:expr, $n:ident)$(,)*)*) => ( +/// This macro generates mods with the given '$modulename', +/// whose content is the file given with `$path`. +/// In this case, It is used specifically to include the +/// `ui.rs` files of the imag binaries. +/// The imag project (accidentally?) followed the convention +/// to write a `ui.rs` containing the function +/// `fn build_ui(app : App) -> App`. +/// This macro allows us to use the same named functions by +/// putting them each into their own module. +macro_rules! gen_mods_buildui { + ($(($path:expr, $modulename:ident)$(,)*)*) => ( $( - mod $n { - include!($p); + mod $modulename { + include!($path); } )* ) } +/// This macro reduces boilerplate code. +/// +/// For example: `build_subcommand!("counter", imagcounter)` +/// will result in the following code: +/// ```ignore +/// imagcounter::build_ui(Runtime::get_default_cli_builder( +/// "counter", +/// &version!()[..], +/// "counter")) +/// ``` macro_rules! build_subcommand { ($name:expr, $module:ident) => ( $module::build_ui(Runtime::get_default_cli_builder( @@ -26,7 +45,8 @@ macro_rules! build_subcommand { ) } -gen_types_buildui!( +// Actually generates the module. +gen_mods_buildui!( ("../imag-bookmark/src/ui.rs", imagbookmark), ("../imag-counter/src/ui.rs", imagcounter), ("../imag-diary/src/ui.rs", imagdiary), @@ -40,10 +60,12 @@ gen_types_buildui!( ); fn main() { + // Make the `imag`-App... let mut app = Runtime::get_default_cli_builder( "imag", &version!()[..], "imag") + // and add all the subapps as subcommands. .subcommand(build_subcommand!("bookmark", imagbookmark)) .subcommand(build_subcommand!("counter", imagcounter)) .subcommand(build_subcommand!("diary", imagdiary)) @@ -55,6 +77,7 @@ fn main() { .subcommand(build_subcommand!("todo", imagtodo)) .subcommand(build_subcommand!("view", imagview)); + // Actually generates the completion files app.gen_completions("imag", Shell::Bash, env!("OUT_DIR")); app.gen_completions("imag", Shell::Fish, env!("OUT_DIR")); app.gen_completions("imag", Shell::Zsh, env!("OUT_DIR")); From ec2b8984bb4626563f51f86cbd9993a99c017fb5 Mon Sep 17 00:00:00 2001 From: mario Date: Sat, 5 Nov 2016 11:52:23 +0100 Subject: [PATCH 05/18] Add comment for `&version!()[..]` --- bin/build.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/build.rs b/bin/build.rs index 183f2351..a7d44a20 100644 --- a/bin/build.rs +++ b/bin/build.rs @@ -36,6 +36,10 @@ macro_rules! gen_mods_buildui { /// &version!()[..], /// "counter")) /// ``` +/// As for the `&version!()[..]` part, it does not matter +/// which version the subcommand is getting here, as the +/// output of this script is a completion script, which +/// does not contain information about the version at all. macro_rules! build_subcommand { ($name:expr, $module:ident) => ( $module::build_ui(Runtime::get_default_cli_builder( From de9ef077c30893eb27fe9ebfecc387b9060251d8 Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 01:20:37 +0200 Subject: [PATCH 06/18] add build.rs again --- bin/core/imag/Cargo.toml | 9 ++++- bin/core/imag/build.rs | 87 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 bin/core/imag/build.rs diff --git a/bin/core/imag/Cargo.toml b/bin/core/imag/Cargo.toml index e0770a6b..b8c4f8b7 100644 --- a/bin/core/imag/Cargo.toml +++ b/bin/core/imag/Cargo.toml @@ -13,7 +13,14 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h repository = "https://github.com/matthiasbeyer/imag" homepage = "http://imag-pim.org" -build = "../../../build.rs" +build = "build.rs" + +[build-dependencies] +clap = ">=2.16.1" +version = "2.0" +libimagrt = { path = "../../../lib/core/libimagrt" } +libimagentrytag = { path = "../../../lib/entry/libimagentrytag" } +libimagutil = { path = "../../../lib/etc/libimagutil" } [badges] travis-ci = { repository = "matthiasbeyer/imag" } diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs new file mode 100644 index 00000000..4c9c8a21 --- /dev/null +++ b/bin/core/imag/build.rs @@ -0,0 +1,87 @@ +extern crate clap; +extern crate libimagrt; +extern crate libimagentrytag; +extern crate libimagutil; +#[macro_use] extern crate version; + +use clap::Shell; +use libimagrt::runtime::Runtime; + +/// This macro generates mods with the given '$modulename', +/// whose content is the file given with `$path`. +/// In this case, It is used specifically to include the +/// `ui.rs` files of the imag binaries. +/// The imag project (accidentally?) followed the convention +/// to write a `ui.rs` containing the function +/// `fn build_ui(app : App) -> App`. +/// This macro allows us to use the same named functions by +/// putting them each into their own module. +macro_rules! gen_mods_buildui { + ($(($path:expr, $modulename:ident)$(,)*)*) => ( + $( + mod $modulename { + include!($path); + } + )* + ) +} + +/// This macro reduces boilerplate code. +/// +/// For example: `build_subcommand!("counter", imagcounter)` +/// will result in the following code: +/// ```ignore +/// imagcounter::build_ui(Runtime::get_default_cli_builder( +/// "counter", +/// &version!()[..], +/// "counter")) +/// ``` +/// As for the `&version!()[..]` part, it does not matter +/// which version the subcommand is getting here, as the +/// output of this script is a completion script, which +/// does not contain information about the version at all. +macro_rules! build_subcommand { + ($name:expr, $module:ident) => ( + $module::build_ui(Runtime::get_default_cli_builder($name, &version!()[..], $name)) + ) +} + +// Actually generates the module. +gen_mods_buildui!( + ("../imag-bookmark/src/ui.rs", imagbookmark), + ("../imag-counter/src/ui.rs", imagcounter), + ("../imag-diary/src/ui.rs", imagdiary), + ("../imag-link/src/ui.rs", imaglink), + ("../imag-notes/src/ui.rs", imagnotes), + ("../imag-ref/src/ui.rs", imagref), + ("../imag-store/src/ui.rs", imagstore), + ("../imag-tag/src/ui.rs", imagtag), + ("../imag-todo/src/ui.rs", imagtodo), + ("../imag-view/src/ui.rs", imagview) +); + +fn main() { + // Make the `imag`-App... + let mut app = Runtime::get_default_cli_builder( + "imag", + &version!()[..], + "imag") + // and add all the subapps as subcommands. + .subcommand(build_subcommand!("bookmark", imagbookmark)) + .subcommand(build_subcommand!("counter", imagcounter)) + .subcommand(build_subcommand!("diary", imagdiary)) + .subcommand(build_subcommand!("link", imaglink)) + .subcommand(build_subcommand!("notes", imagnotes)) + .subcommand(build_subcommand!("ref", imagref)) + .subcommand(build_subcommand!("store", imagstore)) + .subcommand(build_subcommand!("tag", imagtag)) + .subcommand(build_subcommand!("todo", imagtodo)) + .subcommand(build_subcommand!("view", imagview)); + + // Actually generates the completion files + app.gen_completions("imag", Shell::Bash, env!("OUT_DIR")); + app.gen_completions("imag", Shell::Fish, env!("OUT_DIR")); + app.gen_completions("imag", Shell::Zsh, env!("OUT_DIR")); + +} + From a104d539198efcf65d644d57bc684f6d6ac96106 Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 01:47:55 +0200 Subject: [PATCH 07/18] build script for shell completion works again --- bin/Cargo.toml | 40 ------------------- bin/build.rs | 90 ------------------------------------------ bin/core/imag/build.rs | 34 +++++++++------- 3 files changed, 20 insertions(+), 144 deletions(-) delete mode 100644 bin/Cargo.toml delete mode 100644 bin/build.rs diff --git a/bin/Cargo.toml b/bin/Cargo.toml deleted file mode 100644 index 76cc0636..00000000 --- a/bin/Cargo.toml +++ /dev/null @@ -1,40 +0,0 @@ -[package] -name = "imag" -version = "0.2.0" -authors = ["Matthias Beyer "] - -description = "Part of the imag core distribution: imag command" - -keywords = ["imag", "PIM", "personal", "information", "management"] -readme = "../README.md" -license = "LGPL-2.1" - -documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.html" -repository = "https://github.com/matthiasbeyer/imag" -homepage = "http://imag-pim.org" - -build = "build.rs" - -[build-dependencies] -clap = ">=2.16.1" -version = "2.0" -libimagrt = { path = "../libimagrt" } -libimagentrytag = { path = "../libimagentrytag" } -libimagutil = { path = "../libimagutil" } - -[profile.dev] -codegen-units = 2 - -[dependencies] -version = "2.0" -walkdir = "0.1" -crossbeam = "0.2" -clap = "2.*" -log = "0.3" - -[dependencies.libimagrt] -path = "../libimagrt" - -[dependencies.libimagerror] -path = "../libimagerror" - diff --git a/bin/build.rs b/bin/build.rs deleted file mode 100644 index a7d44a20..00000000 --- a/bin/build.rs +++ /dev/null @@ -1,90 +0,0 @@ -extern crate clap; -extern crate libimagrt; -extern crate libimagentrytag; -extern crate libimagutil; -#[macro_use] extern crate version; - -use clap::Shell; -use libimagrt::runtime::Runtime; - -/// This macro generates mods with the given '$modulename', -/// whose content is the file given with `$path`. -/// In this case, It is used specifically to include the -/// `ui.rs` files of the imag binaries. -/// The imag project (accidentally?) followed the convention -/// to write a `ui.rs` containing the function -/// `fn build_ui(app : App) -> App`. -/// This macro allows us to use the same named functions by -/// putting them each into their own module. -macro_rules! gen_mods_buildui { - ($(($path:expr, $modulename:ident)$(,)*)*) => ( - $( - mod $modulename { - include!($path); - } - )* - ) -} - -/// This macro reduces boilerplate code. -/// -/// For example: `build_subcommand!("counter", imagcounter)` -/// will result in the following code: -/// ```ignore -/// imagcounter::build_ui(Runtime::get_default_cli_builder( -/// "counter", -/// &version!()[..], -/// "counter")) -/// ``` -/// As for the `&version!()[..]` part, it does not matter -/// which version the subcommand is getting here, as the -/// output of this script is a completion script, which -/// does not contain information about the version at all. -macro_rules! build_subcommand { - ($name:expr, $module:ident) => ( - $module::build_ui(Runtime::get_default_cli_builder( - $name, - &version!()[..], - $name)) - ) -} - -// Actually generates the module. -gen_mods_buildui!( - ("../imag-bookmark/src/ui.rs", imagbookmark), - ("../imag-counter/src/ui.rs", imagcounter), - ("../imag-diary/src/ui.rs", imagdiary), - ("../imag-link/src/ui.rs", imaglink), - ("../imag-notes/src/ui.rs", imagnotes), - ("../imag-ref/src/ui.rs", imagref), - ("../imag-store/src/ui.rs", imagstore), - ("../imag-tag/src/ui.rs", imagtag), - ("../imag-todo/src/ui.rs", imagtodo), - ("../imag-view/src/ui.rs", imagview) -); - -fn main() { - // Make the `imag`-App... - let mut app = Runtime::get_default_cli_builder( - "imag", - &version!()[..], - "imag") - // and add all the subapps as subcommands. - .subcommand(build_subcommand!("bookmark", imagbookmark)) - .subcommand(build_subcommand!("counter", imagcounter)) - .subcommand(build_subcommand!("diary", imagdiary)) - .subcommand(build_subcommand!("link", imaglink)) - .subcommand(build_subcommand!("notes", imagnotes)) - .subcommand(build_subcommand!("ref", imagref)) - .subcommand(build_subcommand!("store", imagstore)) - .subcommand(build_subcommand!("tag", imagtag)) - .subcommand(build_subcommand!("todo", imagtodo)) - .subcommand(build_subcommand!("view", imagview)); - - // Actually generates the completion files - app.gen_completions("imag", Shell::Bash, env!("OUT_DIR")); - app.gen_completions("imag", Shell::Fish, env!("OUT_DIR")); - app.gen_completions("imag", Shell::Zsh, env!("OUT_DIR")); - -} - diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs index 4c9c8a21..57aca212 100644 --- a/bin/core/imag/build.rs +++ b/bin/core/imag/build.rs @@ -7,6 +7,13 @@ extern crate libimagutil; use clap::Shell; use libimagrt::runtime::Runtime; +mod toplevelbuildscript { + include!("../../../build.rs"); + pub fn build() { + self::main(); + } +} + /// This macro generates mods with the given '$modulename', /// whose content is the file given with `$path`. /// In this case, It is used specifically to include the @@ -48,16 +55,15 @@ macro_rules! build_subcommand { // Actually generates the module. gen_mods_buildui!( - ("../imag-bookmark/src/ui.rs", imagbookmark), - ("../imag-counter/src/ui.rs", imagcounter), - ("../imag-diary/src/ui.rs", imagdiary), - ("../imag-link/src/ui.rs", imaglink), - ("../imag-notes/src/ui.rs", imagnotes), - ("../imag-ref/src/ui.rs", imagref), - ("../imag-store/src/ui.rs", imagstore), - ("../imag-tag/src/ui.rs", imagtag), - ("../imag-todo/src/ui.rs", imagtodo), - ("../imag-view/src/ui.rs", imagview) + ("../../../bin/domain/imag-bookmark/src/ui.rs", imagbookmark), + ("../../../bin/domain/imag-diary/src/ui.rs", imagdiary), + ("../../../bin/core/imag-link/src/ui.rs", imaglink), + ("../../../bin/domain/imag-notes/src/ui.rs", imagnotes), + ("../../../bin/core/imag-ref/src/ui.rs", imagref), + ("../../../bin/core/imag-store/src/ui.rs", imagstore), + ("../../../bin/core/imag-tag/src/ui.rs", imagtag), + ("../../../bin/domain/imag-todo/src/ui.rs", imagtodo), + ("../../../bin/core/imag-view/src/ui.rs", imagview) ); fn main() { @@ -68,7 +74,6 @@ fn main() { "imag") // and add all the subapps as subcommands. .subcommand(build_subcommand!("bookmark", imagbookmark)) - .subcommand(build_subcommand!("counter", imagcounter)) .subcommand(build_subcommand!("diary", imagdiary)) .subcommand(build_subcommand!("link", imaglink)) .subcommand(build_subcommand!("notes", imagnotes)) @@ -79,9 +84,10 @@ fn main() { .subcommand(build_subcommand!("view", imagview)); // Actually generates the completion files - app.gen_completions("imag", Shell::Bash, env!("OUT_DIR")); - app.gen_completions("imag", Shell::Fish, env!("OUT_DIR")); - app.gen_completions("imag", Shell::Zsh, env!("OUT_DIR")); + app.gen_completions("imag", Shell::Bash, "./"); + app.gen_completions("imag", Shell::Fish, "./"); + app.gen_completions("imag", Shell::Zsh, "./"); + toplevelbuildscript::build(); } From a7959a2e673ace4e1a36eba633711576552ab02c Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 10:48:26 +0200 Subject: [PATCH 08/18] add all current imag binaries to the shell-completion script --- bin/core/imag/build.rs | 52 +++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs index 57aca212..45861dcd 100644 --- a/bin/core/imag/build.rs +++ b/bin/core/imag/build.rs @@ -55,15 +55,28 @@ macro_rules! build_subcommand { // Actually generates the module. gen_mods_buildui!( - ("../../../bin/domain/imag-bookmark/src/ui.rs", imagbookmark), - ("../../../bin/domain/imag-diary/src/ui.rs", imagdiary), + ("../../../bin/core/imag-annotate/src/ui.rs", imagannotate), + ("../../../bin/core/imag-diagnostics/src/ui.rs", imagdiagnostics), + ("../../../bin/core/imag-edit/src/ui.rs", imagedit), + ("../../../bin/core/imag-gps/src/ui.rs", imaggps), + ("../../../bin/core/imag-grep/src/ui.rs", imaggrep), + ("../../../bin/core/imag-ids/src/ui.rs", imagids), + ("../../../bin/core/imag-init/src/ui.rs", imaginit), ("../../../bin/core/imag-link/src/ui.rs", imaglink), - ("../../../bin/domain/imag-notes/src/ui.rs", imagnotes), + ("../../../bin/core/imag-mv/src/ui.rs", imagmv), ("../../../bin/core/imag-ref/src/ui.rs", imagref), ("../../../bin/core/imag-store/src/ui.rs", imagstore), ("../../../bin/core/imag-tag/src/ui.rs", imagtag), - ("../../../bin/domain/imag-todo/src/ui.rs", imagtodo), ("../../../bin/core/imag-view/src/ui.rs", imagview) + ("../../../bin/domain/imag-bookmark/src/ui.rs", imagbookmark), + ("../../../bin/domain/imag-contact/src/ui.rs", imagcontact), + ("../../../bin/domain/imag-diary/src/ui.rs", imagdiary), + ("../../../bin/domain/imag-habit/src/ui.rs", imaghabit), + ("../../../bin/domain/imag-log/src/ui.rs", imaglog), + ("../../../bin/domain/imag-mail/src/ui.rs", imagmail), + ("../../../bin/domain/imag-notes/src/ui.rs", imagnotes), + ("../../../bin/domain/imag-timetrack/src/ui.rs", imagtimetrack), + ("../../../bin/domain/imag-todo/src/ui.rs", imagtodo), ); fn main() { @@ -73,15 +86,28 @@ fn main() { &version!()[..], "imag") // and add all the subapps as subcommands. - .subcommand(build_subcommand!("bookmark", imagbookmark)) - .subcommand(build_subcommand!("diary", imagdiary)) - .subcommand(build_subcommand!("link", imaglink)) - .subcommand(build_subcommand!("notes", imagnotes)) - .subcommand(build_subcommand!("ref", imagref)) - .subcommand(build_subcommand!("store", imagstore)) - .subcommand(build_subcommand!("tag", imagtag)) - .subcommand(build_subcommand!("todo", imagtodo)) - .subcommand(build_subcommand!("view", imagview)); + .subcommand(build_ui!("annotate", imagannotate), + .subcommand(build_ui!("diagnostics", imagdiagnostics), + .subcommand(build_ui!("edit", imagedit), + .subcommand(build_ui!("gps", imaggps), + .subcommand(build_ui!("grep", imaggrep), + .subcommand(build_ui!("ids", imagids), + .subcommand(build_ui!("init", imaginit), + .subcommand(build_ui!("link", imaglink), + .subcommand(build_ui!("mv", imagmv), + .subcommand(build_ui!("ref", imagref), + .subcommand(build_ui!("store", imagstore), + .subcommand(build_ui!("tag", imagtag), + .subcommand(build_ui!("view", imagview) + .subcommand(build_ui!("bookmark", imagbookmark), + .subcommand(build_ui!("contact", imagcontact), + .subcommand(build_ui!("diary", imagdiary), + .subcommand(build_ui!("habit", imaghabit), + .subcommand(build_ui!("log", imaglog), + .subcommand(build_ui!("mail", imagmail), + .subcommand(build_ui!("notes", imagnotes), + .subcommand(build_ui!("timetrack", imagtimetrack), + .subcommand(build_ui!("todo", imagtodo), // Actually generates the completion files app.gen_completions("imag", Shell::Bash, "./"); From 1d6e993ee8a94bfadb9cdc5788be29a20d772b00 Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 10:51:48 +0200 Subject: [PATCH 09/18] fix copypasta fails --- bin/core/imag/build.rs | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs index 45861dcd..eeceaae8 100644 --- a/bin/core/imag/build.rs +++ b/bin/core/imag/build.rs @@ -86,28 +86,28 @@ fn main() { &version!()[..], "imag") // and add all the subapps as subcommands. - .subcommand(build_ui!("annotate", imagannotate), - .subcommand(build_ui!("diagnostics", imagdiagnostics), - .subcommand(build_ui!("edit", imagedit), - .subcommand(build_ui!("gps", imaggps), - .subcommand(build_ui!("grep", imaggrep), - .subcommand(build_ui!("ids", imagids), - .subcommand(build_ui!("init", imaginit), - .subcommand(build_ui!("link", imaglink), - .subcommand(build_ui!("mv", imagmv), - .subcommand(build_ui!("ref", imagref), - .subcommand(build_ui!("store", imagstore), - .subcommand(build_ui!("tag", imagtag), - .subcommand(build_ui!("view", imagview) - .subcommand(build_ui!("bookmark", imagbookmark), - .subcommand(build_ui!("contact", imagcontact), - .subcommand(build_ui!("diary", imagdiary), - .subcommand(build_ui!("habit", imaghabit), - .subcommand(build_ui!("log", imaglog), - .subcommand(build_ui!("mail", imagmail), - .subcommand(build_ui!("notes", imagnotes), - .subcommand(build_ui!("timetrack", imagtimetrack), - .subcommand(build_ui!("todo", imagtodo), + .subcommand(build_ui!("annotate", imagannotate)) + .subcommand(build_ui!("diagnostics", imagdiagnostics)) + .subcommand(build_ui!("edit", imagedit)) + .subcommand(build_ui!("gps", imaggps)) + .subcommand(build_ui!("grep", imaggrep)) + .subcommand(build_ui!("ids", imagids)) + .subcommand(build_ui!("init", imaginit)) + .subcommand(build_ui!("link", imaglink)) + .subcommand(build_ui!("mv", imagmv)) + .subcommand(build_ui!("ref", imagref)) + .subcommand(build_ui!("store", imagstore)) + .subcommand(build_ui!("tag", imagtag)) + .subcommand(build_ui!("view", imagview)) + .subcommand(build_ui!("bookmark", imagbookmark)) + .subcommand(build_ui!("contact", imagcontact)) + .subcommand(build_ui!("diary", imagdiary)) + .subcommand(build_ui!("habit", imaghabit)) + .subcommand(build_ui!("log", imaglog)) + .subcommand(build_ui!("mail", imagmail)) + .subcommand(build_ui!("notes", imagnotes)) + .subcommand(build_ui!("timetrack", imagtimetrack)) + .subcommand(build_ui!("todo", imagtodo)); // Actually generates the completion files app.gen_completions("imag", Shell::Bash, "./"); From 264a07239f59c05c32c7b900b8822ac2b91d53c2 Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 10:59:24 +0200 Subject: [PATCH 10/18] move the build_ui function of imag-ids into its own file --- bin/core/imag-ids/src/main.rs | 20 ------------------ bin/core/imag-ids/src/ui.rs | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 bin/core/imag-ids/src/ui.rs diff --git a/bin/core/imag-ids/src/main.rs b/bin/core/imag-ids/src/main.rs index 5dada73e..a6781a60 100644 --- a/bin/core/imag-ids/src/main.rs +++ b/bin/core/imag-ids/src/main.rs @@ -51,26 +51,6 @@ use libimagerror::io::ToExitCode; use libimagstore::storeid::StoreId; -/// No special CLI -pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { - app - .arg(Arg::with_name("print-storepath") - .long("with-storepath") - .takes_value(false) - .required(false) - .multiple(false) - .help("Print the storepath for each id")) - - .arg(Arg::with_name("in-collection-filter") - .long("in-collection") - .short("c") - .required(false) - .takes_value(true) - .multiple(true) - .value_names(&["COLLECTION"]) - .help("Filter for ids which are only in these collections")) -} - pub struct IsInCollectionsFilter<'a, A>(Option, ::std::marker::PhantomData<&'a str>) where A: AsRef<[&'a str]>; diff --git a/bin/core/imag-ids/src/ui.rs b/bin/core/imag-ids/src/ui.rs new file mode 100644 index 00000000..000539dd --- /dev/null +++ b/bin/core/imag-ids/src/ui.rs @@ -0,0 +1,40 @@ +// +// imag - the personal information management suite for the commandline +// Copyright (C) 2015-2018 Matthias Beyer and contributors +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; version +// 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +use clap::{Arg, App}; + +pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { + app + .arg(Arg::with_name("print-storepath") + .long("with-storepath") + .takes_value(false) + .required(false) + .multiple(false) + .help("Print the storepath for each id")) + + .arg(Arg::with_name("in-collection-filter") + .long("in-collection") + .short("c") + .required(false) + .takes_value(true) + .multiple(true) + .value_names(&["COLLECTION"]) + .help("Filter for ids which are only in these collections")) +} + From d4c7019fc72410996b666a9300143bad02457437 Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 11:03:55 +0200 Subject: [PATCH 11/18] move target directory of the shell completions to target/shell-completions.d/ --- bin/core/imag/build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs index eeceaae8..b079d777 100644 --- a/bin/core/imag/build.rs +++ b/bin/core/imag/build.rs @@ -110,9 +110,9 @@ fn main() { .subcommand(build_ui!("todo", imagtodo)); // Actually generates the completion files - app.gen_completions("imag", Shell::Bash, "./"); - app.gen_completions("imag", Shell::Fish, "./"); - app.gen_completions("imag", Shell::Zsh, "./"); + app.gen_completions("imag", Shell::Bash, "../../../target/shell-completions.d/"); + app.gen_completions("imag", Shell::Fish, "../../../target/shell-completions.d/"); + app.gen_completions("imag", Shell::Zsh, "../../../target/shell-completions.d/"); toplevelbuildscript::build(); } From 84e1cffbe3891f8c8b83fe85fe155ca6776c0e5d Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 11:12:32 +0200 Subject: [PATCH 12/18] Fix: use mod ui and remove unused imports --- bin/core/imag-ids/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/core/imag-ids/src/main.rs b/bin/core/imag-ids/src/main.rs index a6781a60..08beb465 100644 --- a/bin/core/imag-ids/src/main.rs +++ b/bin/core/imag-ids/src/main.rs @@ -42,7 +42,6 @@ extern crate libimagstore; use std::io::Write; use filters::filter::Filter; -use clap::{Arg, App}; use libimagrt::setup::generate_runtime_setup; use libimagerror::trace::MapErrTrace; @@ -50,6 +49,9 @@ use libimagerror::exit::ExitUnwrap; use libimagerror::io::ToExitCode; use libimagstore::storeid::StoreId; +mod ui; +use ui::build_ui; + pub struct IsInCollectionsFilter<'a, A>(Option, ::std::marker::PhantomData<&'a str>) where A: AsRef<[&'a str]>; From 7e9c25fd63b169ef50a6b54e73b16b035f2fdd8d Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 11:54:56 +0200 Subject: [PATCH 13/18] Refactor: use App in the build_ui function of imag-init --- bin/core/imag-init/src/main.rs | 6 +++++- bin/core/imag-init/src/ui.rs | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/core/imag-init/src/main.rs b/bin/core/imag-init/src/main.rs index 2ad15725..de809128 100644 --- a/bin/core/imag-init/src/main.rs +++ b/bin/core/imag-init/src/main.rs @@ -50,6 +50,7 @@ use std::process::Command; use libimagerror::exit::ExitUnwrap; use libimagerror::io::ToExitCode; +use libimagrt::runtime::Runtime; const CONFIGURATION_STR : &'static str = include_str!("../imagrc.toml"); @@ -68,7 +69,10 @@ imagrc.toml fn main() { let version = make_imag_version!(); - let app = ui::build_ui(&version); + let app = ui::build_ui(Runtime::get_default_cli_builder( + "imag-init", + version.as_str(), + "Intializes the imag store, optionally with git")); let matches = app.get_matches(); let mut out = ::std::io::stdout(); diff --git a/bin/core/imag-init/src/ui.rs b/bin/core/imag-init/src/ui.rs index ff985290..7936cc9b 100644 --- a/bin/core/imag-init/src/ui.rs +++ b/bin/core/imag-init/src/ui.rs @@ -19,12 +19,8 @@ use clap::{Arg, App}; -pub fn build_ui<'a>(version: &'a str) -> App<'a, 'a> { - App::new("imag-init") - .version(version) - .author("Matthias Beyer ") - .about("Initialize a ~/.imag repository. Optionally with git") - +pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { + app .arg(Arg::with_name("devel") .long("dev") .takes_value(false) From 38b4151b84196f6fee085f7a95eeb38be6cc628c Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 11:56:17 +0200 Subject: [PATCH 14/18] Fix: macro call build_subcommand --- bin/core/imag/build.rs | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs index b079d777..0baefdbb 100644 --- a/bin/core/imag/build.rs +++ b/bin/core/imag/build.rs @@ -86,28 +86,28 @@ fn main() { &version!()[..], "imag") // and add all the subapps as subcommands. - .subcommand(build_ui!("annotate", imagannotate)) - .subcommand(build_ui!("diagnostics", imagdiagnostics)) - .subcommand(build_ui!("edit", imagedit)) - .subcommand(build_ui!("gps", imaggps)) - .subcommand(build_ui!("grep", imaggrep)) - .subcommand(build_ui!("ids", imagids)) - .subcommand(build_ui!("init", imaginit)) - .subcommand(build_ui!("link", imaglink)) - .subcommand(build_ui!("mv", imagmv)) - .subcommand(build_ui!("ref", imagref)) - .subcommand(build_ui!("store", imagstore)) - .subcommand(build_ui!("tag", imagtag)) - .subcommand(build_ui!("view", imagview)) - .subcommand(build_ui!("bookmark", imagbookmark)) - .subcommand(build_ui!("contact", imagcontact)) - .subcommand(build_ui!("diary", imagdiary)) - .subcommand(build_ui!("habit", imaghabit)) - .subcommand(build_ui!("log", imaglog)) - .subcommand(build_ui!("mail", imagmail)) - .subcommand(build_ui!("notes", imagnotes)) - .subcommand(build_ui!("timetrack", imagtimetrack)) - .subcommand(build_ui!("todo", imagtodo)); + .subcommand(build_subcommand!("annotate", imagannotate)) + .subcommand(build_subcommand!("diagnostics", imagdiagnostics)) + .subcommand(build_subcommand!("edit", imagedit)) + .subcommand(build_subcommand!("gps", imaggps)) + .subcommand(build_subcommand!("grep", imaggrep)) + .subcommand(build_subcommand!("ids", imagids)) + .subcommand(build_subcommand!("init", imaginit)) + .subcommand(build_subcommand!("link", imaglink)) + .subcommand(build_subcommand!("mv", imagmv)) + .subcommand(build_subcommand!("ref", imagref)) + .subcommand(build_subcommand!("store", imagstore)) + .subcommand(build_subcommand!("tag", imagtag)) + .subcommand(build_subcommand!("view", imagview)) + .subcommand(build_subcommand!("bookmark", imagbookmark)) + .subcommand(build_subcommand!("contact", imagcontact)) + .subcommand(build_subcommand!("diary", imagdiary)) + .subcommand(build_subcommand!("habit", imaghabit)) + .subcommand(build_subcommand!("log", imaglog)) + .subcommand(build_subcommand!("mail", imagmail)) + .subcommand(build_subcommand!("notes", imagnotes)) + .subcommand(build_subcommand!("timetrack", imagtimetrack)) + .subcommand(build_subcommand!("todo", imagtodo)); // Actually generates the completion files app.gen_completions("imag", Shell::Bash, "../../../target/shell-completions.d/"); From f463565770e56dd96255369c2ee6d5ff98db8c2f Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 12:01:34 +0200 Subject: [PATCH 15/18] Change target directory of completions to target/ --- bin/core/imag/build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs index 0baefdbb..4b5d5521 100644 --- a/bin/core/imag/build.rs +++ b/bin/core/imag/build.rs @@ -110,9 +110,9 @@ fn main() { .subcommand(build_subcommand!("todo", imagtodo)); // Actually generates the completion files - app.gen_completions("imag", Shell::Bash, "../../../target/shell-completions.d/"); - app.gen_completions("imag", Shell::Fish, "../../../target/shell-completions.d/"); - app.gen_completions("imag", Shell::Zsh, "../../../target/shell-completions.d/"); + app.gen_completions("imag", Shell::Bash, "../../../target/"); + app.gen_completions("imag", Shell::Fish, "../../../target/"); + app.gen_completions("imag", Shell::Zsh, "../../../target/"); toplevelbuildscript::build(); } From 9a316d1268f9b30b2dc2eee317bddde89ddb9540 Mon Sep 17 00:00:00 2001 From: Mario Krehl Date: Sat, 14 Apr 2018 12:57:11 +0200 Subject: [PATCH 16/18] Add license header to build.rs script --- bin/core/imag/build.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bin/core/imag/build.rs b/bin/core/imag/build.rs index 4b5d5521..96dabc33 100644 --- a/bin/core/imag/build.rs +++ b/bin/core/imag/build.rs @@ -1,3 +1,22 @@ +// +// imag - the personal information management suite for the commandline +// Copyright (C) 2015-2018 Matthias Beyer and contributors +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; version +// 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + extern crate clap; extern crate libimagrt; extern crate libimagentrytag; From 24b0cadb8984ba877a1b9d3791d5fba1a1cfe291 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 14 Apr 2018 14:08:07 +0200 Subject: [PATCH 17/18] Use "::std" instead of "std" --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index c2c4ec66..4aa730f0 100644 --- a/build.rs +++ b/build.rs @@ -19,7 +19,7 @@ use std::process::Command; fn main() { - let profile = String::from(std::env::var("PROFILE").unwrap()); + let profile = String::from(::std::env::var("PROFILE").unwrap()); let git_version = if profile == "debug" { let output = Command::new("git") .args(&["describe", "HEAD"]) From fb4917d050f9ec505d140ae0ea26916254fd9a15 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 14 Apr 2018 14:15:00 +0200 Subject: [PATCH 18/18] Remove feature to generate commandline completion scripts --- bin/core/imag/src/main.rs | 3 --- lib/core/libimagrt/src/runtime.rs | 28 +--------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/bin/core/imag/src/main.rs b/bin/core/imag/src/main.rs index a83cc234..a847af08 100644 --- a/bin/core/imag/src/main.rs +++ b/bin/core/imag/src/main.rs @@ -407,9 +407,6 @@ fn forward_commandline_arguments(m: &ArgMatches, scmd: &mut Vec) { push(Some("editor"), Runtime::arg_editor_name(), m , scmd); - push(Some("generate-commandline-completion"), - Runtime::arg_generate_compl(), m , scmd); - push(None , Runtime::arg_logdest_name() , m , scmd); } diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs index c0e8488f..a51fe8c5 100644 --- a/lib/core/libimagrt/src/runtime.rs +++ b/lib/core/libimagrt/src/runtime.rs @@ -111,27 +111,14 @@ impl<'a> Runtime<'a> { Runtime::_new(cli_app, matches, config) } - fn _new(mut cli_app: C, matches: ArgMatches<'a>, config: Option) + fn _new(cli_app: C, matches: ArgMatches<'a>, config: Option) -> Result, RuntimeError> where C: Clone + CliSpec<'a> + InternalConfiguration { - use std::io::stdout; - use clap::Shell; - if cli_app.enable_logging() { Runtime::init_logger(&matches, config.as_ref()) } - match matches.value_of(Runtime::arg_generate_compl()) { - Some(shell) => { - debug!("Generating shell completion script, writing to stdout"); - let shell = shell.parse::().unwrap(); // clap has our back here. - let appname = String::from(cli_app.name()); - cli_app.completions(appname, shell, &mut stdout()); - }, - _ => debug!("Not generating shell completion script"), - } - let rtp = get_rtp_match(&matches); let storepath = matches.value_of(Runtime::arg_storepath_name()) @@ -242,14 +229,6 @@ impl<'a> Runtime<'a> { .required(false) .takes_value(true)) - .arg(Arg::with_name(Runtime::arg_generate_compl()) - .long("generate-commandline-completion") - .help("Generate the commandline completion for bash or zsh or fish") - .required(false) - .takes_value(true) - .value_name("SHELL") - .possible_values(&["bash", "fish", "zsh"])) - .arg(Arg::with_name(Runtime::arg_logdest_name()) .long(Runtime::arg_logdest_name()) .help("Override the logging destinations from the configuration: values can be seperated by ',', a value of '-' marks the stderr output, everything else is expected to be a path") @@ -320,11 +299,6 @@ impl<'a> Runtime<'a> { "editor" } - /// Get the argument name for generating the completion - pub fn arg_generate_compl() -> &'static str { - "generate-completion" - } - /// Extract the Store object from the Runtime object, destroying the Runtime object /// /// # Warning