derivation: parse nix derivation show
This time it's JSON, and actual intended behaviour.
This commit is contained in:
@@ -42,7 +42,20 @@ func main() {
|
||||
Flag(&flagVerbose, "v", command.BoolFlag(false), "Connect nix stderr").
|
||||
Flag(&flagJSON, "json", command.BoolFlag(false), "Serialise output in JSON when applicable")
|
||||
|
||||
c.Command("build", "Build a list of installables", func(args []string) error {
|
||||
c.Command("show", command.UsageInternal, func(args []string) error {
|
||||
if len(args) < 1 {
|
||||
return commandHandlerError("usage requires at least 1 argument")
|
||||
}
|
||||
|
||||
if drv, err := nixbuild.DerivationShow(ctx, slices.Values(args)); err != nil {
|
||||
return commandHandlerError(fmt.Sprintf("cannot show: %v", err))
|
||||
} else {
|
||||
log.Printf("got %d derivations:\n%#v", len(drv), drv)
|
||||
return nil
|
||||
}
|
||||
})
|
||||
|
||||
c.Command("build", command.UsageInternal, func(args []string) error {
|
||||
if len(args) < 1 {
|
||||
return commandHandlerError("build requires at least 1 argument")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user