Runs convertxlsform() with options taken from the command line. Use it
from a shell without opening R:
Usage
cli(args = commandArgs(trailingOnly = TRUE))Value
The exit status invisibly: 0 on success, 1 on a usage error or a failed conversion. The function does not quit R.
Details
Put the XLSForm path and the options after the quoted expression. If a
script or CI job needs the exit status, use
Rscript -e 'quit(status = convertxlsform::cli())' form.xlsx. The plain
form above also works for normal use.
This function is a terminal interface. Its help and version text go to
standard output, and usage errors go to standard error, because that
output is its purpose. Progress messages are sent with message() and
--quiet suppresses them (the same as verbose = FALSE in
convertxlsform()).
Usage
cli(args): form.xlsx [options]. Options accept --name value and
--name=value.
-o,--output PATH: output file or folder (default: next to the form).-f,--format docx|pdf|both: output format (default: from the extension of--output, elsedocx).-l,--lang LANG: language code, name or header suffix.--lang2 LANG: second language, printed under the first.--flat-numbers: number questions 1, 2, 3 instead of 1.1, 1.2.--no-relevants: hide skip logic.--no-skips: hide "Go to" instructions next to choices.--no-constraints: hide constraints.--no-hints: hide hints.--no-choice-codes: hide choice codes.--show-names: show variable names.--include-hidden: include calculate, start, end and similar rows.--media-root DIR: folder for media and external files (default: the folder of the form).--title TEXT: form title.--page-size A4|letter(defaultA4).--landscape: landscape orientation.--margins IN: margins in inches (default 1).--font NAME(defaultArial) and--font-size PT(default 11).--font-cs NAME: font for complex scripts such as Bengali or Arabic.--rtl,--ltr: force right-to-left or left-to-right layout (default: from the script of the language).--template FILE: reference.docxfor styles.--max-choices N: longest choice list printed in full (default 30).--repeat-copies N: copies of each repeat group (default 1).--repeat-layout auto|copies|roster: how repeat groups are drawn (defaultauto).--roster-rows N: rows of a roster when the repeat count is not a number (default 5).--overwrite: replace existing output.--quiet: no progress messages.-h,--help: show the help and stop.--version: show the package version and stop.
Examples
path <- system.file("extdata", "minimal", "minimal.xlsx",
package = "convertxlsform")
cli(c(path, "-o", tempdir(), "--overwrite", "--quiet"))
