andir / npins

Nix dependency pinning. Very similar to Niv but has a few features that I personally wanted.
European Union Public License 1.2
164 stars 12 forks source link

Allow custom names #64

Closed fricklerhandwerk closed 4 months ago

fricklerhandwerk commented 4 months ago

I miss a way to specify a custom dependency name. This is important to have multiple versions of a dependency.

In niv it works like this:

niv add NixOS/nixpkgs -n nixpkgs -b nixpkgs-unstable
piegamesde commented 4 months ago

This was previously tracked in #54, an issue which unfortunately got closed due to external reasons. You actually can, and this is a documentation/discoverability issue:

npins add --name nixpkgs channel nixpkgs-unstable
fricklerhandwerk commented 4 months ago

Ah, it seems I got confused over the difference in output between npins add --help and npins add github --help.

$ npins add github --help
npins-add-github 0.2.0
Track a GitHub repository

USAGE:
    npins add github [FLAGS] [OPTIONS] <owner> <repository>

FLAGS:
    -h, --help            Prints help information
        --pre-releases    Also track pre-releases. Conflicts with the --branch option

OPTIONS:
        --at <tag or rev>          Use a specific commit/release instead of the latest. This may be a tag name, or a git
                                   revision when --branch is set
    -b, --branch <branch>          Track a branch instead of a release
    -d, --directory <folder>       Base folder for sources.json and the boilerplate default.nix [env: NPINS_DIRECTORY=]
                                   [default: npins]
        --upper-bound <version>    Bound the version resolution. For example, setting this to "2" will restrict updates
                                   to 1.X versions. Conflicts with the --branch option

ARGS:
    <owner>         
    <repository>    

It shows [OPTIONS] but correctly doesn't show --name, and skimming through the README and checking the code told me that --name should exist regardless.

So the code is correct and the interface is sane, it's just not evident that it must be in that particular order.

fricklerhandwerk commented 4 months ago

I don't think one can do more than simply adding a blurb to the --name flag help output.

piegamesde commented 4 months ago

Given that you're the second person opening an issue about this, let's keep it open for visibility, until the confusion is removed.