From de16846aba42e418f47046d845d6667d05e5c1ff Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Sun, 15 Mar 2020 13:46:58 -0300 Subject: [PATCH] Initial cheat repo support (#258) This PR makes navi stop bundling `.cheat` files and makes it able to download from repos on GitHub, using a standardized config directory. - it fixes #233 and #237 - it makes #52, #256 and #257 much easier to implement - it makes #40 harder to implement - it's an alternate solution to #140 - it's influenced by #238 and #254. This PR ended up being much bigger than I would like so if you could review only this description it would be already very nice! When navi is started for the first time, a welcome cheatsheet is shown: ![Screenshot at 2020-03-15 10-20-04](https://user-images.githubusercontent.com/3226564/76702240-19fffd80-66a7-11ea-884f-97c565bc1ead.png) If the user selects the first option, the user is prompted to download `.cheat`s from https://github.com/denisidoro/cheats: ![Screenshot at 2020-03-15 10-20-35](https://user-images.githubusercontent.com/3226564/76702239-19fffd80-66a7-11ea-8f69-324f669b1e01.png) ![Screenshot at 2020-03-15 10-22-59](https://user-images.githubusercontent.com/3226564/76702236-18363a00-66a7-11ea-8ff4-53b497f85888.png) The config folder is populated: ![Screenshot at 2020-03-15 10-21-11](https://user-images.githubusercontent.com/3226564/76702238-19676700-66a7-11ea-8367-3e7b5733f2b4.png) When run again, cheats are available: ![Screenshot at 2020-03-15 10-21-34](https://user-images.githubusercontent.com/3226564/76702237-19676700-66a7-11ea-9c2a-d8829340f3e9.png) ### Breaking changes In order to make navi stop bundling shell widgets as well, a breaking change has been introduced: `source $(navi widget bash)` won't work anymore. It should be `source <(navi widget bash)` now. Any ideas on how to make this transition more graceful? --- Cargo.lock | 325 ++++++++++++++++++++++++++++++++++++++- Cargo.toml | 5 +- README.md | 14 +- cheats/android.cheat | 27 ---- cheats/apt.cheat | 55 ------- cheats/brew.cheat | 36 ----- cheats/cf.cheat | 130 ---------------- cheats/compression.cheat | 24 --- cheats/crontab.cheat | 7 - cheats/docker.cheat | 71 --------- cheats/firebase.cheat | 47 ------ cheats/fly.cheat | 154 ------------------- cheats/git.cheat | 108 ------------- cheats/gpg.cheat | 37 ----- cheats/httpie.cheat | 28 ---- cheats/javascript.cheat | 70 --------- cheats/k3d.cheat | 36 ----- cheats/keytool.cheat | 58 ------- cheats/kubernetes.cheat | 52 ------- cheats/misc.cheat | 27 ---- cheats/mysql.cheat | 10 -- cheats/network.cheat | 27 ---- cheats/openssl.cheat | 81 ---------- cheats/osx.cheat | 25 --- cheats/rsfetch.cheat | 79 ---------- cheats/shell.cheat | 214 -------------------------- cheats/ssh.cheat | 4 - cheats/systemctl.cheat | 37 ----- cheats/yum.cheat | 52 ------- scripts/action | 2 - src/cheat.rs | 41 ++--- src/cmds/best.rs | 3 +- src/cmds/core.rs | 23 ++- src/cmds/home.rs | 8 - src/cmds/mod.rs | 2 +- src/cmds/preview.rs | 3 +- src/cmds/query.rs | 3 +- src/cmds/repo.rs | 84 ++++++++++ src/cmds/search.rs | 3 +- src/cmds/shell.rs | 16 +- src/display.rs | 1 - src/filesystem.rs | 63 ++++---- src/fzf.rs | 22 +-- src/handler.rs | 27 ++++ src/main.rs | 30 +--- src/option.rs | 68 ++++++-- src/welcome.rs | 18 +++ 47 files changed, 617 insertions(+), 1640 deletions(-) delete mode 100644 cheats/android.cheat delete mode 100644 cheats/apt.cheat delete mode 100644 cheats/brew.cheat delete mode 100644 cheats/cf.cheat delete mode 100644 cheats/compression.cheat delete mode 100644 cheats/crontab.cheat delete mode 100644 cheats/docker.cheat delete mode 100644 cheats/firebase.cheat delete mode 100644 cheats/fly.cheat delete mode 100644 cheats/git.cheat delete mode 100644 cheats/gpg.cheat delete mode 100644 cheats/httpie.cheat delete mode 100644 cheats/javascript.cheat delete mode 100644 cheats/k3d.cheat delete mode 100644 cheats/keytool.cheat delete mode 100644 cheats/kubernetes.cheat delete mode 100644 cheats/misc.cheat delete mode 100644 cheats/mysql.cheat delete mode 100644 cheats/network.cheat delete mode 100644 cheats/openssl.cheat delete mode 100644 cheats/osx.cheat delete mode 100644 cheats/rsfetch.cheat delete mode 100644 cheats/shell.cheat delete mode 100644 cheats/ssh.cheat delete mode 100644 cheats/systemctl.cheat delete mode 100644 cheats/yum.cheat delete mode 100644 src/cmds/home.rs create mode 100644 src/cmds/repo.rs create mode 100644 src/handler.rs create mode 100644 src/welcome.rs diff --git a/Cargo.lock b/Cargo.lock index b431f06..4935859 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,6 +16,16 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "arrayvec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "atty" version = "0.2.14" @@ -26,11 +36,44 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "blake2b_simd" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "clap" version = "2.33.0" @@ -45,6 +88,21 @@ dependencies = [ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "derive_more" version = "0.14.1" @@ -56,6 +114,50 @@ dependencies = [ "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dirs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dirs-sys" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "git2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "heck" version = "0.3.1" @@ -72,6 +174,24 @@ dependencies = [ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jobserver" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -82,6 +202,56 @@ name = "libc" version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "libgit2-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libssh2-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libssh2-sys" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libz-sys" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "memchr" version = "2.3.3" @@ -89,14 +259,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "navi" -version = "2.0.11" +version = "2.1.0" dependencies = [ + "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw_tty 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "terminal_size 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -104,6 +277,33 @@ name = "numtoa" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl-sys" +version = "0.9.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro-error" version = "0.4.9" @@ -182,6 +382,16 @@ dependencies = [ "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "redox_users" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "regex" version = "1.3.4" @@ -198,6 +408,17 @@ name = "regex-syntax" version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rust-argon2" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc_version" version = "0.2.3" @@ -216,6 +437,14 @@ dependencies = [ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "semver" version = "0.9.0" @@ -229,6 +458,11 @@ name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "smallvec" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "strsim" version = "0.8.0" @@ -322,6 +556,22 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unicode-segmentation" version = "1.6.0" @@ -342,11 +592,41 @@ name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "vcpkg" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "vec_map" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.3.8" @@ -361,6 +641,14 @@ name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winapi-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -369,16 +657,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "743ad5a418686aad3b87fd14c43badd828cf26e214a00f92a384291cf22e1811" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" +"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" "checksum derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6d944ac6003ed268757ef1ee686753b57efc5fcf0ebe7b64c9fc81e7e32ff839" +"checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c1af51ea8a906616af45a4ce78eacf25860f7a13ae7bf8a814693f0f4037a26" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +"checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" +"checksum libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4870c781f6063efb83150cd22c1ddf6ecf58531419e7570cdcced46970f64a16" +"checksum libssh2-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "7bb70f29dc7c31d32c97577f13f41221af981b31248083e347b7f2c39225a6bc" +"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +"checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" "checksum proc-macro-error 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "052b3c9af39c7e5e94245f820530487d19eb285faedcb40e0c3275132293f242" "checksum proc-macro-error-attr 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d175bef481c7902e63e3165627123fff3502f06ac043d3ef42d08c1246da9253" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" @@ -388,12 +700,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum raw_tty 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51f512d7504049ef0d3f5d48d8aa5129beaea4fccfaf5c500c9b60101394f8b1" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" "checksum regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" "checksum regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "b28dfe3fe9badec5dbf0a79a9cccad2cfc2ab5484bdb3e44cbd1ae8b3ba2be06" +"checksum rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bba175698996010c4f6dce5e7f173b6eb781fce25d2cfc45e27091ce0b79f6" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum structopt 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "a1bcbed7d48956fcbb5d80c6b95aedb553513de0a1b451ea92679d999c010e98" "checksum structopt-derive 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "095064aa1f5b94d14e635d0a5684cf140c43ae40a0fd990708d38f5d669e5f64" @@ -404,11 +720,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" "checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 5e3a649..84ba489 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "navi" -version = "2.0.11" +version = "2.1.0" authors = ["Denis Isidoro "] edition = "2018" @@ -12,4 +12,7 @@ structopt = "0.3" termion = "1.5.5" raw_tty = "0.1.0" lazy_static = "1.4.0" +dirs = "2.0.0" terminal_size = "0.1.10" +git2 = "0.10.0" +walkdir = "2" \ No newline at end of file diff --git a/README.md b/README.md index 7ef824f..950d653 100644 --- a/README.md +++ b/README.md @@ -91,19 +91,17 @@ You can use **navi** as a widget to your shell. This way, your history is correc In order to use it, add this line to your `.bashrc`-like file: ```sh # bash -source "$(navi widget bash)" +source <(navi widget bash) # zsh -source "$(navi widget zsh)" +source <(navi widget zsh) # fish -source (navi widget fish) +navi widget fish | source ``` By default, `Ctrl+G` is assigned to launching **navi**. If you want to change the keybinding, replace the argument of `bind` or `bindkey` in [the widget file](https://github.com/denisidoro/navi/search?q=filename%3Anavi.plugin.*&unscoped_q=filename%3Anavi.plugin.*). -If you want a widget for other shells, please upvote [this issue](https://github.com/denisidoro/navi/issues/37). - ### More options Please refer to `navi --help` for more details. @@ -130,7 +128,7 @@ export NAVI_PATH="/folder/with/cheats:/another/folder" ### Submitting cheatsheets -Feel free to fork this project and open a PR for me to include your contributions. +Feel free to open a PR on https://github.com/denisidoro/cheats for me to include your contributions. Cheatsheet syntax ----------------- @@ -139,7 +137,7 @@ Cheatsheets are described in `.cheat` files. ### Syntax overview -- lines starting with `%` determine the start of a new cheatsheet. They should contain tags which will be added to any command in a given file; +- lines starting with `%` determine the start of a new cheatsheet and should contain tags; - lines starting with `#` should be descriptions of commands; - lines starting with `;` are ignored. You can use them for metacomments; - lines starting with `$` should contain commands that generate a list of possible values for a given argument; @@ -159,7 +157,7 @@ It's irrelevant how many files are used to store cheatsheets. They can be all in Commands may be multiline: ```sh -# This will output foo\nyes +# This will output "foo\nyes" echo foo true \ && echo yes \ diff --git a/cheats/android.cheat b/cheats/android.cheat deleted file mode 100644 index fbc02f1..0000000 --- a/cheats/android.cheat +++ /dev/null @@ -1,27 +0,0 @@ -% android, device - -# Get property -adb -s shell getprop - -# Install APK -adb -s install -r - -# Uninstall package -adb -s uninstall -r - -# Clear user data for package -adb -s shell pm clear - -# Dispatch a deep-link / open URI -adb -s shell am start - -$ device: adb devices --- --headers 1 --column 1 - - - -% android, emulator - -# Start emulator -"$ANDROID_HOME/tools/emulator" -avd -netdelay none -netspeed full - -$ emulator: "$ANDROID_HOME/tools/emulator" -list-avds diff --git a/cheats/apt.cheat b/cheats/apt.cheat deleted file mode 100644 index 13fa966..0000000 --- a/cheats/apt.cheat +++ /dev/null @@ -1,55 +0,0 @@ -% apt - -# Update content listings from package repositories -apt update - -# List all available packages -apt list - -# List all installed packages -apt list --installed - -# Info about package (including description) -apt show -a - -# Show versions and archive areas of available package -apt list -a - -# Search in repository (packages and description) -apt search - -# Check updates for installed packages -apt list --upgradeable - -# Update all installed packages -apt upgrade - -# Upgrade all installed packages (add/remove dependencies) -apt full-upgrade - -# Update specific/individual package -apt install --only-upgrade - -# Downgrade package to a specific version -apt install = - -# Install a package from repository -apt install - -# Remove/delete package -apt remove - -# Remove/delete package (with config files) -apt purge - -# Install local dpkg package -apt install - -# List dependencies of package -apt depends - -# List reverse dependencies of package -apt rdepends - -# Remove un-needed packages and dependencies -apt autoremove diff --git a/cheats/brew.cheat b/cheats/brew.cheat deleted file mode 100644 index 610ce38..0000000 --- a/cheats/brew.cheat +++ /dev/null @@ -1,36 +0,0 @@ -% brew, cask - -# update brew -brew update - -# upgrade brew -brew upgrade - -# get info for a package -brew info - -# get info for a cask -brew cask info - -# install a package -brew install - -# install a cask -brew cask install - -# uninstall a package -brew uninstall - -# uninstall a cask -brew cask uninstall - -# edit package -brew edit - -# edit cask -brew cask edit - -$ package: brew search -$ casks: brew search --casks -$ installed: brew list -$ caskinstalled: brew cask list diff --git a/cheats/cf.cheat b/cheats/cf.cheat deleted file mode 100644 index 9fcf968..0000000 --- a/cheats/cf.cheat +++ /dev/null @@ -1,130 +0,0 @@ -% cf, pcf, pivotal cloud foundry, paas - - -### Information -# Get the extended list of help -cf help -a - -# Get current version of cf -cf version - -# Get information about current org -cf org - -# Get information about current space -cf space - -# Get information about current target -cf target - -# Get list of all apps -cf apps - -# Get list of all services -cf services - -# Get list of all routes -cf routes - -# Get list of all network policies -cf network-policies - - - -### Login -# Login to your CF/PCF instance -cf login -a - -# Login to your CF/PCF instance with username and password -cf login -a -u -p - -# Login and specify target directly -cf login -a -u -p -o -s - - - -### Target -# Set target org -cf target -o - -# Set target space -cf target -o -s - - -### Application manipulation -## Information -# Get the guid of an app -cf app --guid - -# Get the status of an app -cf app - -## Status -# Start an app -cf start - -# Stop an app -cf stop - -# Restart an app -cf restart - -# Rebuild the application package and restart -cf restage - -## Deletion -# Delete an app -cf delete - -# Delete an app no prompt -cf delete -f - -# Delete an app and routes -cf delete -r - - - -### Networking - A bit slow due to filtering -# Add network policy -cf add-network-policy \ ---destination-app \ ---protocol \ ---port - -# Remove network-policy -cf remove-network-policy \ ---destination-app \ ---protocol \ ---port - - -### Services -# Bind a service to an application -cf bind-service - -# Unbind a service from an application -cf unbind-service - -# Share a service between spaces -cf share-service -o -s - -# Unshare a service from a spaces -cf unshare-service -o -s - - - -# Autocomplete variables -$ org: cf orgs | awk 'NR>3 {print}' -$ space: cf target -o "$org" > /dev/null && cf spaces | awk 'NR>3 {print $1}' -$ service: cf services | awk 'NR>3 {print $1}' | sed '/TIP:/d' -$ route: cf routes | awk 'NR>3 {if ($4 ~ /^\//){ print $2 "." $3 $4} else {print $2 "." $3}}' -$ app: cf apps | awk 'NR>4 {print $1}' - -$ add_network_source: cf apps | awk 'NR>4 {print $1}' -$ add_network_destination: cf apps | awk 'NR>4 {print $1}' | sed "/$add_network_source/d" -$ add_network_protocol: printf "tcp \nudp" - -$ remove_network_source: cf network-policies | awk 'NR>3 {print $1}' | uniq -$ remove_network_destination: cf network-policies | grep "^$remove_network_source" | awk '{print $2}' | uniq -$ remove_network_protocol: cf network-policies | grep "^$remove_network_source" | grep "$remove_network_destination" | awk '{print $3}' | uniq -$ remove_network_port: cf network-policies | grep "^$remove_network_source" | grep "$remove_network_destination" | awk '{print $4}' | uniq diff --git a/cheats/compression.cheat b/cheats/compression.cheat deleted file mode 100644 index f71c750..0000000 --- a/cheats/compression.cheat +++ /dev/null @@ -1,24 +0,0 @@ -% compression - -# Create a tar containing files -tar cf .tar - -# Extract the files from a tar -tar xf - -# Create a tar with Gzip compression -tar czf .tar.gz - -# Extract a tar using Gzip -tar xzf - -# Compress file and appends .gz to its name -gzip - -# Decompress compressed file -gzip -d - -$ path: ls -$ tar_file: ls *.tar -$ targz_file: ls *.tar.gz -$ gz_file: ls *.gz diff --git a/cheats/crontab.cheat b/cheats/crontab.cheat deleted file mode 100644 index 8f8fd0e..0000000 --- a/cheats/crontab.cheat +++ /dev/null @@ -1,7 +0,0 @@ -% crontab, schedule - -# List cron jobs -crontab -l - -# Edit cron job -crontab -e diff --git a/cheats/docker.cheat b/cheats/docker.cheat deleted file mode 100644 index ff8b7a8..0000000 --- a/cheats/docker.cheat +++ /dev/null @@ -1,71 +0,0 @@ -% docker - -# Remove an image -docker image rm - -# Delete an image from the local image store -docker rmi - -# List all images that are locally stored with the Docker engine -docker images - -# Build an image from the Dockerfile in the current directory and tag the image -docker build -t : . - -# Pull an image from a registry -docker pull : - -# Stop a running container through SIGTERM -docker stop - -# Stop a running container through SIGKILL -docker kill - -# List the networks -docker network ls - -# List the running containers -docker ps - -# Delete all running and stopped containers -docker rm -f $(docker ps -aq) - -# Create a new bash process inside the container and connect it to the terminal -docker exec -it bash - -# Print the last lines of a container’s logs -docker logs --tail 100 | less - -# Print the last lines of a container's logs and following its logs -docker logs --tail 100 -f - -# Create new network -docker network create - -$ image_id: docker images --- --headers 1 --column 3 -$ container_id: docker ps --- --headers 1 --column 1 - - - -% docker-compose - -# Builds, (re)creates, starts, and attaches to containers for all services -docker-compose up - -# Builds, (re)creates, starts, and dettaches to containers for all services -docker-compose up -d - -# Builds, (re)creates, starts, and attaches to containers for a service -docker-compose up -d - -# Builds, (re)creates, starts, and dettaches to containers for a service -docker-compose up -d - -# Print the last lines of a service’s logs -docker-compose logs --tail 100 | less - -# Print the last lines of a service's logs and following its logs -docker-compose logs -f --tail 100 - -# Stops containers and removes containers, networks created by up -docker-compose down diff --git a/cheats/firebase.cheat b/cheats/firebase.cheat deleted file mode 100644 index c3a98f2..0000000 --- a/cheats/firebase.cheat +++ /dev/null @@ -1,47 +0,0 @@ -% firebase, account - -# Login -firebase login - -# Logout -firebase logout - -% firebase, local - -# Init a new project -firebase init [feature] - -# List of projects you have access to -firebase projects:list - -# Set current project -firebase use [options] [alias_or_project_id] - -# Serve all allowed content -firebase serve - -# Serve specific feature -firebase serve --only - -# Serve specific content for feature -firebase serve --only : - -% firebase, remote - -# Deploy projects -firebase deploy - -# Deploy specific feature -firebase deploy --only - -# Deploy specific content for feature -firebase deploy --only : - -% firebase, ci - -# Generate a token for CI -firebase login:ci - -# Deploy from CI -firebase deploy --token - diff --git a/cheats/fly.cheat b/cheats/fly.cheat deleted file mode 100644 index ea97dcb..0000000 --- a/cheats/fly.cheat +++ /dev/null @@ -1,154 +0,0 @@ -% fly, concourse, pipeline, ci-cd - -# Show Concourse help -fly --help - - - -# List all Concourse target aliases -fly targets - -# Delete saved configuration for a target -fly --target delete-target - -# Sync concourse version with target -fly --target sync - -# Login to a selected target -fly --target login - - - -# List all teams within a Concourse target -fly --target teams - -# Show the configuration for a given team -fly --target get-team --team-name - -# Delete a team from Concourse installation -fly --target destroy-team -n - - - -# list all pipelines -fly --target pipelines - -# Make pipeline public -fly --target expose-pipeline --pipeline - -# Make pipeline private -fly --target hide-pipeline --pipeline - -# Get pipeline / show pipeline -fly --target get-pipeline --pipeline - -# Pause a pipeline -fly --target pause-pipeline --pipeline - -# Unpause a pipeline -fly --target unpause-pipeline --pipeline - -# Rename a pipeline -fly --target rename-pipeline --old-name \ ---new-name - -# Create pipeline without variables -fly --target set-pipeline --pipeline \ ---config - -# Create pipeline with variables -fly --target set-pipeline --pipeline \ ---config --load-vars-from - -# Update pipeline without variables -fly --target set-pipeline --pipeline \ ---config - -# Update pipeline with variables -fly --target set-pipeline --pipeline \ ---config --load-vars-from - -# Validate pipeline without variables -fly validate-pipeline --config - -# Validate pipeline with variables -fly validate-pipeline --config \ ---load-vars-from - -# Delete a pipeline -fly --target destroy-pipeline --pipeline - - - -# List the jobs of a pipeline -fly --target jobs --pipeline - -# Pause a job on a pipeline -fly --target pause-job --job=/ - -# Unpause a job on a pipeline -fly --target unpause-job --job=/ - -# Trigger a job on a pipeline -fly --target trigger-job --job=/ - - - -# List the latest builds for a job -fly --target builds --job=/ \ ---count= - -# Hijack a pipeline job for debugging -fly --target hijack --job=/ \ ---build - -# Watch the log output from a running job -fly --target watch --job=/ \ ---build - -# Abort a running build -fly --target abort-build --job=/ \ ---build - - - -# List the users who have been active for the past 2 months -fly --target active-users - -# List the access of the current user -fly --target userinfo - - - -# List the resources for a pipeline -fly --target resources --pipeline - -# Check a resource -fly --target check-resource --resource=/ - -# List the versions of a resource -fly --target resource-versions --resource=/ - -# Pin a resource version -fly --target pin-resource --resource=/ \ ---version - -# Unpin a resource version -fly --target unpin-resource --resource=/ - - - - - -$ target: fly targets --- --column 1 -$ team: fly -t "$target" teams -$ job: fly -t "$target" jobs --pipeline "$pipeline" --- --column 1 -$ build: fly -t "$target" builds --job="$pipeline"/"$job" --- --column 3 -$ resource: fly -t "$target" resources --pipeline "$pipeline" --- --column 1 -$ version: fly -t "$target" resource-versions --resource="$pipeline"/"$resource" --- --column 2 -$ pipeline: fly -t "$target" pipelines --- --column 1 -$ pipeline_yaml: ls *.yml || ls -$ pipeline_vars: ls *.yml || ls - - - diff --git a/cheats/git.cheat b/cheats/git.cheat deleted file mode 100644 index 9b5a1b5..0000000 --- a/cheats/git.cheat +++ /dev/null @@ -1,108 +0,0 @@ -% git - -# Set global git user name -git config --global user.name - -# Set global git user email -git config --global user.email - -# Initializes a git repository -git init - -# Clone a git repository -git clone -b - -# View all available remote for a git repository -git remote --verbose - -# Adds a remote for a git repository -git remote add - -# Renames a remote for a git repository -git remote rename - -# Remove a remote for a git repository -git remote remove - -# Checkout to branch -git checkout - -# Displays the current status of a git repository -git status - -# Displays unstaged changes for file -cd ; \ - git diff - -# Stage single or multiple files -cd ; \ - git add ; - -# Stage all files in project -git add -A - -# Saves the changes to a file in a commit -git commit -m - -# Pushes committed changes to remote repository -git push -u - -# Pushes changes to a remote repository overwriting another branch -git push : - -# Overwrites remote branch with local branch changes -git push -f - -# Pulls changes to a remote repo to the local repo -git pull --ff-only - -# Merges changes on one branch into current branch -git merge - -# Abort the current conflict resolution process, and try to reconstruct the pre-merge state. -git merge --abort - -# Displays log of commits for a repo -git log - -# Displays formatted log of commits for a repo -git log --all --decorate --oneline --graph - -# Clear everything -git clean -dxf - -# Sign all commits in a branch based on master -git rebase master -S -f - -# See all open pull requests of a user on Github -navi fn url::open 'https://github.com/pulls?&q=author:+is:open+is:pr' - -# Checkout a branch from a fork -git fetch origin pull//head:pr/ \ - && git checkout pr/ - -# Add a new module -git submodule add - -# Update module -git submodule update --init - -# Update module without init -git submodule update - -# Pull all submodules -git submodule foreach git pull origin master - -# Update all submodules -git submodule update --init --recursive - -# Skip git hooks -git commit --no-verify - -# Create new branch from current HEAD -git checkout -b - -$ branch: git branch | awk '{print $NF}' -$ toplevel_directory: git rev-parse --show-toplevel -$ unstaged_files: git status --untracked-files=no -s --porcelain | awk '{print $NF}' --- --multi true -$ changed_files: git status --untracked-files=all -s --porcelain | awk '{print $NF}' --- --multi true diff --git a/cheats/gpg.cheat b/cheats/gpg.cheat deleted file mode 100644 index fb88333..0000000 --- a/cheats/gpg.cheat +++ /dev/null @@ -1,37 +0,0 @@ -% gpg - -# gpg version -gpg --version - -# gpg generate key -gpg --gen-key - -# list keys -gpg --list-keys - -# distribute public key to key server -gpg --keyserver --send-keys - -# export public key -gpg --output --export - -# import public key -gpg --import - -# encrypt document -gpg --output --encrypt --recipient - -# decrypt document -gpg --output --decrypt - -# make a signature -gpg --output --sign - -# verify signature -gpg --output --decrypt - -# clearsign documents -gpg --clearsign - -# detach signature -gpg --output --detach-sig diff --git a/cheats/httpie.cheat b/cheats/httpie.cheat deleted file mode 100644 index cfa5e8f..0000000 --- a/cheats/httpie.cheat +++ /dev/null @@ -1,28 +0,0 @@ -% httpie, http - -# send a get http request -http - -# send a http request -http - -# send an authenticated http request -http -a : - -# send a http request with a json body -http = - -# send a http request with a form body -http -f POST = - -# send a http request and see the request as well as the response -http -v - -# send a post http request wih a body from a file -http < - -# send a http request wih a custom header -http : - -$ file: ls -$ method: echo -e 'GET\nPOST\nPUT\nDELETE\nPATCH' diff --git a/cheats/javascript.cheat b/cheats/javascript.cheat deleted file mode 100644 index 9ae5929..0000000 --- a/cheats/javascript.cheat +++ /dev/null @@ -1,70 +0,0 @@ -% npm, node, js - -# initial new package -npm init - -# initial immediately a new package -npm init -y - -# install all dependencies packages -npm install - -# install all dev dependencies packages -npm install --save-dev - -# install a specified package -npm install - -# install a specified dev package -npm install --save-dev - -# install globally a specified package -npm install -g - -# run a script -npm run