-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support cabal.project, remove --cabal-file key
- Loading branch information
Showing
4 changed files
with
148 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
# cabal-add | ||
|
||
``` | ||
$ cabal-add --help | ||
Usage: cabal-add [-f|--cabal-file FILE] ARGS | ||
Extend build-depends from the command line | ||
Available options: | ||
-f,--cabal-file FILE Cabal file to edit in place (tries to detect Cabal | ||
file in current folder if omitted). | ||
ARGS Optional package component (wildcards such as 'exe', | ||
'test' or 'bench' are supported) to update, followed | ||
by a non-empty list of package(s) to add to | ||
'build-depends' section. Version bounds can be | ||
provided as well, use quotes to escape comparisons | ||
from your shell. E. g., 'foo < 0.2'. | ||
``` | ||
Extend Cabal `build-depends` from the command line. | ||
|
||
`cabal-add` does not have limitations of | ||
[`cabal-edit`](https://hackage.haskell.org/package/cabal-edit): | ||
it works on any sectioned Cabal file, | ||
supports stanzas and conditional blocks, | ||
and preserves original formatting. | ||
|
||
Install with | ||
|
||
``` | ||
git clone https://github.com/Bodigrim/cabal-add.git | ||
cd cabal-add | ||
cabal install exe:cabal-add --allow-newer='cabal-install-parsers:*' | ||
``` | ||
|
||
To add a dependency on `foo`, switch to a folder with your project and execute | ||
|
||
``` | ||
cabal-add foo | ||
``` | ||
|
||
If you are using Cabal 3.11+ which supports | ||
[external commands](https://cabal.readthedocs.io/en/latest/external-commands.html), | ||
you can omit the dash: | ||
|
||
``` | ||
cabal add foo | ||
``` | ||
|
||
Command-line arguments: | ||
|
||
* `--project-file FILE` | ||
|
||
Set the path of the cabal.project file. Detect `cabal.project` or `*.cabal` | ||
in the current folder, if omitted. | ||
|
||
* `ARGS` | ||
|
||
Optional package component (wildcards such as `exe`, | ||
`test` or `bench` are supported) to update, followed | ||
by a non-empty list of package(s) to add to | ||
`build-depends` section. Version bounds can be | ||
provided as well, use quotes to escape comparisons | ||
from your shell. E. g., `'foo < 0.2'`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters