TODO.md

Rename opt_get

Is opt_get really opt_read. It seems that the verb get is for retrieving symbols internal to R; read is for getting data from outside of R.

Confusion with options, getOption

First, the syntax for a global singleton for options is horribly (cf. the options package).

Number of options (n)

GREEDY could be an exported constant such as: 1 ~ Inf

Coercision

With magrittr, this is less important since

"--f" %>% opt_grab %>% as.numeric

works well

Match Args (?)

I don't like this idea as it gets too crazy, too quickly. Examples:

dothis --verbose --visible

opt_get( march('v') )  # abiguous

This is probably bad practice

opt_strict

opt_strict stops execution if unknown flag is encountered. Like opt_help, it must be used after all option processing.

Help

Optiion Bundling

opt_unbundle

opt_unbundle should be a part of the style that gets called if it exists. It take commandArgs type array and expands the options.

% script -axe
opt_unbundle() # '-a -x -e'

Does this work on a string as well? Probably not, you probably just need it for the array version.

Syntax modifications

Create a function that will automatically produce the one-character option variant. Maybe, something like this.

"flag" %>% std_opt %>% get_opt

DO NOT, INTIALLY SUPPORT BUNDLING

If greedy is used ... we should warn about args.

== LESSER == * Make this compatible with RApache/Rook (why)

Completed

X Drop the 'coerce' argument from 'grabOpt' since it is no different from wrapping the call in an as.* function.

opt_fill (COMPLETE)

returns x (or ref to x) that is populated with options that are grabbed from the command line.



decisionpatterns/optigrab documentation built on Jan. 8, 2019, 3:28 a.m.