Skip to content

Commit

Permalink
Change --ignore-attr to --exclude-attr
Browse files Browse the repository at this point in the history
  • Loading branch information
aelsabbahy committed Oct 31, 2015
1 parent 5756524 commit c01a4f4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* [Flags](#flags)
* [add, a - Add system resource to test suite](#add-a---add-system-resource-to-test-suite)
* [flags](#flags-1)
* [--ignore-attr](#--ignore-attr)
* [--exclude-attr](#--exclude-attr)
* [package - Add a package](#package---add-a-package)
* [Attributes](#attributes)
* [file - Add a file](#file---add-a-file)
Expand Down Expand Up @@ -227,14 +227,14 @@ Will **NOT** automatically add:

### add, a - Add system resource to test suite
#### Flags
##### --ignore-attr
##### --exclude-attr
Ignore attribute(s) matching the provided glob when adding a new resource, can be specified multiple times.

Examples:
```bash
# Flags for add:
# --ignore-attr, -i [--ignore-attr option --ignore-attr option] Ignore the following attributes when adding a new resource
# --exclude-attr [--exclude-attr option --exclude-attr option] Exclude the following attributes when adding a new resource
$ goss a user nobody
Adding User to './goss.json':
Expand All @@ -251,7 +251,7 @@ Adding User to './goss.json':
}
}
$ goss a --ignore-attr uid user nobody
$ goss a --exclude-attr uid user nobody
Adding User to './goss.json':
{
Expand All @@ -265,7 +265,7 @@ Adding User to './goss.json':
}
}
$ goss a -i uid -i gid user nobody
$ goss a --exclude-attr uid --exclude-attr gid user nobody
Adding User to './goss.json':
{
Expand Down
4 changes: 2 additions & 2 deletions cmd/goss/goss.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func main() {
Usage: "add a resource to the test suite",
Flags: []cli.Flag{
cli.StringSliceFlag{
Name: "ignore-attr, i",
Usage: "Ignore the following attributes when adding a new resource",
Name: "exclude-attr",
Usage: "Exclude the following attributes when adding a new resource",
},
},
Subcommands: []cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/generate_goss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
SCRIPT_DIR=$(readlink -f $(dirname $0))

OS=$1
[[ $2 == "-q" ]] && args=("-i" "*")
[[ $2 == "-q" ]] && args=("--exclude-attr" "*")

goss() {
$SCRIPT_DIR/goss -g $SCRIPT_DIR/${OS}/goss-generated.json "$@"
Expand Down
2 changes: 1 addition & 1 deletion json.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func WriteJSON(filePath string, configJSON ConfigJSON) error {
}

func AppendResource(fileName, resourceName, key string, c *cli.Context) error {
ignoreList := c.GlobalStringSlice("ignore-attr")
ignoreList := c.GlobalStringSlice("exclude-attr")

var configJSON ConfigJSON
if _, err := os.Stat(fileName); err == nil {
Expand Down

0 comments on commit c01a4f4

Please sign in to comment.