add.subparsers: Declare a List of Sub-Commands for an 'ArgumentParser'.

add.subparsersR Documentation

Declare a List of Sub-Commands for an ArgumentParser.

Description

Split functionality of a script into any number of sub-commands.

Usage

## S4 method for signature 'essentials_ArgumentParser'
add.subparsers(title = NA, description = NA, program = NA, required = FALSE,
    wrap = TRUE, indent = 0, exdent = 0)

Arguments

title

character string. The name of the sub-commands group in the help message, by default "Commands:".

description

character vector. A brief description of the sub-commands group.

program

character string. The name of the program to be displayed in the help message, by default the name of the original program followed by all previous sub-commands.

required

logical. Are one of these sub-commands required? For example, in R, the sub-command CMD is not required, whereas in R CMD, the sub-commands INSTALL, REMOVE, ... are required, you must provide one of them.

wrap

logical. Should description be wrapped when printing the help message for the argument parser?

indent

a non-negative integer giving the indentation of the first line in a paragraph.

exdent

a non-negative integer giving the indentation of the subsequent lines in a paragraph.

Details

add.subparsers will return an object of class "subparsers", which can be used to add individual sub-commands with add.parser.

Value

An object of class "subparsers".


ArcadeAntics/essentials documentation built on Nov. 7, 2024, 4:33 p.m.