From e224c15ddba69388955dbcabe430ffca1d019508 Mon Sep 17 00:00:00 2001 From: Chris Salvato Date: Wed, 17 Aug 2022 13:14:04 -0600 Subject: [PATCH] Reintroduces exceptions in glob docs Exceptions are possible, just not very intuitive. Updated the docs to reflect this. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 859bdf69..9f25b0e7 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,12 @@ The commands in the CLI accept any number of arguments. This means you _could_ p However, it's recommended to instead use quotes, which means that Ruby is responsible for performing the file path expansion instead. This ensures a consistent experience across different environments and shells. The globs must follow the Ruby-specific globbing syntax as specified in the documentation for [Dir](https://ruby-doc.org/core-3.1.1/Dir.html#method-c-glob). +Baked into this syntax is the ability to provide exceptions to file name patterns as well. For example, if you are in a Rails app and want to exclude files named `schema.rb` but write all other Ruby files, you can use the following syntax: + +```shell +stree write "**/{[!schema]*,*}.rb" +``` + ## Library Syntax Tree can be used as a library to access the syntax tree underlying Ruby source code.