Skip to content

Commit

Permalink
Add (optional) conntectivity check to ciw.r, tweak display
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Mar 6, 2024
1 parent 5ab9c21 commit e94fe55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-03-06 Dirk Eddelbuettel <[email protected]>

* inst/examples/ciw.r: Add connectivity check, tweak lines display

2024-03-05 Dirk Eddelbuettel <[email protected]>

* inst/examples/tttf.r: Support devtools::load_all() option
Expand Down
12 changes: 6 additions & 6 deletions inst/examples/ciw.r
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ suppressMessages({
})

## configuration for docopt
doc <- "Usage: ciw.r [-h] [-x] [-a] [-m] [-i] [-t] [-p] [-w] [-r] [-s] [-n] [-u] [-l rows] [ARG...]
doc <- "Usage: ciw.r [-h] [-x] [-a] [-m] [-i] [-t] [-p] [-w] [-r] [-s] [-n] [-u] [-l rows] [-z] [ARG...]
-m --mega use 'mega' mode of all folders (see --usage)
-i --inspect visit 'inspect' folder
Expand All @@ -28,7 +28,8 @@ doc <- "Usage: ciw.r [-h] [-x] [-a] [-m] [-i] [-t] [-p] [-w] [-r] [-s] [-n] [-u]
-n --newbies visit 'newbies' folder
-u --publish visit 'publish' folder
-s --skipsort skip sorting of aggregate results by age
-l --lines rows print 'rows' rows of the data.table object [default: 50]
-l --lines rows print top 'rows' of the result object [default: 50]
-z --ping run the connectivity check first
-h --help show this help text
-x --usage show help and short example usage"
opt <- docopt(doc) # docopt parsing
Expand Down Expand Up @@ -67,8 +68,7 @@ if (length(args) == 0)

chk <- length(args) <= 1 # ask for argument check only on short argument vectoe

res <- incoming(args, chk, !opt$skipsort)
res <- incoming(args, chk, isFALSE(opt$skipsort), isTRUE(opt$ping))

options(datatable.print.nrows = as.numeric(opt$lines))

print(res[])
nr <- as.integer(opt$lines)
print(head(res, nr), nrows=nr)

0 comments on commit e94fe55

Please sign in to comment.