Commit Graph
4 Commits
Author SHA1 Message Date
Martin Tournoij 2382f9aeaa Merge bef2035b69 into f8c41dbdbb 2024-07-31 03:39:59 +05:30
Martin Tournoij bef2035b69 go: add zstyle to prevent listing packages from GOROOT and GOPATH
Adding all of GOROOT means all of stdlib is added as completions to many
commands, which I find rather noisy and rarely useful.

Before:

    [~/check]% go install <Tab>
    archive/    context/    fmt/        log/        regexp/     testing/
    bufio/      crypto/     go/         math/       runtime/    text/
    builtin/    database/   hash/       mime/       sort/       time/
    bytes/      debug/      html/       net/        strconv/    unicode/
    check.go    encoding/   image/      os/         strings/    unsafe/
    cmd/        errors/     index/      path/       sync/       vendor/
    compress/   expvar/     internal/   plugin/     syscall/
    container/  flag/       io/         reflect/    testdata/

After:

    [~/check]% go install <Tab>
    # completes to ./check.go, which is the only file in this small package.

Also add a setting to disable GOPATH, as it's kind deprecated and on its
way out. Sometimes I have some stuff "go get"'d in there, but I rarely
want that as completions.
2020-06-03 15:03:11 +08:00
Martin Tournoij 76efcab2f9 pgsql: Check for pg_config existence
pg_config isn't installed by default on many systems, and is usually
part of postgresql-libs-devel or some such, leading to needless
"pg_config not found" errors on completion.
2020-06-03 12:33:45 +08:00
Martin Tournoij f371431619 pgsql: add -X to psql commands to prevent loading ~/.psqlrc
The ~/.psqlrc may alter the output. In particular, I have '\timing on'
in there to add timings. This is useful when using psql, but not when
relying on it in scripts.

For example:

    psql -Aqt -c "select n.nspname \
        from pg_catalog.pg_namespace n \
        where n.nspname "'!~'" '^pg_' \
          and n.nspname <> 'information_schema' \
        order by 1;" postgres 2>/dev/null

Gives the output:

    public
    Time: 1.882 ms

Whereas with -X it gives the standard output:

    public
2020-06-03 11:40:37 +08:00