Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: 5e4c49463607
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 07eb21ceaf7a
Choose a head ref
  • 8 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 23, 2020

  1. lib/cli: unexport symbols & sort with generators

    lib/cli is very similar to generators, so it should follow largely the
    same interface. Similar to how generators isn’t exported, we should
    also namespace cli by default (plus “cli” is only three characters to
    type).
    Profpatsch committed Jan 23, 2020
    Copy the full SHA
    88a7f65 View commit details
    Browse the repository at this point in the history
  2. lib/cli: encodeGNUCommandLine -> toGNUCommandLineShell

    The semantic difference between `encode` and `to` is not apparent.
    Users are likely to confuse both functions (which leads to unexpected
    error messages about the wrong types). Like in `generators.nix`, all
    functions should be prefixed by `to`.
    
    Furthermore, converting to a string depends on the target context. In
    this case, it’s a POSIX shell, so we should name it that (compare
    `escapeShellArg` in `strings.nix`).
    
    We can later add versions that escape for embedding in e.g. python
    scripts or similar.
    Profpatsch committed Jan 23, 2020
    Copy the full SHA
    582354d View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    6841f40 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    b2654c2 View commit details
    Browse the repository at this point in the history
  5. lib/cli: rename renderX options to mkX

    Mirrors the naming scheme in `generators.nix`, for consistency.
    
    Also rename `key` to `k` and value to `v` to aid readability to the
    code structure.
    Profpatsch committed Jan 23, 2020
    Copy the full SHA
    e71e1be View commit details
    Browse the repository at this point in the history
  6. lib/generators: floats are not supported in mkValueStringDefault

    They are cut off after a few decimal places; we cannot in good faith
    define a default string representation with that.
    Profpatsch committed Jan 23, 2020
    Copy the full SHA
    18520b7 View commit details
    Browse the repository at this point in the history
  7. lib/cli: mkKey -> mkOptionName, use generators.mkValueStringDefault

    Let’s call them by what they are, option names.
    
    `generators.mkValueStringDefault` is a better value string renderer
    than plain `toString`.
    
    Also add docs to all options.
    Profpatsch committed Jan 23, 2020
    Copy the full SHA
    7228a3c View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2020

  1. Merge pull request #78337 from Profpatsch/lib-improve-cli-module

    lib: improve cli module
    Profpatsch committed Jan 24, 2020
    Copy the full SHA
    07eb21c View commit details
    Browse the repository at this point in the history