aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-07-01 22:31:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-07-01 22:31:57 +1200
commitd54558806aea74bd0096f52a938f5876b3167239 (patch)
tree077a09d445d5b76b764fe20140a407d5fd3b911f
parentPut local gamesdir at end of PATH (diff)
downloaddotfiles-d54558806aea74bd0096f52a938f5876b3167239.tar.gz
dotfiles-d54558806aea74bd0096f52a938f5876b3167239.zip
Correct Awk variable lvalue in mw(1df)
-rw-r--r--bin/mw.awk2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/mw.awk b/bin/mw.awk
index 84332fac..48f45fb1 100644
--- a/bin/mw.awk
+++ b/bin/mw.awk
@@ -1,7 +1,7 @@
# Crude approach to get alphabetic words one per line from input, not sorted or
# deduplicated
BEGIN {
- RS = "(--|['_-]*[^[:alnum:]'_-]+['_-]*)"
+ FS = "(--|['_-]*[^[:alnum:]'_-]+['_-]*)"
}
{
for (i = 1; i <= NF; i++)
eserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# Cache the options available to certain programs. Run all this in a subshell
# (none of its state needs to endure in the session)
(
options() {

    # Check or create the directory to cache the options
    # Shift the program name off; remaining arguments are the options to check
    dir=$HOME/.cache/sh/opt/$1
    prog=$1
    shift

    # Directory already exists; bail out
    [ -d "$dir" ] && return

    # Create the directory and step into it
    command -p mkdir -p -- "$dir" || return
    cd -- "$dir" || return

    # Write the program's --help output to a file, even if it's empty
    # This probably only works with GNU tools in general
    "$prog" --help </dev/null >help 2>/dev/null || return

    # Iterate through remaining arguments (desired options), creating files to
    # show they're available if found in the help output
    for opt do
        command -p grep -q -- '[^[:alnum:]]--'"$opt"'[^[:alnum:]]' help &&
            touch -- "$opt"
    done
}

# Cache options for bc(1)
options bc \
    quiet

# Cache options for ed(1)
options ed \
    verbose

# Cache options for grep(1)
options grep \
    binary-files \
    color \
    devices \
    directories \
    exclude \
    exclude-dir

# Cache options for ls(1)
options ls \
    almost-all \
    block-size \
    color \
    human-readable \
    time-style
)