Skip to content

Commit

Permalink
Merge pull request #209 from hariprakash-j/feat/add-logs-filters
Browse files Browse the repository at this point in the history
added log filters to filter the log output
  • Loading branch information
ericzbeard authored Nov 15, 2023
2 parents 4080ac5 + a082856 commit 82d0829
Show file tree
Hide file tree
Showing 32 changed files with 404 additions and 176 deletions.
39 changes: 28 additions & 11 deletions docs/bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ __rain_handle_go_custom_completion()
local out requestComp lastParam lastChar comp directive args

# Prepare the command to request completions for the program.
# Calling ${words[0]} instead of directly rain allows to handle aliases
# Calling ${words[0]} instead of directly rain allows handling aliases
args=("${words[@]:1}")
requestComp="${words[0]} __completeNoDesc ${args[*]}"
# Disable ActiveHelp which is not supported for bash completion v1
requestComp="RAIN_ACTIVE_HELP=0 ${words[0]} __completeNoDesc ${args[*]}"

lastParam=${words[$((${#words[@]}-1))]}
lastChar=${lastParam:$((${#lastParam}-1)):1}
Expand All @@ -77,7 +78,7 @@ __rain_handle_go_custom_completion()
directive=0
fi
__rain_debug "${FUNCNAME[0]}: the completion directive is: ${directive}"
__rain_debug "${FUNCNAME[0]}: the completions are: ${out[*]}"
__rain_debug "${FUNCNAME[0]}: the completions are: ${out}"

if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
# Error code. No completion.
Expand All @@ -103,7 +104,7 @@ __rain_handle_go_custom_completion()
local fullFilter filter filteringCmd
# Do not use quotes around the $out variable or else newline
# characters will be kept.
for filter in ${out[*]}; do
for filter in ${out}; do
fullFilter+="$filter|"
done

Expand All @@ -114,7 +115,7 @@ __rain_handle_go_custom_completion()
# File completion for directories only
local subdir
# Use printf to strip any trailing newline
subdir=$(printf "%s" "${out[0]}")
subdir=$(printf "%s" "${out}")
if [ -n "$subdir" ]; then
__rain_debug "Listing directories in $subdir"
__rain_handle_subdirs_in_dir_flag "$subdir"
Expand All @@ -125,7 +126,7 @@ __rain_handle_go_custom_completion()
else
while IFS='' read -r comp; do
COMPREPLY+=("$comp")
done < <(compgen -W "${out[*]}" -- "$cur")
done < <(compgen -W "${out}" -- "$cur")
fi
}

Expand Down Expand Up @@ -665,6 +666,8 @@ _rain_fmt()
flags_with_completion=()
flags_completion=()

flags+=("--debug")
local_nonpersistent_flags+=("--debug")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
Expand All @@ -685,7 +688,6 @@ _rain_fmt()
flags+=("-w")
local_nonpersistent_flags+=("--write")
local_nonpersistent_flags+=("-w")
flags+=("--debug")
flags+=("--no-colour")

must_have_one_flag=()
Expand Down Expand Up @@ -713,6 +715,8 @@ _rain_forecast()
local_nonpersistent_flags+=("--config")
local_nonpersistent_flags+=("--config=")
local_nonpersistent_flags+=("-c")
flags+=("--debug")
local_nonpersistent_flags+=("--debug")
flags+=("--experimental")
flags+=("-x")
local_nonpersistent_flags+=("--experimental")
Expand Down Expand Up @@ -751,7 +755,6 @@ _rain_forecast()
two_word_flags+=("--type")
local_nonpersistent_flags+=("--type")
local_nonpersistent_flags+=("--type=")
flags+=("--debug")
flags+=("--no-colour")

must_have_one_flag=()
Expand Down Expand Up @@ -846,10 +849,24 @@ _rain_logs()
flags+=("-c")
local_nonpersistent_flags+=("--chart")
local_nonpersistent_flags+=("-c")
flags+=("--days=")
two_word_flags+=("--days")
two_word_flags+=("-d")
local_nonpersistent_flags+=("--days")
local_nonpersistent_flags+=("--days=")
local_nonpersistent_flags+=("-d")
flags+=("--debug")
local_nonpersistent_flags+=("--debug")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--length=")
two_word_flags+=("--length")
two_word_flags+=("-l")
local_nonpersistent_flags+=("--length")
local_nonpersistent_flags+=("--length=")
local_nonpersistent_flags+=("-l")
flags+=("--profile=")
two_word_flags+=("--profile")
two_word_flags+=("-p")
Expand All @@ -862,7 +879,6 @@ _rain_logs()
local_nonpersistent_flags+=("--region")
local_nonpersistent_flags+=("--region=")
local_nonpersistent_flags+=("-r")
flags+=("--debug")
flags+=("--no-colour")

must_have_one_flag=()
Expand Down Expand Up @@ -962,6 +978,8 @@ _rain_pkg()
flags_with_completion=()
flags_completion=()

flags+=("--debug")
local_nonpersistent_flags+=("--debug")
flags+=("--experimental")
flags+=("-x")
local_nonpersistent_flags+=("--experimental")
Expand Down Expand Up @@ -996,7 +1014,6 @@ _rain_pkg()
two_word_flags+=("--s3-prefix")
local_nonpersistent_flags+=("--s3-prefix")
local_nonpersistent_flags+=("--s3-prefix=")
flags+=("--debug")
flags+=("--no-colour")

must_have_one_flag=()
Expand Down Expand Up @@ -1265,6 +1282,7 @@ _rain_stackset()
flags+=("-h")
local_nonpersistent_flags+=("--help")
local_nonpersistent_flags+=("-h")
flags+=("--no-colour")
flags+=("--profile=")
two_word_flags+=("--profile")
two_word_flags+=("-p")
Expand All @@ -1278,7 +1296,6 @@ _rain_stackset()
local_nonpersistent_flags+=("--region=")
local_nonpersistent_flags+=("-r")
flags+=("--debug")
flags+=("--no-colour")

must_have_one_flag=()
must_have_one_noun=()
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Rain is a command line tool for working with AWS CloudFormation templates and st
* [rain tree](rain_tree.md) - Find dependencies of Resources and Outputs in a local template
* [rain watch](rain_watch.md) - Display an updating view of a CloudFormation stack

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain bootstrap

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain build [<resource type>...]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_cat.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ rain cat <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_console.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ rain console [stack]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ rain deploy <template> [stack]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ rain diff <from> <to>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
4 changes: 2 additions & 2 deletions docs/rain_fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rain fmt <filename>...
### Options

```
--debug Output debugging information
-h, --help help for fmt
-j, --json Output the template as JSON (default format: YAML).
-u, --unsorted Do not sort the template's properties.
Expand All @@ -24,12 +25,11 @@ rain fmt <filename>...
### Options inherited from parent commands

```
--debug Output debugging information
--no-colour Disable colour output
```

### SEE ALSO

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
4 changes: 2 additions & 2 deletions docs/rain_forecast.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ rain forecast --experimental <template> [stackName]

```
-c, --config string YAML or JSON file to set tags and parameters
--debug Output debugging information
-x, --experimental Acknowledge that this is an experimental feature
-h, --help help for forecast
--params strings set parameter values; use the format key1=value1,key2=value2
Expand All @@ -51,12 +52,11 @@ rain forecast --experimental <template> [stackName]
### Options inherited from parent commands

```
--debug Output debugging information
--no-colour Disable colour output
```

### SEE ALSO

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain info

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
6 changes: 4 additions & 2 deletions docs/rain_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@ rain logs <stack> (<resource>)
```
-a, --all include uninteresting logs
-c, --chart Output a gantt chart of the most recent action as an html file
-d, --days uint Age of the logs to display in days
--debug Output debugging information
-h, --help help for logs
-l, --length uint Number of logs to display
-p, --profile string AWS profile name; read from the AWS CLI configuration file
-r, --region string AWS region to use
```

### Options inherited from parent commands

```
--debug Output debugging information
--no-colour Disable colour output
```

### SEE ALSO

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain ls <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ rain merge <template> <template> ...

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
4 changes: 2 additions & 2 deletions docs/rain_pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ rain pkg <template>
### Options

```
--debug Output debugging information
-x, --experimental Enable experimental features
-h, --help help for pkg
-o, --output string Output packaged template to a file
Expand All @@ -58,12 +59,11 @@ rain pkg <template>
### Options inherited from parent commands

```
--debug Output debugging information
--no-colour Disable colour output
```

### SEE ALSO

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ rain rm <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
6 changes: 3 additions & 3 deletions docs/rain_stackset.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ This command manipulates stack sets. It has no action if specific stack set comm

```
-h, --help help for stackset
--no-colour Disable colour output
-p, --profile string AWS profile name; read from the AWS CLI configuration file
-r, --region string AWS region to use
```

### Options inherited from parent commands

```
--debug Output debugging information
--no-colour Disable colour output
--debug Output debugging information
```

### SEE ALSO
Expand All @@ -28,4 +28,4 @@ This command manipulates stack sets. It has no action if specific stack set comm
* [rain stackset ls](rain_stackset_ls.md) - List a CloudFormation stack sets in a given region
* [rain stackset rm](rain_stackset_rm.md) - Delete a CloudFormation stack set and/or its instances.

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_stackset_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ rain stackset deploy <template> [stackset] [flags]

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_stackset_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain stackset ls <stack set>

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_stackset_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain stackset rm <stackset>

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain tree [template]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
2 changes: 1 addition & 1 deletion docs/rain_watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain watch <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 6-Sep-2023
###### Auto generated by spf13/cobra on 15-Nov-2023
Loading

0 comments on commit 82d0829

Please sign in to comment.