Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
c44acae5
Commit
c44acae5
authored
Jun 09, 2018
by
REAL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix -n output in showcmd output
parent
804cec9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
common
share/eterbuild/functions/common
+2
-0
test_docmd.sh
tests/test_docmd.sh
+13
-2
No files found.
share/eterbuild/functions/common
View file @
c44acae5
...
...
@@ -515,6 +515,8 @@ showcmd()
SETCOLOR_SUCCESS
echo
-n
"
\$
"
for
i
in
"
$@
"
;
do
# hack against echo -n -n
[
"
$i
"
=
"-n"
]
&&
echo
-n
" -n"
&&
continue
# print with qoutes if args have spaces
echo
-n
" "
echo
-n
"
$i
"
|
sed
-e
"s|
\(
.* .*
\)
|'
\1
'|g"
...
...
tests/test_docmd.sh
View file @
c44acae5
...
...
@@ -8,6 +8,12 @@ check()
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$2
' do not match with '
$3
'"
||
echo
"OK for '
$1
' with '
$2
'"
}
check_docmd
()
{
check
"
$1
"
"
\$
$1
"
"
$(
docmd
$1
|
head
-n1
)
"
}
func
()
{
docmd
ls
$@
...
...
@@ -15,5 +21,10 @@ docmd ls "$@"
ls
"
$@
"
}
func 1
"1 2"
func 1 2 3
#func 1 "1 2"
#func 1 2 3
TERMOUTPUT
=
check_docmd
"true false"
check_docmd
"true -n"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment