Utils/nproc.ps1

Register-GnuUtil @{
    Name        = 'nproc'
    Category    = 'User and system info'
    Synopsis    = 'Print the number of processing units available.'
    Usage       = @('nproc [OPTION]...')
    Description = @(
        'Print the number of processing units available to the current process,',
        'which may be less than the number of online processors.'
    )
    Options     = @(
        @{ Long = 'all'; Help = 'print the number of installed processors' }
        @{ Long = 'ignore'; Arg = 'N'; Help = 'if possible, exclude N processing units' }
    )
    Notes       = @(
        'The OMP_NUM_THREADS and OMP_THREAD_LIMIT environment variables are honored unless --all is given.',
        'PowerShell note: --all reports the same count as the runtime sees ([Environment]::ProcessorCount).'
    )
}