Skip to content

Commit

Permalink
Merge pull request #11 from hattan/trim_fix
Browse files Browse the repository at this point in the history
fixed bug in_trim and added quotes to parse examples
  • Loading branch information
hattan authored Feb 13, 2022
2 parents 4ad5adb + 67bf32f commit c2abc20
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This guide will walk you through setting up a simple script to use shArg and hig
shArgs.arg "DEBUG" -d --debug FLAG true

# parse inputs
shArgs.parse $@
shArgs.parse "$@"

echo "The message is $MESSAGE"

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ shArgs.arg "MESSAGE" -m --message PARAMETER true
shArgs.arg "DEBUG" -d --debug FLAG true

# parse inputs
shArgs.parse $@
shArgs.parse "$@"

echo "The message is $MESSAGE"

Expand Down Expand Up @@ -50,7 +50,7 @@ fi

example: ```shArgs.arg "MESSAGE" -m --message PARAMETER true```

* Parse inputs: ```shArgs.parse $@```
* Parse inputs: ```shArgs.parse "$@"```

* If arguments are autoexported they will be accessible via global variables.

Expand Down Expand Up @@ -181,7 +181,7 @@ orgHook() {
shArgs.arg "AZURE_DEVOPS_ORG" -o --orgName PARAMETER true orgHook

# parse inputs
shArgs.parse $@
shArgs.parse "$@"


```
Expand Down
2 changes: 1 addition & 1 deletion examples/examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ shArgs.arg "FILE" -f --file PARAMETER true


# Parse inputs
shArgs.parse $@
shArgs.parse "$@"

# assign the value to a variable
declare message=`shArgs.val "MESSAGE"`
Expand Down
2 changes: 1 addition & 1 deletion examples/hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ messageHook() {
shArgs.arg "MESSAGE" -m --message PARAMETER true messageHook

# parse inputs
shArgs.parse $@
shArgs.parse "$@"


2 changes: 1 addition & 1 deletion examples/list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare IPS
shArgs.arg "IPS" -i --ips PARAMETER true

# parse inputs
shArgs.parse $@
shArgs.parse "$@"

for ip in $IPS
do
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ shArgs.arg "MESSAGE" -m --message PARAMETER true
shArgs.arg "DEBUG" -d --debug FLAG true

# parse inputs
shArgs.parse $@
shArgs.parse "$@"

echo "The message is $MESSAGE"

Expand Down
3 changes: 2 additions & 1 deletion scripts/shArg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ _processSplitData() {

_trim() {
local value=$1
echo $value | xargs
result=$(echo "$value" | xargs)
echo $result
}

_processLine(){
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/harness/hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ messageHook() {
shArgs.arg "MESSAGE" -m --message PARAMETER true messageHook

# parse inputs
shArgs.parse $@
shArgs.parse "$@"


2 changes: 1 addition & 1 deletion spec/integration/harness/list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source scripts/shArg.sh

declare IPS
shArgs.arg "IPS" -i --ips PARAMETER true
shArgs.parse $@
shArgs.parse "$@"

for ip in $IPS
do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/harness/simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ shArgs.arg "MESSAGE" -m --message PARAMETER true
shArgs.arg "DEBUG" -d --debug FLAG true

# parse inputs
shArgs.parse $@
shArgs.parse "$@"

echo "The message is $MESSAGE"

Expand Down

0 comments on commit c2abc20

Please sign in to comment.