<commit_before># Usage: scoop info <app>
# Summary: Display information about an app
param($app)

. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\depends.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\versions.ps1"

reset_aliases

if(!$app) { my_usage; exit 1 }

$global = installed $app $true
$app, $bucket, $null = parse_app $app
$status = app_status $app $global
$manifest, $bucket = find_manifest $app $bucket

if (!$manifest) {
    if ($bucket) {
        abort "Could not find manifest for '$bucket/$app'."
    } else {
        abort "Could not find manifest for '$app'."
    }
}

$install = install_info $app $status.version $global
$manifest_file = manifest_path $app $bucket
$version_output = $manifest.version

$dir = versiondir $app 'current' $global
$original_dir = versiondir $app $manifest.version $global
$persist_dir = persistdir $app $global

if($status.installed) {
    $bucket = $install.bucket
    $manifest_file = manifest_path $app $bucket
    if($install.url) { $manifest_file = $install.url }
    if($status.version -eq $manifest.version) {
        $version_output = $status.version
    } else {
        $version_output = "$($status.version) (Update to $($manifest.version) available)"
    }
}

Write-Output "Name:      $app"
if ($manifest.description) {
    Write-Output "  $($manifest.description)"
}
Write-Output "Version:   $version_output"
Write-Output "Website:   $($manifest.homepage)"
# Show license
if ($manifest.license) {
    $license = $manifest.license
    if($manifest.license -notmatch '^((ht)|f)tps?://') {
        $license = "$($manifest.license) (https://spdx.org/licenses/$($manifest.license).html)"
    }
    Write-Output "License:   $license"
}

# Manifest file
Write-Output "Manifest:`n  $manifest_file"

if($status.installed) {
    # Show installed versions
    Write-Output "Installed:"
    $versions = versions $app $global
    $versions | ForEach-Object {
        $dir = versiondir $app $_ $global
        if($global) { $dir += " *global*" }
        Write-Output "  $dir"
    }
} else {
    Write-Output "Installed: No"
}

$binaries = arch_specific 'bin' $manifest $install.architecture
if($binaries) {
    Write-Output "Binaries:`n  $binaries"
}

if($manifest.env_set -or $manifest.env_add_path) {
    if($status.installed) {<commit_msg>Scoop-info: improve output (#2257)<commit_after># Usage: scoop info <app>
# Summary: Display information about an app
param($app)

. "$psscriptroot\..\lib\buckets.ps1"
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\depends.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\versions.ps1"

reset_aliases

if(!$app) { my_usage; exit 1 }

$global = installed $app $true
$app, $bucket, $null = parse_app $app
$status = app_status $app $global
$manifest, $bucket = find_manifest $app $bucket

if (!$manifest) {
    if ($bucket) {
        abort "Could not find manifest for '$bucket/$app'."
    } else {
        abort "Could not find manifest for '$app'."
    }
}

$install = install_info $app $status.version $global
$manifest_file = manifest_path $app $bucket
$version_output = $manifest.version

$dir = versiondir $app 'current' $global
$original_dir = versiondir $app $manifest.version $global
$persist_dir = persistdir $app $global

if($status.installed) {
    $bucket = $install.bucket
    $manifest_file = manifest_path $app $bucket
    if($install.url) { $manifest_file = $install.url }
    if($status.version -eq $manifest.version) {
        $version_output = $status.version
    } else {
        $version_output = "$($status.version) (Update to $($manifest.version) available)"
    }
}

Write-Output "Name: $app"
if ($manifest.description) {
    Write-Output "Description: $($manifest.description)"
}
Write-Output "Version: $version_output"
Write-Output "Website: $($manifest.homepage)"
# Show license
if ($manifest.license) {
    $license = $manifest.license
    if($manifest.license -notmatch '^((ht)|f)tps?://') {
        $license = "$($manifest.license) (https://spdx.org/licenses/$($manifest.license).html)"
    }
    Write-Output "License: $license"
}

# Manifest file
Write-Output "Manifest:`n  $manifest_file"

if($status.installed) {
    # Show installed versions
    Write-Output "Installed:"
    $versions = versions $app $global
    $versions | ForEach-Object {
        $dir = versiondir $app $_ $global
        if($global) { $dir += " *global*" }
        Write-Output "  $dir"
    }
} else {
    Write-Output "Installed: No"
}

$binaries = arch_specific 'bin' $manifest $install.architecture
if($binaries) {
    Write-Output "Binaries:`n  $binaries"
}

if($manifest.env_set -or $manifest.env_add_path) {
    if($status.installed) {
{'fraction_non_alphanumeric': 0.1646479162389653, 'fraction_numerical': 0.0041059330732909054, 'mean_word_length': 3.644423260247855, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3588183', 'n_tokens_mistral': 1692, 'n_tokens_neox': 1611, 'n_words': 362}