From 9c7811026f3864760a583deb27180ed42825bf32 Mon Sep 17 00:00:00 2001 From: amsharma91 Date: Tue, 20 Sep 2016 18:40:47 +0530 Subject: [PATCH] Clarify the documentation of the --type-* flags. Fixes #15 --- doc/rg.1 | 9 +++++++-- doc/rg.1.md | 8 ++++++-- src/args.rs | 8 ++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/doc/rg.1 b/doc/rg.1 index 9d47e27c6..c115844e4 100644 --- a/doc/rg.1 +++ b/doc/rg.1 @@ -254,11 +254,16 @@ Show all supported file types and their associated globs. .TP .B \-\-type\-add \f[I]ARG\f[] ... Add a new glob for a particular file type. -Example: \-\-type\-add html:\f[I]\&.html,\f[].htm +Note that this must be passed to every invocation of rg. .RS .RE +.PP +Example: \-\-type\-add html:\f[I]\&.html,\f[].htm .TP .B \-\-type\-clear \f[I]TYPE\f[] ... -Clear the file type globs for TYPE. +Clear the file type globs previously defined for TYPE. +This only clears the default type definitions that are found inside of +ripgrep. +Note that this must be passed to every invocation of rg. .RS .RE diff --git a/doc/rg.1.md b/doc/rg.1.md index 224ff1a96..028d3a578 100644 --- a/doc/rg.1.md +++ b/doc/rg.1.md @@ -164,8 +164,12 @@ the raw speed of grep. : Show all supported file types and their associated globs. --type-add *ARG* ... -: Add a new glob for a particular file type. +: Add a new glob for a particular file type. Note that this must be + passed to every invocation of rg. + Example: --type-add html:*.html,*.htm --type-clear *TYPE* ... -: Clear the file type globs for TYPE. +: Clear the file type globs previously defined for TYPE. This only clears + the default type definitions that are found inside of ripgrep. Note + that this must be passed to every invocation of rg. diff --git a/src/args.rs b/src/args.rs index 4b5052acc..13ed63810 100644 --- a/src/args.rs +++ b/src/args.rs @@ -163,11 +163,15 @@ File type management options: Show all supported file types and their associated globs. --type-add ARG ... - Add a new glob for a particular file type. + Add a new glob for a particular file type. Note that this must be + passed to every invocation of rg. + Example: --type-add html:*.html,*.htm --type-clear TYPE ... - Clear the file type globs for TYPE. + Clear the file type globs previously defined for TYPE. This only clears + the default type definitions that are found inside of ripgrep. Note + that this must be passed to every invocation of rg. "; /// RawArgs are the args as they are parsed from Docopt. They aren't used