README adjustments
diff --git a/README.md b/README.md
index 466101c..074b77d 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,12 @@
+# doublestar
+
+Path pattern matching and globbing supporting `doublestar` (`**`) patterns.
+
![Release](https://img.shields.io/github/release/bmatcuk/doublestar.svg?branch=master)
[![Build Status](https://travis-ci.org/bmatcuk/doublestar.svg?branch=master)](https://travis-ci.org/bmatcuk/doublestar)
[![codecov.io](https://img.shields.io/codecov/c/github/bmatcuk/doublestar.svg?branch=master)](https://codecov.io/github/bmatcuk/doublestar?branch=master)
-# doublestar
+## About
**doublestar** is a [golang](http://golang.org/) implementation of path pattern
matching and globbing with support for "doublestar" (aka globstar: `**`)
@@ -11,7 +15,7 @@
doublestar patterns match files and directories recursively. For example, if
you had the following directory structure:
-```
+```bash
grandparent
`-- parent
|-- child1
@@ -43,9 +47,10 @@
import "github.com/bmatcuk/doublestar"
```
-## Functions
+## Usage
### Match
+
```go
func Match(pattern, name string) (bool, error)
```
@@ -61,11 +66,12 @@
### PathMatch
+
```go
func PathMatch(pattern, name string) (bool, error)
```
-PathMatch returns true if `name` matches the file name `pattern`
+PathMatch returns true if `name` matches the file name `pattern`
([see below](#patterns)). The difference between Match and PathMatch is that
PathMatch will automatically use your system's path separator to split `name`
and `pattern`.
@@ -73,6 +79,7 @@
`PathMatch()` is meant to be a drop-in replacement for `filepath.Match()`.
### Glob
+
```go
func Glob(pattern string) ([]string, error)
```
@@ -83,7 +90,7 @@
`Glob()` is meant to be a drop-in replacement for `filepath.Glob()`.
-## Patterns
+### Patterns
**doublestar** supports the following special terms in the patterns:
@@ -97,7 +104,7 @@
Any character with a special meaning can be escaped with a backslash (`\`).
-### Character Classes
+#### Character Classes
Character classes support the following:
@@ -107,7 +114,7 @@
`[a-z]` | matches any single character in the range
`[^class]` | matches any single character which does *not* match the class
-## Abstracting the `os` package
+### Abstracting the `os` package
**doublestar** by default uses the `Open`, `Stat`, and `Lstat`, functions and
`PathSeparator` value from the standard library's `os` package. To abstract
@@ -118,12 +125,16 @@
```go
type OS interface {
- Lstat(name string) (os.FileInfo, error)
- Open(name string) (*os.File, error)
- PathSeparator() rune
- Stat(name string) (os.FileInfo, error)
+ Lstat(name string) (os.FileInfo, error)
+ Open(name string) (*os.File, error)
+ PathSeparator() rune
+ Stat(name string) (os.FileInfo, error)
}
```
`StandardOS` is a value that implements this interface by calling functions in
-the standard library's `os` package.
\ No newline at end of file
+the standard library's `os` package.
+
+## License
+
+[MIT License](LICENSE)