Skip to content

Instantly share code, notes, and snippets.

@andrewmiller1
andrewmiller1 / build.rs
Created November 10, 2018 06:16
Source code #1380
#[macro_use]
extern crate clap;
extern crate clap_generate;
use std::env;
use clap_generate::Shell;
include!("src/cli.rs");
fn main() {
@andrewmiller1
andrewmiller1 / Cargo.toml
Created October 31, 2018 17:58
Minimal working Cargo.toml #1368
[package]
name = "dev"
version = "0.1.0"
authors = ["andrewmiller1 <38833810+andrewmiller1@users.noreply.github.com>"]
edition = "2018"
[dependencies]
clap = { git = "https://github.com/clap-rs/clap", rev = "683105cdd10c8a301e043a6c77531b2ff8c6a383", features = ["yaml"] }
@andrewmiller1
andrewmiller1 / main.rs
Last active October 31, 2018 17:36
Minimal main.rs #1368
#[macro_use]
extern crate clap;
fn main() {
use clap::App;
let yml = load_yaml!("clap.yml");
let matches = App::from(yml).get_matches();
}
@andrewmiller1
andrewmiller1 / Cargo.toml
Created October 31, 2018 17:26
Minimal Cargo.toml #1368
[package]
name = "dev"
version = "0.1.0"
authors = ["andrewmiller1 <38833810+andrewmiller1@users.noreply.github.com>"]
edition = "2018"
[dependencies]
clap = { git = "https://github.com/clap-rs/clap", branch = "v3-master", features = ["yaml"] }
@andrewmiller1
andrewmiller1 / clap.yml
Created October 31, 2018 17:22
Minimal clap yaml #1368
name: dev
version: "0.1.0"
about: dev executes development tasks.
author: andrewmiller1 <38833810+andrewmiller1@users.noreply.github.com>
# AppSettings can be defined as a list and are **not** ascii case sensitive
settings:
- ArgRequiredElseHelp
@andrewmiller1
andrewmiller1 / npm-list-installed.sh
Created September 27, 2018 19:05
`npm ls`, but useful for the common programmatic case
#!/bin/sh
npm ls --depth 0 --parseable 2> /dev/null | grep -oP --color=never '(?<=node_modules/).*'
@andrewmiller1
andrewmiller1 / install-jq-workaround.sh
Created August 26, 2018 00:01
Temporary gist for 2018-8-25. Works on ubuntu. If it doesn't work, you're missing dependencies. Install took me about 15 minutes
#!/bin/sh
git clone https://github.com/alex-ozdemir/jq.git
cd jq
git checkout math-check-fix
git submodule update --init # if building from git to get oniguruma
autoreconf -fi
./configure --with-oniguruma=builtin
make -j8
make check