Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 14, 2015
0 parents commit f1756a3
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
.V8history
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.Rproj.user
.Rhistory
.RData
.V8history
*/.DS_Store
13 changes: 13 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Package: minimist
Type: Package
Title: Parse Argument Options
Version: 0.1
Date: 2015-02-14
Author: Jeroen Ooms, James Halliday
Maintainer: Jeroen Ooms <jeroen.ooms@stat.ucla.edu>
Description: A binding to the minimist JavaScript library. This module implements
the guts of optimist's argument parser without all the fanciful decoration.
License: MIT + file LICENSE
Imports: V8 (>= 0.5)
URL: https://github.com/jeroenooms/minimist, https://www.npmjs.com/package/minimist
BugReports: https://github.com/jeroenooms/minimist/issues
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2015
COPYRIGHT HOLDER: Jeroen Ooms
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by roxygen2 (4.1.0): do not edit by hand

export(minimist)
importFrom(V8,new_context)
16 changes: 16 additions & 0 deletions R/minimist.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#' Parse argument options
#'
#' This module is the guts of optimist's argument parser without all the fanciful
#' decoration.
#'
#' Parses a vector of strings (e.g. from \code{\link{commandArgs}}) into the proper key/value list.
#'
#' @export
#' @param args a character vector with arguments
#' @examples minimist()
#' minimist(c("-a", "beep", "-b", "boop"))
#' args = c("-x", "3", "-y", "4", "-n5", "-abc", "--beep=boop", "foo", "bar", "baz")
#' minimist(args)
minimist <- function(args = commandArgs()){
ct$call("minimist", as.list(args))
}
6 changes: 6 additions & 0 deletions R/onLoad.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#' @importFrom V8 new_context
ct <- NULL
.onLoad <- function(libname, pkgname){
ct <<- new_context();
ct$source(system.file("js/minimist.min.js", package = pkgname))
}
Binary file added inst/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions inst/js/minimist.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/minimist.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/minimist.R
\name{minimist}
\alias{minimist}
\title{Parse argument options}
\usage{
minimist(args = commandArgs())
}
\arguments{
\item{args}{a character vector with arguments}
}
\description{
This module is the guts of optimist's argument parser without all the fanciful
decoration.
}
\details{
Parses a vector of strings (e.g. from \code{\link{commandArgs}}) into the proper key/value list.
}
\examples{
minimist()
minimist(c("-a", "beep", "-b", "boop"))
args = c("-x", "3", "-y", "4", "-n5", "-abc", "--beep=boop", "foo", "bar", "baz")
minimist(args)
}
21 changes: 21 additions & 0 deletions minimist.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,namespace

0 comments on commit f1756a3

Please sign in to comment.