aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/psysh-doc
blob: 0292dff761bd3f81e5d4f8e2ef33090b59b291e8 (plain)
1
2
3
4
5
6
7
8
#!/bin/sh

# get functions and constants
[ "$#" = 0 ] && php -r '$functions = get_defined_functions(); foreach ($functions["internal"] as $function) { echo $function . "\n"; };'
[ "$#" = 0 ] && php -r '$constants = get_defined_constants(true); foreach ($constants as $constant) { print_r(array_keys($constant)); };' | grep -oP "=>\s+\K\w+"

# psysh doc wrapper
[ -z "$1" ] || echo doc "$1" | psysh;