1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-07 22:36:53 +03:00

Merge pull request #190 from nmattia/nm-document-modify

Mention the modify command in README
This commit is contained in:
Nicolas Mattia 2020-01-20 17:34:33 +01:00 committed by GitHub
commit d29a2b6901
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 5 deletions

View File

@ -43,12 +43,13 @@ necessary for fetching and updating the packages.
* [Update](#update): updates one or all packages in `nix/sources.json`.
* [Drop](#drop): deletes a package from `nix/sources.json`.
`niv` has two more utility functions:
`niv` has some utility functions:
* [Init](#init): bootstraps a Nix project, in particular creates a
`nix/sources.json` file containing `niv` and `nixpkgs` as well as a
`nix/sources.nix` file that returns the sources as a Nix object.
* [Show](#show): shows the packages' information.
* [Modify](#modify): modifies attributes _without_ performing an update.
### Configuration
@ -217,7 +218,8 @@ Available commands:
add Add a GitHub dependency
show
update Update dependencies
modify Modify dependency
modify Modify dependency attributes without performing an
update
drop Drop dependency
```
@ -293,6 +295,38 @@ Available options:
```
#### Modify
```
Examples:
niv modify nixpkgs -v beta-0.2
niv modify nixpkgs -a branch=nixpkgs-unstable
Usage: niv modify PACKAGE ([-a|--attribute KEY=VAL] |
[-s|--string-attribute KEY=VAL] | [-b|--branch BRANCH] |
[-o|--owner OWNER] | [-r|--repo REPO] | [-v|--version VERSION]
| [-t|--template URL] | [-T|--type TYPE])
Modify dependency attributes without performing an update
Available options:
-a,--attribute KEY=VAL Set the package spec attribute <KEY> to <VAL>, where
<VAL> may be JSON.
-s,--string-attribute KEY=VAL
Set the package spec attribute <KEY> to <VAL>.
-b,--branch BRANCH Equivalent to --attribute branch=<BRANCH>
-o,--owner OWNER Equivalent to --attribute owner=<OWNER>
-r,--repo REPO Equivalent to --attribute repo=<REPO>
-v,--version VERSION Equivalent to --attribute version=<VERSION>
-t,--template URL Used during 'update' when building URL. Occurrences
of <foo> are replaced with attribute 'foo'.
-T,--type TYPE The type of the URL target. The value can be either
'file' or 'tarball'. If not set, the value is
inferred from the suffix of the URL.
-h,--help Show this help text
```
#### Drop
```

View File

@ -43,12 +43,13 @@ necessary for fetching and updating the packages.
* [Update](#update): updates one or all packages in `nix/sources.json`.
* [Drop](#drop): deletes a package from `nix/sources.json`.
`niv` has two more utility functions:
`niv` has some utility functions:
* [Init](#init): bootstraps a Nix project, in particular creates a
`nix/sources.json` file containing `niv` and `nixpkgs` as well as a
`nix/sources.nix` file that returns the sources as a Nix object.
* [Show](#show): shows the packages' information.
* [Modify](#modify): modifies attributes _without_ performing an update.
### Configuration
@ -216,6 +217,12 @@ replace_niv_add_help
replace_niv_update_help
```
#### Modify
```
replace_niv_modify_help
```
#### Drop
```

View File

@ -210,7 +210,7 @@ rec
pkgs.runCommand "niv_${cmd}_help" { buildInputs = [ niv ]; }
"niv ${cmd} --help > $out"
);
cmds = [ "add" "update" "drop" "init" "show" ];
cmds = [ "add" "update" "modify" "drop" "init" "show" ];
in
pkgs.lib.replaceStrings
([ "replace_niv_help" ] ++ (map (cmd: "replace_niv_${cmd}_help") cmds))

View File

@ -399,7 +399,7 @@ parseCmdModify =
where
desc =
[ Opts.fullDesc
, Opts.progDesc "Modify dependency"
, Opts.progDesc "Modify dependency attributes without performing an update"
, Opts.headerDoc $ Just $
"Examples:" Opts.<$$>
"" Opts.<$$>