Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Jun 1, 2015
1 parent e651e3e commit 7dce8e7
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

all: README.md

README.md: README.Rmd
Rscript -e "library(knitr); knit('$<', output = '$@', quiet = TRUE)"
51 changes: 51 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

```{r, setup, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
comment = "#>",
tidy = FALSE,
error = FALSE)
```

# whoami

> Username, full name, email address, GitHub username of the current user
For the username it tries the `LOGNAME`, `USER`, `LNAME` and
`USERNAME` environment variables first. If these are all unset,
or set to an empty string, then it tries running `id` on Unix-like
systems and `whoami` on Windows.

For the full name of the user, it queries the system services and
also tries the user's global git configuration.

For the email address it users the user's global git configuration.

For the GitHub usename it searches on GitHub for the user's email
address.

Related JavaScript packages:
[sindresorhus/username](https://github.com/sindresorhus/username),
[sindresorhus/fullname](https://github.com/sindresorhus/fullname),
[sindresorhus/github-username](https://github.com/sindresorhus/github-username),
[paulirish/github-email](https://github.com/paulirish/github-email).

## Installation

```{r, eval = FALSE}
devtools::install_github("gaborcsardi/whoami")
```

## Usage

```{r}
library(whoami)
username()
fullname()
email_address()
gh_username()
whoami()
```

## License

MIT © [Gábor Csárdi](http://gaborcsardi.org)
84 changes: 84 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@




# whoami

> Username, full name, email address, GitHub username of the current user
For the username it tries the `LOGNAME`, `USER`, `LNAME` and
`USERNAME` environment variables first. If these are all unset,
or set to an empty string, then it tries running `id` on Unix-like
systems and `whoami` on Windows.

For the full name of the user, it queries the system services and
also tries the user's global git configuration.

For the email address it users the user's global git configuration.

For the GitHub usename it searches on GitHub for the user's email
address.

Related JavaScript packages:
[sindresorhus/username](https://github.com/sindresorhus/username),
[sindresorhus/fullname](https://github.com/sindresorhus/fullname),
[sindresorhus/github-username](https://github.com/sindresorhus/github-username),
[paulirish/github-email](https://github.com/paulirish/github-email).

## Installation


```r
devtools::install_github("gaborcsardi/whoami")
```

## Usage


```r
library(whoami)
username()
```

```
#> [1] "gaborcsardi"
```

```r
fullname()
```

```
#> [1] "Gabor Csardi"
```

```r
email_address()
```

```
#> [1] "csardi.gabor@gmail.com"
```

```r
gh_username()
```

```
#> [1] "gaborcsardi"
```

```r
whoami()
```

```
#> username fullname email_address
#> "gaborcsardi" "Gabor Csardi" "csardi.gabor@gmail.com"
#> gh_username
#> "gaborcsardi"
```

## License

MIT © [Gábor Csárdi](http://gaborcsardi.org)

0 comments on commit 7dce8e7

Please sign in to comment.