Procházet zdrojové kódy

Fix --backup-dir argument

simplify
Garrick Aden-Buie před 7 roky
rodič
revize
eb5ff2c3a9
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. +4
    -4
      inst/gathertweet.R

+ 4
- 4
inst/gathertweet.R Zobrazit soubor



Usage: Usage:
gathertweet search [--file=<file>] [options] [--] <terms>... gathertweet search [--file=<file>] [options] [--] <terms>...
gathertweet update [--file=<file> --token=<token> --backup --polite --debug-args]
gathertweet update [--file=<file> --token=<token> --backup --backup-dir=<dir> --polite --debug-args]


Arguments Arguments
<terms> Search terms. Individual search terms are queried separately, <terms> Search terms. Individual search terms are queried separately,
--quiet Disable printing of {rtweet} processing/retrieval messages --quiet Disable printing of {rtweet} processing/retrieval messages
--polite Only allow one process (search|update) to run at a time --polite Only allow one process (search|update) to run at a time
--backup Create a backup of existing tweet file before writing any new files --backup Create a backup of existing tweet file before writing any new files
--backup-dir <backup_dir> Location for backups, use "" for current directory. [default: backups]
--backup-dir <dir> Location for backups, use "" for current directory. [default: backups]
--debug-args Print values of the arguments only --debug-args Print values of the arguments only
' -> doc ' -> doc


tweets <- tweets[!duplicated(tweets$status_id), ] tweets <- tweets[!duplicated(tweets$status_id), ]


log_info("Gathered {nrow(tweets)} tweets") log_info("Gathered {nrow(tweets)} tweets")
if (args$backup) backup_tweets(args$file, backup_dir = args$backup_dir)
if (args$backup) backup_tweets(args$file, backup_dir = args[["backup-dir"]])
tweets <- save_tweets(tweets, args$file) tweets <- save_tweets(tweets, args$file)


log_info("Total of {nrow(tweets)} tweets in {args$file}") log_info("Total of {nrow(tweets)} tweets in {args$file}")
token = args$token token = args$token
) )
log_debug("Status lookup returned {nrow(tweets)} tweets") log_debug("Status lookup returned {nrow(tweets)} tweets")
if (args$backup) backup_tweets(args$file, backup_dir = args$backup_dir)
if (args$backup) backup_tweets(args$file, backup_dir = args[["backup-dir"]])
tweets <- save_tweets(tweets, args$file) tweets <- save_tweets(tweets, args$file)
log_debug("Total of {nrow(tweets)} tweets in {args$file}") log_debug("Total of {nrow(tweets)} tweets in {args$file}")
log_info("Tweet update complete") log_info("Tweet update complete")

Načítá se…
Zrušit
Uložit