Commit 1445a8c9 authored by Yuanle Song's avatar Yuanle Song
Browse files

v1.3.0.0 add progress logging in rd client.

- use proper module name hierarchy.
parent 8630e878
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ Usage: rd-api [-h|--host HOST] [-p|--port PORT] [--redis-host REDIS_HOST]
  rd-api is an HTTP file server that provides static file hosting and reliable
  download api for rd client.
  
  rd-api serves files under web-root. You can use it like ```python3 -m http.server```
  rd-api serves files under web-root. You can use it like python3 -m http.server
  
  In addition, if rd command line tool is used to do the download, it will
  download in a reliable way by downloading in 2MiB blocks and verify checksum
@@ -57,7 +57,6 @@ Available options:
  -v,--verbose             show more debug message
  -V,--version             show program version and exit
  -h,--help                Show this help text

```

```
@@ -66,7 +65,8 @@ rd - reliable download client

Usage: rd [-r|--block-max-retry INT] [-k|--keep] [-l|--rolling-combine] 
          [-d|--temp-dir TEMP_DIR] [-o|--output-dir OUTPUT_DIR] 
          [-w|--worker INT] [-f|--force] [-v|--verbose] [-V|--version] [URL...]
          [-w|--worker INT] [-f|--force] [-i|--progress-interval N] 
          [-v|--verbose] [-V|--version] [URL...]
  Download large files across slow and unstable network reliably. Requires using
  rd-api on server side. For more information, see rd-api --help

@@ -76,13 +76,15 @@ Available options:
                           combined
  -l,--rolling-combine     delete each block data right after combine, conflict
                           with --keep
  -d,--temp-dir TEMP_DIR   the dir to keep block download
                           data (default: ".blocks")
  -d,--temp-dir TEMP_DIR   the dir to keep block download data
                           (default: ".blocks")
  -o,--output-dir OUTPUT_DIR
                           the dir to keep the final combined
                           file (default: ".")
                           the dir to keep the final combined file
                           (default: ".")
  -w,--worker INT          concurrent HTTP download worker (default: 5)
  -f,--force               overwrite exiting target file in OUTPUT_DIR
  -i,--progress-interval N how often to show download progress, in seconds
                           (default: 10)
  -v,--verbose             show more debug message
  -V,--version             show version number and exit
  -h,--help                Show this help text

cli-version/CliVersion.hs

deleted100644 → 0
+0 −4
Original line number Diff line number Diff line
module CliVersion (cliVersion) where

cliVersion :: String
cliVersion = "1.2.1.0"

lib/RD/CliVersion.hs

0 → 100644
+4 −0
Original line number Diff line number Diff line
module RD.CliVersion (cliVersion) where

cliVersion :: String
cliVersion = "1.3.0.0"
+2 −2
Original line number Diff line number Diff line
-- | Lib contains functions that is useful for current project.

module Lib
module RD.Lib
    ( sha1sum
    , sha1sumOnBytes
    , guessFilename
@@ -15,7 +15,7 @@ import qualified Data.ByteString.Lazy as LB
import Crypto.Hash (digestToHexByteString, hashlazy, Digest, SHA1)
import Formatting hiding (bytes)

import Type
import RD.Types

-- | convert byte number to MiB. small number will become 0.
humanReadableSize :: Integer -> T.Text
+1 −1
Original line number Diff line number Diff line
module Type where
module RD.Types where

import qualified Data.ByteString.Char8 as Char8
import qualified Data.ByteString as B
Loading