Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
4688c4bc
Commit
4688c4bc
authored
Feb 12, 2015
by
Jorge Bucaran
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #374 from bucaran/fix-getopts-help
fix getopts: handle -h --help bug fish-shell#746
parents
07d1fa39
681fb07f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
plugins/getopts/getopts.fish
plugins/getopts/getopts.fish
+4
-4
No files found.
plugins/getopts/getopts.fish
View file @
4688c4bc
...
...
@@ -201,7 +201,7 @@ function getopts
case --\* # Skip!
case -\*
# Split each token into single characters with `.`
for char in (printf $token | cut -c2- | grep --only-matching .)
for char in (printf
"%s"
$token | cut -c2- | grep --only-matching .)
# Do not split short option characters if this option can
# take optional required arguments.
if [ -z "$suspend_break" ]
...
...
@@ -269,7 +269,7 @@ function getopts
and set -l is_long_option
# Trim leading dashes and prepare to match with valid options.
set option (printf $option | sed 's/^-*//g')
set option (printf
"%s"
$option | sed 's/^-*//g')
for substring in $__getopts_optstr
# Split up by token separator `:`. The resulting list contains
...
...
@@ -288,7 +288,7 @@ function getopts
if [ $last_token = \^ ]
if set -q is_long_option
set -l option_value (printf $option | tr = \n)
set -l option_value (printf
"%s"
$option | tr = \n)
if set -q option_value[2]
# Check if it is a valid option match.
...
...
@@ -350,7 +350,7 @@ function getopts
# Check if next argument exists.
if set -q argv[$__getopts_index]
# Sanitize the option-argument.
set -l value (printf $argv[$__getopts_index])
set -l value (printf
"%s"
$argv[$__getopts_index])
if [ -z "$value" ]
# Print any non-empty list character.
printf "\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