Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
0e3cefbd
Commit
0e3cefbd
authored
3 years ago
by
Robert
Browse files
Options
Downloads
Patches
Plain Diff
Distribution.GetOpt: remove unused argument order option
parent
84a43f77
Branches
gb/no-reconfigure-test-flags
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cabal/src/Distribution/GetOpt.hs
+1
-5
1 addition, 5 deletions
Cabal/src/Distribution/GetOpt.hs
with
1 addition
and
5 deletions
Cabal/src/Distribution/GetOpt.hs
+
1
−
5
View file @
0e3cefbd
...
...
@@ -19,8 +19,7 @@
--
-- * Parsing of option arguments is allowed to fail.
--
-- If you want to take on the challenge of merging this with the GetOpt
-- from the base package then go for it!
-- * 'ReturnInOrder' argument order is removed.
--
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE NamedFieldPuns #-}
...
...
@@ -43,7 +42,6 @@ import Distribution.Compat.Prelude
data
ArgOrder
a
=
RequireOrder
-- ^ no option processing after first non-option
|
Permute
-- ^ freely intersperse options and non-options
|
ReturnInOrder
(
String
->
a
)
-- ^ wrap non-options into options
data
OptDescr
a
=
-- description of a single options:
Option
[
Char
]
-- list of short option characters
...
...
@@ -184,10 +182,8 @@ getOpt' ordering optDescr (arg:args) = procNextOpt opt ordering
procNextOpt
(
UnreqOpt
u
)
_
=
(
os
,
xs
,
u
:
us
,
es
)
procNextOpt
(
NonOpt
x
)
RequireOrder
=
(
[]
,
x
:
rest
,
[]
,
[]
)
procNextOpt
(
NonOpt
x
)
Permute
=
(
os
,
x
:
xs
,
us
,
es
)
procNextOpt
(
NonOpt
x
)
(
ReturnInOrder
f
)
=
(
f
x
:
os
,
xs
,
us
,
es
)
procNextOpt
EndOfOpts
RequireOrder
=
(
[]
,
rest
,
[]
,
[]
)
procNextOpt
EndOfOpts
Permute
=
(
[]
,
rest
,
[]
,
[]
)
procNextOpt
EndOfOpts
(
ReturnInOrder
f
)
=
(
map
f
rest
,
[]
,
[]
,
[]
)
procNextOpt
(
OptErr
e
)
_
=
(
os
,
xs
,
us
,
e
:
es
)
(
opt
,
rest
)
=
getNext
arg
args
optDescr
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment