Skip to content

Commit

Permalink
cat (manifest) can now force to lookup the installed version
Browse files Browse the repository at this point in the history
  • Loading branch information
Bios-Marcel committed Nov 22, 2024
1 parent f3fda8e commit d819089
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cmd/spoon/cat.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func catCmd() *cobra.Command {
return &cobra.Command{
cmd := &cobra.Command{
Use: "cat {app}",
Short: "Print JSON manifest of an available app",
Long: "Print JSON manifest of an available app. Optionally this command accepts a URL to a manifest file.",
Expand All @@ -28,9 +28,12 @@ func catCmd() *cobra.Command {
return fmt.Errorf("error getting default scoop: %w", err)
}

app, err := defaultScoop.FindAvailableApp(args[0])
if err != nil {
return fmt.Errorf("error finding app: %w", err)
var app *scoop.App
if !must(cmd.Flags().GetBool("installed")) {
app, err = defaultScoop.FindAvailableApp(args[0])
if err != nil {
return fmt.Errorf("error finding app: %w", err)
}
}

if app == nil {
Expand Down Expand Up @@ -73,4 +76,8 @@ func catCmd() *cobra.Command {
return nil
}),
}

cmd.Flags().BoolP("installed", "i", false, "Show manifest of installed app")

return cmd
}

0 comments on commit d819089

Please sign in to comment.