From 0ca7307ae9c4931067925d9bf0b85059a17f6933 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 13 Jan 2017 23:29:50 -0500 Subject: snippets: Add R commandArgs template --- snippets/ess-mode/command-args | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 snippets/ess-mode/command-args (limited to 'snippets/ess-mode/command-args') diff --git a/snippets/ess-mode/command-args b/snippets/ess-mode/command-args new file mode 100644 index 0000000..87b6643 --- /dev/null +++ b/snippets/ess-mode/command-args @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: command args +# key: cargs +# -- +args <- commandArgs(trailingOnly = TRUE) +if (length(args) != $1) + stop("Usage: `(file-name-nondirectory (buffer-file-name))` $2") + +$0 <- args[1] -- cgit v1.2.3