summaryrefslogtreecommitdiff
path: root/std/examples/xeval.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/examples/xeval.ts')
-rw-r--r--std/examples/xeval.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/std/examples/xeval.ts b/std/examples/xeval.ts
index 6589fec16..d688a6bf7 100644
--- a/std/examples/xeval.ts
+++ b/std/examples/xeval.ts
@@ -14,16 +14,16 @@ const HELP_MSG = `xeval
Run a script for each new-line or otherwise delimited chunk of standard input.
Print all the usernames in /etc/passwd:
- cat /etc/passwd | deno -A https://deno.land/std/examples/xeval.ts "a = $.split(':'); if (a) console.log(a[0])"
+ cat /etc/passwd | deno run -A https://deno.land/std/examples/xeval.ts "a = $.split(':'); if (a) console.log(a[0])"
A complicated way to print the current git branch:
- git branch | deno -A https://deno.land/std/examples/xeval.ts -I 'line' "if (line.startsWith('*')) console.log(line.slice(2))"
+ git branch | deno run -A https://deno.land/std/examples/xeval.ts -I 'line' "if (line.startsWith('*')) console.log(line.slice(2))"
Demonstrates breaking the input up by space delimiter instead of by lines:
- cat LICENSE | deno -A https://deno.land/std/examples/xeval.ts -d " " "if ($ === 'MIT') console.log('MIT licensed')",
+ cat LICENSE | deno run -A https://deno.land/std/examples/xeval.ts -d " " "if ($ === 'MIT') console.log('MIT licensed')",
USAGE:
- deno -A https://deno.land/std/examples/xeval.ts [OPTIONS] <code>
+ deno run -A https://deno.land/std/examples/xeval.ts [OPTIONS] <code>
OPTIONS:
-d, --delim <delim> Set delimiter, defaults to newline
-I, --replvar <replvar> Set variable name to be used in eval, defaults to $