Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bashopts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mbedsys
bashopts
Commits
10b57ec7
Commit
10b57ec7
authored
Jun 30, 2018
by
Emeric Verschuur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve join_by to support multi character separator
parent
ae332945
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
bashopts.sh
bashopts.sh
+6
-3
No files found.
bashopts.sh
View file @
10b57ec7
...
...
@@ -387,9 +387,12 @@ bashopts_math_min() {
# join array element
bashopts_join_by
()
{
local
IFS
=
"
$1
"
shift
||
bashopts_log C
"Usage: bashopts_join_by <character> [elt1 [elt2...]]"
echo
"
$*
"
local
sep
=
"
$1
"
shift
||
bashopts_log C
"Usage: bashopts_join_by <separator> [elt1 [elt2...]]"
printf
"%s"
"
$1
"
test
$#
-gt
1
||
return
0
shift
printf
"
$sep
%s"
"
$@
"
}
# dump an option value by its name
...
...
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