diff --git a/dev/articles/ansi-benchmark.html b/dev/articles/ansi-benchmark.html index b2da6d52..f58fab48 100644 --- a/dev/articles/ansi-benchmark.html +++ b/dev/articles/ansi-benchmark.html @@ -76,7 +76,7 @@

ANSI function benchmarks

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source: vignettes/ansi-benchmark.Rmd
ansi-benchmark.Rmd
@@ -89,7 +89,7 @@

2024-09-19

$output function (x, options) { hook.t(x, options[[paste0(“attr.”, class)]], options[[paste0(“class.”, class)]]) } <bytecode: -0x55a9b4e4a828> <environment: 0x55a9b5851298>

+0x55f140f5be40> <environment: 0x55f1419628f0>

Introduction

@@ -148,9 +148,9 @@

#> # A tibble: 3 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 ansi         44.8µs   48.1µs    20216.    98.5KB     19.0
-#> 2 plain        44.5µs   48.1µs    20143.        0B     20.0
-#> 3 base         11.2µs   12.5µs    78243.    48.4KB     23.5
+#> 1 ansi 44.5µs 48µs 20158. 98.5KB 19.0 +#> 2 plain 44.1µs 47.6µs 20251. 0B 19.8 +#> 3 base 11.3µs 12.5µs 77769. 48.4KB 23.3
 bench::mark(
   ansi  = ansi_align(ansi, width = 20, align = "right"),
@@ -161,9 +161,9 @@ 

#> # A tibble: 3 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 ansi           46µs   49.6µs    19569.        0B     21.2
-#> 2 plain          46µs   49.6µs    19561.        0B     21.5
-#> 3 base         13.4µs   14.6µs    66301.        0B     26.5
+#> 1 ansi 46.2µs 50.1µs 19301. 0B 21.3 +#> 2 plain 45.7µs 49.6µs 19478. 0B 21.4 +#> 3 base 13.5µs 14.9µs 64831. 0B 19.5

@@ -179,9 +179,9 @@

#> # A tibble: 3 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 ansi       110.31µs  117.6µs     8286.   75.07KB     14.7
-#> 2 plain       88.27µs   93.2µs    10414.    8.73KB     14.7
-#> 3 base         1.85µs   2.01µs   476859.        0B      0
+#> 1 ansi 110.75µs 117.9µs 8232. 75.07KB 14.7 +#> 2 plain 88.45µs 93.5µs 10317. 8.73KB 12.5 +#> 3 base 1.85µs 2µs 479676. 0B 48.0

@@ -196,8 +196,8 @@

#> # A tibble: 2 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 ansi          337µs    360µs     2747.   33.17KB     19.2
-#> 2 plain         336µs    358µs     2768.    1.09KB     19.2
+#> 1 ansi 331µs 354µs 2800. 33.17KB 19.1 +#> 2 plain 330µs 353µs 2778. 1.09KB 19.2

@@ -222,18 +222,18 @@

#> # A tibble: 12 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi          5.43µs   5.94µs   162670.    8.02KB     32.5
-#>  2 fansi_ansi       29.47µs  32.78µs    29600.    4.18KB     23.7
-#>  3 cli_plain         5.39µs    5.9µs   163593.        0B     16.4
-#>  4 fansi_plain      29.45µs  32.54µs    29167.      688B     26.3
-#>  5 cli_vec_ansi      6.68µs   7.12µs   137148.      448B     13.7
-#>  6 fansi_vec_ansi   38.48µs  40.53µs    24047.    5.02KB     19.3
-#>  7 cli_vec_plain     7.24µs   7.62µs   128337.      448B     25.7
-#>  8 fansi_vec_plain  37.65µs  39.62µs    24586.    5.02KB     19.7
-#>  9 cli_txt_ansi      5.36µs    5.7µs   170372.        0B     34.1
-#> 10 fansi_txt_ansi   29.14µs  31.21µs    31169.      688B     25.0
-#> 11 cli_txt_plain      6.2µs   6.55µs   148660.        0B     14.9
-#> 12 fansi_txt_plain   37.7µs  39.98µs    24216.    5.02KB     19.4
+#> 1 cli_ansi 5.42µs 5.93µs 161544. 8.02KB 32.3 +#> 2 fansi_ansi 29.54µs 32.56µs 29890. 4.18KB 23.9 +#> 3 cli_plain 5.39µs 5.95µs 162465. 0B 16.2 +#> 4 fansi_plain 29.89µs 32.52µs 29926. 688B 27.0 +#> 5 cli_vec_ansi 6.75µs 7.17µs 135705. 448B 13.6 +#> 6 fansi_vec_ansi 39.44µs 41.6µs 23454. 5.02KB 18.8 +#> 7 cli_vec_plain 7.27µs 7.72µs 126735. 448B 25.4 +#> 8 fansi_vec_plain 38.3µs 40.52µs 23971. 5.02KB 19.2 +#> 9 cli_txt_ansi 5.4µs 5.81µs 168122. 0B 33.6 +#> 10 fansi_txt_ansi 29.97µs 32.11µs 30222. 688B 21.2 +#> 11 cli_txt_plain 6.19µs 6.63µs 146776. 0B 29.4 +#> 12 fansi_txt_plain 38.28µs 40.65µs 23733. 5.02KB 19.0

@@ -249,8 +249,8 @@

#> # A tibble: 2 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 cli          65.5µs   67.1µs    14648.    28.8KB     6.10
-#> 2 fansi       121.5µs  124.9µs     7880.    55.3KB     8.20
+#> 1 cli 66µs 67.5µs 14552. 28.8KB 6.10 +#> 2 fansi 122µs 125.4µs 7818. 55.3KB 8.20

@@ -281,24 +281,24 @@

#> # A tibble: 18 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi           6.5µs   7.06µs   137564.        0B    13.8 
-#>  2 fansi_ansi       89.79µs  94.07µs    10372.   31.85KB    16.7 
-#>  3 base_ansi       852.04ns 901.99ns  1037868.        0B   104.  
-#>  4 cli_plain         6.46µs   7.01µs   139185.        0B    13.9 
-#>  5 fansi_plain      89.03µs  94.27µs    10353.      688B    16.8 
-#>  6 base_plain      782.08ns 831.09ns  1108880.        0B   111.  
-#>  7 cli_vec_ansi     27.77µs  28.86µs    34033.      448B     3.40
-#>  8 fansi_vec_ansi  109.44µs 114.28µs     8531.    5.02KB    14.7 
-#>  9 base_vec_ansi     14.8µs  14.87µs    66383.      448B     0   
-#> 10 cli_vec_plain     26.3µs   27.1µs    35870.      448B     7.18
-#> 11 fansi_vec_plain 100.43µs 105.09µs     9259.    5.02KB    14.7 
-#> 12 base_vec_plain     8.1µs   8.18µs   120435.      448B     0   
-#> 13 cli_txt_ansi     28.06µs  28.72µs    34260.        0B     6.85
-#> 14 fansi_txt_ansi  101.51µs 106.27µs     9174.      688B    14.6 
-#> 15 base_txt_ansi    14.26µs  14.32µs    68916.        0B     0   
-#> 16 cli_txt_plain    25.93µs  26.55µs    36864.        0B     7.37
-#> 17 fansi_txt_plain  91.45µs  96.41µs    10113.      688B    16.7 
-#> 18 base_txt_plain    8.39µs   8.91µs   112390.        0B     0
+#> 1 cli_ansi 6.5µs 7.04µs 138584. 0B 13.9 +#> 2 fansi_ansi 90.82µs 96.16µs 10118. 31.85KB 16.8 +#> 3 base_ansi 852.04ns 932.02ns 865496. 0B 0 +#> 4 cli_plain 6.41µs 7.04µs 138251. 0B 27.7 +#> 5 fansi_plain 90.83µs 95.59µs 10180. 688B 16.9 +#> 6 base_plain 772.07ns 821.08ns 1138145. 0B 0 +#> 7 cli_vec_ansi 28.17µs 29.55µs 32967. 448B 6.59 +#> 8 fansi_vec_ansi 111.39µs 116.98µs 8281. 5.02KB 12.5 +#> 9 base_vec_ansi 14.8µs 14.86µs 66228. 448B 0 +#> 10 cli_vec_plain 26.28µs 27.22µs 35838. 448B 7.17 +#> 11 fansi_vec_plain 101.69µs 106.54µs 9064. 5.02KB 14.7 +#> 12 base_vec_plain 8.11µs 8.17µs 120064. 448B 0 +#> 13 cli_txt_ansi 28.07µs 29.06µs 33396. 0B 6.68 +#> 14 fansi_txt_ansi 102.76µs 108.5µs 8931. 688B 14.6 +#> 15 base_txt_ansi 14.26µs 14.31µs 68774. 0B 0 +#> 16 cli_txt_plain 25.91µs 26.67µs 36624. 0B 7.33 +#> 17 fansi_txt_plain 93.39µs 99.61µs 9716. 688B 14.7 +#> 18 base_txt_plain 8.39µs 8.92µs 109862. 0B 0
 bench::mark(
   cli_ansi        = ansi_nchar(ansi, type = "width"),
@@ -324,24 +324,24 @@ 

#> # A tibble: 18 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi          8.05µs    8.9µs   109054.        0B    32.7 
-#>  2 fansi_ansi       90.14µs  94.72µs    10295.      688B    16.7 
-#>  3 base_ansi         1.18µs   1.22µs   777520.        0B     0   
-#>  4 cli_plain         8.02µs   8.66µs   112638.        0B    22.5 
-#>  5 fansi_plain      89.99µs   94.6µs    10289.      688B    16.8 
-#>  6 base_plain      971.02ns   1.01µs   924743.        0B     0   
-#>  7 cli_vec_ansi     33.91µs  34.67µs    28357.      448B     8.51
-#>  8 fansi_vec_ansi  117.25µs 121.53µs     8025.    5.02KB    12.5 
-#>  9 base_vec_ansi    41.75µs  42.49µs    23311.      448B     0   
-#> 10 cli_vec_plain    32.93µs  33.63µs    29261.      448B     5.85
-#> 11 fansi_vec_plain  106.6µs 110.84µs     8798.    5.02KB    14.6 
-#> 12 base_vec_plain   21.36µs  21.54µs    45852.      448B     0   
-#> 13 cli_txt_ansi     34.22µs  34.85µs    28222.        0B     5.65
-#> 14 fansi_txt_ansi   107.6µs 112.86µs     8637.      688B    14.6 
-#> 15 base_txt_ansi    44.92µs  45.12µs    21890.        0B     0   
-#> 16 cli_txt_plain    32.65µs  33.35µs    29505.        0B     5.90
-#> 17 fansi_txt_plain  97.54µs 102.39µs     9537.      688B    16.7 
-#> 18 base_txt_plain   23.93µs  24.14µs    40963.        0B     0
+#> 1 cli_ansi 8.12µs 8.94µs 108004. 0B 21.6 +#> 2 fansi_ansi 92.26µs 98.13µs 9828. 688B 16.9 +#> 3 base_ansi 1.18µs 1.22µs 761723. 0B 0 +#> 4 cli_plain 8.11µs 9.01µs 94088. 0B 18.8 +#> 5 fansi_plain 92.01µs 98.13µs 9861. 688B 16.9 +#> 6 base_plain 961.01ns 1µs 933818. 0B 0 +#> 7 cli_vec_ansi 33.88µs 34.84µs 28098. 448B 5.62 +#> 8 fansi_vec_ansi 118.55µs 125.3µs 7737. 5.02KB 12.0 +#> 9 base_vec_ansi 41.73µs 42.53µs 23167. 448B 2.32 +#> 10 cli_vec_plain 33µs 33.93µs 28922. 448B 5.79 +#> 11 fansi_vec_plain 107.92µs 113.97µs 8499. 5.02KB 12.5 +#> 12 base_vec_plain 21.36µs 21.55µs 45771. 448B 4.58 +#> 13 cli_txt_ansi 34.22µs 34.94µs 28097. 0B 5.62 +#> 14 fansi_txt_ansi 108.83µs 113.47µs 8582. 688B 12.4 +#> 15 base_txt_ansi 43.82µs 45.01µs 21929. 0B 2.19 +#> 16 cli_txt_plain 32.59µs 33.37µs 29420. 0B 5.89 +#> 17 fansi_txt_plain 97.74µs 103.44µs 9416. 688B 14.6 +#> 18 base_txt_plain 23.93µs 24.14µs 40842. 0B 0

@@ -361,12 +361,12 @@

#> # A tibble: 6 × 6
 #>   expression         min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr>    <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 cli_ansi        6.54µs   7.05µs   138018.        0B    27.6 
-#> 2 cli_plain       5.98µs   6.48µs   150248.        0B    15.0 
-#> 3 cli_vec_ansi   39.34µs  40.49µs    24313.      848B     4.86
-#> 4 cli_vec_plain   9.94µs  10.51µs    93042.      848B    18.6 
-#> 5 cli_txt_ansi   37.36µs  38.67µs    25448.        0B     2.55
-#> 6 cli_txt_plain   6.82µs   7.32µs   133171.        0B    26.6
+#> 1 cli_ansi 6.38µs 7.01µs 138661. 0B 13.9 +#> 2 cli_plain 5.95µs 6.45µs 150799. 0B 30.2 +#> 3 cli_vec_ansi 39.62µs 40.58µs 24120. 848B 2.41 +#> 4 cli_vec_plain 9.86µs 10.4µs 93939. 848B 18.8 +#> 5 cli_txt_ansi 37.33µs 38.6µs 25404. 0B 2.54 +#> 6 cli_txt_plain 6.76µs 7.3µs 133308. 0B 26.7

@@ -391,18 +391,18 @@

#> # A tibble: 12 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi          11.3µs     12µs    81379.        0B     24.4
-#>  2 fansi_ansi        27.6µs   29.2µs    32970.      688B     26.4
-#>  3 cli_plain         11.1µs   11.8µs    82576.        0B     24.8
-#>  4 fansi_plain         27µs   28.8µs    33811.      688B     27.1
-#>  5 cli_vec_ansi      19.8µs   20.7µs    47376.      848B     14.2
-#>  6 fansi_vec_ansi    52.5µs   54.7µs    17862.    5.41KB     12.6
-#>  7 cli_vec_plain     13.8µs   14.6µs    67055.      848B     20.1
-#>  8 fansi_vec_plain   35.9µs   37.9µs    25722.    4.59KB     20.6
-#>  9 cli_txt_ansi      19.6µs   20.3µs    47050.        0B     14.1
-#> 10 fansi_txt_ansi      43µs   44.9µs    21685.    5.12KB     17.4
-#> 11 cli_txt_plain     11.9µs   12.6µs    77481.        0B     23.3
-#> 12 fansi_txt_plain   27.8µs   29.8µs    32618.      688B     26.1
+#> 1 cli_ansi 11.3µs 11.9µs 81439. 0B 32.6 +#> 2 fansi_ansi 27.3µs 29.2µs 33190. 688B 23.2 +#> 3 cli_plain 11.1µs 11.7µs 83228. 0B 25.0 +#> 4 fansi_plain 27µs 28.8µs 33495. 688B 26.8 +#> 5 cli_vec_ansi 20µs 21.1µs 46162. 848B 13.9 +#> 6 fansi_vec_ansi 52.8µs 55.4µs 17598. 5.41KB 12.6 +#> 7 cli_vec_plain 13.6µs 14.8µs 65802. 848B 26.3 +#> 8 fansi_vec_plain 36µs 38.1µs 25459. 4.59KB 17.8 +#> 9 cli_txt_ansi 19.5µs 20.4µs 47919. 0B 14.4 +#> 10 fansi_txt_ansi 43.2µs 45.5µs 21332. 5.12KB 17.1 +#> 11 cli_txt_plain 11.9µs 12.7µs 76627. 0B 23.0 +#> 12 fansi_txt_plain 28.5µs 30.3µs 31929. 688B 25.6

@@ -433,24 +433,24 @@

#> # A tibble: 18 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi        145.77µs  151.5µs     6430.  103.31KB    16.8 
-#>  2 fansi_ansi      124.86µs 131.88µs     7401.  102.13KB    22.1 
-#>  3 base_ansi         3.96µs   4.32µs   226461.      224B     0   
-#>  4 cli_plain       144.01µs 149.83µs     6492.    8.09KB    19.0 
-#>  5 fansi_plain     122.85µs    129µs     7594.    9.62KB    19.0 
-#>  6 base_plain        3.57µs   3.79µs   256633.        0B    25.7 
-#>  7 cli_vec_ansi      7.46ms   7.62ms      131.  823.77KB    25.3 
-#>  8 fansi_vec_ansi    1.05ms   1.08ms      898.  846.81KB    17.3 
-#>  9 base_vec_ansi   155.34µs 163.92µs     5965.    22.7KB     4.12
-#> 10 cli_vec_plain     7.38ms   7.56ms      132.  823.77KB    25.4 
-#> 11 fansi_vec_plain 985.73µs   1.03ms      954.  845.98KB    19.8 
-#> 12 base_vec_plain  113.48µs 116.28µs     8475.      848B     2.02
-#> 13 cli_txt_ansi      3.31ms   3.58ms      278.    63.6KB     2.03
-#> 14 fansi_txt_ansi    1.54ms   1.56ms      640.   35.05KB     2.05
-#> 15 base_txt_ansi   135.62µs 138.18µs     7150.   18.47KB     2.01
-#> 16 cli_txt_plain     2.41ms   2.69ms      374.    63.6KB     0   
-#> 17 fansi_txt_plain 515.39µs 538.71µs     1837.    30.6KB     4.07
-#> 18 base_txt_plain   89.87µs  91.56µs    10768.   11.05KB     4.03
+#> 1 cli_ansi 148.04µs 155.53µs 6211. 103.31KB 16.8 +#> 2 fansi_ansi 126.83µs 134.37µs 7176. 102.13KB 19.1 +#> 3 base_ansi 3.97µs 4.38µs 223119. 224B 22.3 +#> 4 cli_plain 144.54µs 152.28µs 6371. 8.09KB 17.3 +#> 5 fansi_plain 124.48µs 132.04µs 7382. 9.62KB 19.1 +#> 6 base_plain 3.45µs 3.71µs 260968. 0B 26.1 +#> 7 cli_vec_ansi 7.52ms 7.75ms 128. 823.77KB 25.2 +#> 8 fansi_vec_ansi 1.05ms 1.1ms 885. 846.81KB 17.4 +#> 9 base_vec_ansi 156.25µs 162.49µs 6042. 22.7KB 2.04 +#> 10 cli_vec_plain 7.44ms 7.67ms 130. 823.77KB 26.0 +#> 11 fansi_vec_plain 1ms 1.05ms 930. 845.98KB 19.8 +#> 12 base_vec_plain 111.42µs 115.8µs 8476. 848B 2.01 +#> 13 cli_txt_ansi 3.31ms 3.36ms 297. 63.6KB 2.02 +#> 14 fansi_txt_ansi 1.54ms 1.56ms 638. 35.05KB 0 +#> 15 base_txt_ansi 136.61µs 147.68µs 6687. 18.47KB 2.03 +#> 16 cli_txt_plain 2.45ms 2.47ms 400. 63.6KB 0 +#> 17 fansi_txt_plain 524.43µs 553.03µs 1800. 30.6KB 6.18 +#> 18 base_txt_plain 90.78µs 92.74µs 10530. 11.05KB 2.02

@@ -481,24 +481,24 @@

#> # A tibble: 18 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi         96.12µs 101.34µs     9514.   32.23KB    21.2 
-#>  2 fansi_ansi       52.86µs   56.5µs    17117.   31.43KB    23.5 
-#>  3 base_ansi       991.04ns   1.04µs   908669.     4.2KB     0   
-#>  4 cli_plain        94.02µs  98.36µs     9843.        0B    21.2 
-#>  5 fansi_plain      52.29µs  55.91µs    17320.      872B    23.5 
-#>  6 base_plain      932.14ns 973.12ns   972295.        0B     0   
-#>  7 cli_vec_ansi    231.76µs 240.74µs     4055.   16.73KB     8.26
-#>  8 fansi_vec_ansi  123.76µs 128.74µs     7596.    5.59KB    12.5 
-#>  9 base_vec_ansi    35.27µs  36.62µs    27155.      848B     0   
-#> 10 cli_vec_plain   177.19µs 183.97µs     5324.   16.73KB    10.4 
-#> 11 fansi_vec_plain 116.21µs 119.78µs     8118.    5.59KB    12.0 
-#> 12 base_vec_plain   30.78µs  31.01µs    31908.      848B     3.19
-#> 13 cli_txt_ansi    102.88µs 107.03µs     9129.        0B    18.9 
-#> 14 fansi_txt_ansi   51.81µs  55.02µs    17737.      872B    23.5 
-#> 15 base_txt_ansi     1.03µs   1.07µs   882716.        0B     0   
-#> 16 cli_txt_plain    93.95µs  98.14µs     9965.        0B    23.3 
-#> 17 fansi_txt_plain  51.78µs  55.22µs    17720.      872B    23.3 
-#> 18 base_txt_plain  962.06ns   1.01µs   948472.        0B     0
+#> 1 cli_ansi 97.3µs 103.38µs 9312. 32.23KB 21.6 +#> 2 fansi_ansi 53.11µs 57.19µs 16822. 31.43KB 21.3 +#> 3 base_ansi 991.04ns 1.04µs 912275. 4.2KB 0 +#> 4 cli_plain 94.91µs 99.98µs 9629. 0B 21.2 +#> 5 fansi_plain 53.36µs 57.33µs 16701. 872B 21.3 +#> 6 base_plain 932.14ns 1.02µs 882828. 0B 88.3 +#> 7 cli_vec_ansi 234.35µs 243.5µs 4027. 16.73KB 8.29 +#> 8 fansi_vec_ansi 122.99µs 128µs 7615. 5.59KB 10.4 +#> 9 base_vec_ansi 35.22µs 35.63µs 27627. 848B 2.76 +#> 10 cli_vec_plain 177.49µs 185.49µs 5275. 16.73KB 10.4 +#> 11 fansi_vec_plain 117.4µs 122.45µs 7944. 5.59KB 12.6 +#> 12 base_vec_plain 30.76µs 30.99µs 31928. 848B 0 +#> 13 cli_txt_ansi 103.87µs 109.33µs 8918. 0B 19.5 +#> 14 fansi_txt_ansi 52.93µs 56.05µs 17344. 872B 23.6 +#> 15 base_txt_ansi 1.03µs 1.07µs 890273. 0B 0 +#> 16 cli_txt_plain 94.55µs 99.78µs 9746. 0B 21.2 +#> 17 fansi_txt_plain 51.62µs 55.6µs 17155. 872B 21.3 +#> 18 base_txt_plain 952.04ns 1µs 934697. 0B 93.5

@@ -531,24 +531,24 @@

#> # A tibble: 18 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi        320.18µs 334.16µs    2958.   266.59KB     19.0
-#>  2 fansi_ansi       96.37µs 102.85µs    9416.    10.29KB     21.3
-#>  3 base_ansi        36.89µs  38.98µs   24770.         0B     19.8
-#>  4 cli_plain       198.11µs 206.47µs    4688.         0B     19.0
-#>  5 fansi_plain      94.67µs 101.08µs    9632.       872B     21.2
-#>  6 base_plain       30.55µs  32.35µs   29710.         0B     20.8
-#>  7 cli_vec_ansi     33.47ms   33.6ms      29.6    2.48KB     53.3
-#>  8 fansi_vec_ansi  240.79µs  249.3µs    3951.     7.25KB     10.3
-#>  9 base_vec_ansi     2.17ms   2.27ms     440.    48.18KB     26.0
-#> 10 cli_vec_plain     20.4ms  20.62ms      48.5    2.48KB     29.1
-#> 11 fansi_vec_plain 200.34µs 206.77µs    4770.     6.42KB     12.5
-#> 12 base_vec_plain     1.6ms   1.65ms     603.     47.4KB     24.5
-#> 13 cli_txt_ansi     23.11ms  23.21ms      42.9  507.59KB     10.1
-#> 14 fansi_txt_ansi  227.49µs 234.79µs    4182.     6.77KB     10.3
-#> 15 base_txt_ansi     2.05ms   2.08ms     474.   582.06KB     13.3
-#> 16 cli_txt_plain     1.64ms   1.67ms     594.   369.84KB     10.8
-#> 17 fansi_txt_plain 179.65µs 188.17µs    5129.     2.51KB     12.5
-#> 18 base_txt_plain    1.31ms   1.34ms     733.   367.31KB     13.1
+#> 1 cli_ansi 313.79µs 331.89µs 2947. 266.59KB 21.3 +#> 2 fansi_ansi 96.04µs 102.76µs 9359. 10.29KB 19.0 +#> 3 base_ansi 36.05µs 38.52µs 24923. 0B 22.5 +#> 4 cli_plain 195.73µs 205.17µs 4726. 0B 16.8 +#> 5 fansi_plain 94.4µs 101.67µs 9475. 872B 21.3 +#> 6 base_plain 29.82µs 31.75µs 30190. 0B 21.1 +#> 7 cli_vec_ansi 33.31ms 33.68ms 29.3 2.48KB 52.8 +#> 8 fansi_vec_ansi 240.07µs 250.11µs 3908. 7.25KB 10.4 +#> 9 base_vec_ansi 2.19ms 2.27ms 436. 48.18KB 25.0 +#> 10 cli_vec_plain 20.04ms 20.72ms 48.0 2.48KB 32.0 +#> 11 fansi_vec_plain 199.75µs 206.29µs 4774. 6.42KB 12.5 +#> 12 base_vec_plain 1.58ms 1.62ms 614. 47.4KB 24.2 +#> 13 cli_txt_ansi 22.94ms 23.39ms 42.7 507.59KB 13.3 +#> 14 fansi_txt_ansi 227.28µs 235.68µs 4162. 6.77KB 8.21 +#> 15 base_txt_ansi 2.05ms 2.08ms 477. 582.06KB 13.2 +#> 16 cli_txt_plain 1.64ms 1.68ms 592. 369.84KB 10.8 +#> 17 fansi_txt_plain 180.62µs 187.87µs 5227. 2.51KB 12.5 +#> 18 base_txt_plain 1.31ms 1.33ms 742. 367.31KB 13.1

@@ -579,24 +579,24 @@

#> # A tibble: 18 × 6
 #>    expression           min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi          6.19µs   6.74µs   143029.   23.82KB    28.6 
-#>  2 fansi_ansi       75.71µs  80.98µs    12024.   28.48KB    21.3 
-#>  3 base_ansi       961.01ns      1µs   919766.        0B    92.0 
-#>  4 cli_plain         6.03µs   6.53µs   148235.        0B    29.7 
-#>  5 fansi_plain      75.82µs   80.7µs    12068.    1.98KB    21.3 
-#>  6 base_plain      912.11ns 972.07ns   969238.        0B     0   
-#>  7 cli_vec_ansi     26.51µs  27.83µs    35194.     1.7KB     7.04
-#>  8 fansi_vec_ansi  112.13µs 117.32µs     8259.    8.86KB    14.8 
-#>  9 base_vec_ansi     5.83µs   6.01µs   161782.      848B    16.2 
-#> 10 cli_vec_plain    22.39µs   23.8µs    41218.     1.7KB     8.25
-#> 11 fansi_vec_plain 106.63µs 111.46µs     8727.    8.86KB    14.8 
-#> 12 base_vec_plain    5.45µs   5.66µs   171162.      848B     0   
-#> 13 cli_txt_ansi      6.09µs   6.63µs   144852.        0B    43.5 
-#> 14 fansi_txt_ansi   76.14µs  81.08µs    12008.    1.98KB    21.2 
-#> 15 base_txt_ansi     5.12µs   5.18µs   174804.        0B     0   
-#> 16 cli_txt_plain     6.84µs   7.41µs   129506.        0B    25.9 
-#> 17 fansi_txt_plain  75.14µs  80.26µs    12165.    1.98KB    22.1 
-#> 18 base_txt_plain    3.34µs   3.39µs   286102.        0B     0
+#> 1 cli_ansi 6.23µs 6.75µs 142670. 23.82KB 42.8 +#> 2 fansi_ansi 75.79µs 81.2µs 11945. 28.48KB 19.1 +#> 3 base_ansi 961.94ns 1.01µs 918560. 0B 91.9 +#> 4 cli_plain 6.15µs 6.66µs 145773. 0B 29.2 +#> 5 fansi_plain 75.49µs 80.73µs 12000. 1.98KB 21.3 +#> 6 base_plain 922.13ns 972.07ns 965472. 0B 0 +#> 7 cli_vec_ansi 26.55µs 27.64µs 35513. 1.7KB 7.10 +#> 8 fansi_vec_ansi 113.97µs 118.99µs 8171. 8.86KB 14.8 +#> 9 base_vec_ansi 5.72µs 6µs 162504. 848B 16.3 +#> 10 cli_vec_plain 22.36µs 23.61µs 41583. 1.7KB 8.32 +#> 11 fansi_vec_plain 107.73µs 112.84µs 8629. 8.86KB 14.8 +#> 12 base_vec_plain 5.4µs 5.68µs 172178. 848B 0 +#> 13 cli_txt_ansi 6.18µs 6.76µs 142942. 0B 28.6 +#> 14 fansi_txt_ansi 76.25µs 81.27µs 11937. 1.98KB 21.4 +#> 15 base_txt_ansi 5.12µs 5.18µs 188160. 0B 18.8 +#> 16 cli_txt_plain 6.98µs 7.54µs 128426. 0B 25.7 +#> 17 fansi_txt_plain 76.15µs 80.7µs 12043. 1.98KB 21.3 +#> 18 base_txt_plain 3.36µs 3.42µs 285380. 0B 0

@@ -621,18 +621,18 @@

#> # A tibble: 12 × 6
 #>    expression          min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>     <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi       103.42µs 107.61µs    9038.    11.88KB    16.9 
-#>  2 base_ansi        1.32µs   1.36µs  710841.         0B     0   
-#>  3 cli_plain       83.77µs  87.13µs   11149.     8.73KB    14.6 
-#>  4 base_plain          1µs   1.04µs  934392.         0B     0   
-#>  5 cli_vec_ansi     3.99ms   4.09ms     244.   838.77KB    29.0 
-#>  6 base_vec_ansi   77.98µs   78.8µs   12561.       848B     0   
-#>  7 cli_vec_plain    2.23ms   2.29ms     431.    816.9KB    30.4 
-#>  8 base_vec_plain  47.07µs  47.91µs   20644.       848B     0   
-#>  9 cli_txt_ansi    12.94ms  13.04ms      76.0  114.42KB     6.52
-#> 10 base_txt_ansi   78.87µs  79.22µs   12485.         0B     0   
-#> 11 cli_txt_plain  251.74µs 260.84µs    3760.    18.16KB     6.12
-#> 12 base_txt_plain  44.43µs   44.7µs   22015.         0B     0
+#> 1 cli_ansi 103.18µs 107.85µs 8963. 11.88KB 17.2 +#> 2 base_ansi 1.32µs 1.36µs 714085. 0B 0 +#> 3 cli_plain 83.2µs 86.88µs 11177. 8.73KB 14.6 +#> 4 base_plain 1µs 1.04µs 920968. 0B 0 +#> 5 cli_vec_ansi 3.94ms 4.04ms 246. 838.77KB 28.7 +#> 6 base_vec_ansi 78.05µs 78.73µs 12566. 848B 0 +#> 7 cli_vec_plain 2.25ms 2.3ms 432. 816.9KB 27.4 +#> 8 base_vec_plain 46.97µs 47.77µs 20665. 848B 0 +#> 9 cli_txt_ansi 13.02ms 13.13ms 75.8 114.42KB 6.50 +#> 10 base_txt_ansi 78.67µs 79.12µs 12385. 0B 0 +#> 11 cli_txt_plain 252.01µs 259.81µs 3745. 18.16KB 6.12 +#> 12 base_txt_plain 44.78µs 45.13µs 21836. 0B 0

@@ -657,18 +657,18 @@

#> # A tibble: 12 × 6
 #>    expression          min   median `itr/sec` mem_alloc `gc/sec`
 #>    <bch:expr>     <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#>  1 cli_ansi           72µs   76.3µs    12466.        0B    21.1 
-#>  2 base_ansi        15.8µs   17.2µs    56540.        0B    22.6 
-#>  3 cli_plain        70.3µs   74.2µs    13034.        0B    21.1 
-#>  4 base_plain       16.1µs   17.2µs    56572.        0B    22.6 
-#>  5 cli_vec_ansi    154.4µs    162µs     6000.     7.2KB    10.3 
-#>  6 base_vec_ansi    54.2µs   59.1µs    16587.    1.66KB     6.12
-#>  7 cli_vec_plain   142.2µs  149.6µs     6533.     7.2KB    10.4 
-#>  8 base_vec_plain   47.2µs   52.1µs    18763.    1.66KB     6.12
-#>  9 cli_txt_ansi    137.2µs  141.6µs     6835.        0B    12.4 
-#> 10 base_txt_ansi    37.7µs   38.9µs    25127.        0B     7.54
-#> 11 cli_txt_plain   121.3µs  125.7µs     7740.        0B    12.5 
-#> 12 base_txt_plain   32.9µs   34.1µs    28627.        0B    11.5
+#> 1 cli_ansi 72.1µs 77.3µs 12375. 0B 21.2 +#> 2 base_ansi 16.3µs 17.4µs 55502. 0B 22.2 +#> 3 cli_plain 71.7µs 76.2µs 12363. 0B 18.9 +#> 4 base_plain 16.2µs 17.3µs 55674. 0B 22.3 +#> 5 cli_vec_ansi 156.3µs 164.9µs 5925. 7.2KB 10.4 +#> 6 base_vec_ansi 55.1µs 59.8µs 16387. 1.66KB 6.12 +#> 7 cli_vec_plain 143µs 151.4µs 6460. 7.2KB 10.3 +#> 8 base_vec_plain 48.6µs 53.5µs 18098. 1.66KB 6.14 +#> 9 cli_txt_ansi 137.2µs 142µs 6862. 0B 12.4 +#> 10 base_txt_ansi 38.3µs 39.8µs 24530. 0B 7.36 +#> 11 cli_txt_plain 121.6µs 126.4µs 7683. 0B 12.4 +#> 12 base_txt_plain 32.9µs 34.2µs 28525. 0B 11.4

@@ -691,12 +691,12 @@

#> # A tibble: 6 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 cli          7.86µs   8.54µs   113596.    12.3KB    22.7 
-#> 2 base       842.03ns 901.99ns  1045080.        0B     0   
-#> 3 cli_vec     24.28µs  25.16µs    38948.      448B     7.79
-#> 4 base_vec     11.7µs  11.97µs    82185.      448B     0   
-#> 5 cli_txt     24.93µs   25.7µs    38120.        0B    11.4 
-#> 6 base_txt    12.78µs  12.86µs    76649.        0B     0
+#> 1 cli 7.92µs 8.66µs 110674. 12.3KB 33.2 +#> 2 base 840.98ns 891.16ns 1055676. 0B 0 +#> 3 cli_vec 24.35µs 25.25µs 38799. 448B 7.76 +#> 4 base_vec 11.76µs 12µs 82182. 448B 0 +#> 5 cli_txt 24.92µs 25.83µs 37716. 0B 7.54 +#> 6 base_txt 12.79µs 12.89µs 76262. 0B 7.63
 bench::mark(
   cli        = utf8_nchar(uni, type = "width"),
@@ -710,12 +710,12 @@ 

#> # A tibble: 6 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 cli          7.84µs   8.52µs   113429.        0B    22.7 
-#> 2 base         1.23µs    1.3µs   719909.        0B    72.0 
-#> 3 cli_vec     28.64µs  29.61µs    33178.      448B     6.64
-#> 4 base_vec    45.34µs  48.31µs    20748.      448B     0   
-#> 5 cli_txt     30.02µs  30.74µs    31988.        0B     6.40
-#> 6 base_txt    83.55µs  85.62µs    11573.        0B     0
+#> 1 cli 7.87µs 8.55µs 112784. 0B 22.6 +#> 2 base 1.22µs 1.28µs 734707. 0B 0 +#> 3 cli_vec 28.71µs 29.65µs 33034. 448B 9.91 +#> 4 base_vec 46.69µs 49.06µs 20206. 448B 0 +#> 5 cli_txt 30µs 30.9µs 31714. 0B 6.34 +#> 6 base_txt 81.37µs 84.66µs 11708. 0B 0

 bench::mark(
   cli        = utf8_nchar(uni, type = "codepoints"),
@@ -729,12 +729,12 @@ 

#> # A tibble: 6 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 cli          8.35µs    9.1µs   107290.        0B     21.5
-#> 2 base          851ns    902ns  1046810.        0B      0  
-#> 3 cli_vec     19.84µs   20.5µs    47894.      448B     14.4
-#> 4 base_vec    11.64µs     12µs    82206.      448B      0  
-#> 5 cli_txt     20.48µs   21.1µs    46558.        0B     14.0
-#> 6 base_txt    12.78µs   12.8µs    76776.        0B      0
+#> 1 cli 8.66µs 9.35µs 103823. 0B 20.8 +#> 2 base 842.03ns 902.1ns 1031247. 0B 0 +#> 3 cli_vec 20µs 20.78µs 47018. 448B 14.1 +#> 4 base_vec 11.76µs 12.02µs 82120. 448B 0 +#> 5 cli_txt 20.59µs 21.44µs 45644. 0B 9.13 +#> 6 base_txt 12.78µs 12.94µs 74926. 0B 7.49

@@ -753,12 +753,12 @@

#> # A tibble: 6 × 6
 #>   expression      min   median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
-#> 1 cli          5.76µs   6.12µs   158909.    21.1KB    31.8 
-#> 2 base       980.92ns   1.02µs   929060.        0B    92.9 
-#> 3 cli_vec     29.32µs  30.04µs    32762.     1.7KB     6.55
-#> 4 base_vec     7.66µs   7.86µs   124779.      848B     0   
-#> 5 cli_txt      5.79µs   6.16µs   158403.        0B    31.7 
-#> 6 base_txt     5.84µs    5.9µs   166578.        0B    16.7
+#> 1 cli 5.69µs 6.18µs 153181. 21.1KB 30.6 +#> 2 base 971.02ns 1.03µs 909236. 0B 90.9 +#> 3 cli_vec 29.5µs 30.36µs 32292. 1.7KB 6.46 +#> 4 base_vec 7.66µs 7.87µs 124974. 848B 0 +#> 5 cli_txt 5.77µs 6.33µs 146777. 0B 29.4 +#> 6 base_txt 5.85µs 5.91µs 165588. 0B 16.6

@@ -776,7 +776,7 @@

Session info#> collate C.UTF-8 #> ctype C.UTF-8 #> tz UTC -#> date 2024-09-19 +#> date 2024-10-03 #> pandoc 3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/ (via rmarkdown) #> #> ─ Packages ───────────────────────────────────────────────────────────── @@ -784,7 +784,7 @@

Session info#> bench 1.1.3 2023-05-04 [1] RSPM #> bslib 0.8.0 2024-07-29 [1] RSPM #> cachem 1.1.0 2024-05-16 [1] RSPM -#> cli * 3.6.3.9000 2024-09-19 [1] local +#> cli * 3.6.3.9000 2024-10-03 [1] local #> codetools 0.2-20 2024-03-31 [3] CRAN (R 4.4.1) #> desc 1.4.3 2023-12-10 [1] RSPM #> digest 0.6.37 2024-08-19 [1] RSPM @@ -792,11 +792,11 @@

Session info#> fansi * 1.0.6 2023-12-08 [1] RSPM #> fastmap 1.2.0 2024-05-15 [1] RSPM #> fs 1.6.4 2024-04-25 [1] RSPM -#> glue 1.7.0 2024-01-09 [1] RSPM +#> glue 1.8.0 2024-09-30 [1] RSPM #> htmltools 0.5.8.1 2024-04-04 [1] RSPM #> htmlwidgets 1.6.4 2023-12-06 [1] RSPM #> jquerylib 0.1.4 2021-04-26 [1] RSPM -#> jsonlite 1.8.8 2023-12-04 [1] RSPM +#> jsonlite 1.8.9 2024-09-20 [1] RSPM #> knitr 1.48 2024-07-07 [1] RSPM #> lifecycle 1.0.4 2023-11-07 [1] RSPM #> magrittr 2.0.3 2022-03-30 [1] RSPM diff --git a/dev/articles/palettes.html b/dev/articles/palettes.html index 8ced8a60..b985d4fe 100644 --- a/dev/articles/palettes.html +++ b/dev/articles/palettes.html @@ -76,7 +76,7 @@

cli color palettes

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source:
vignettes/palettes.Rmd
palettes.Rmd
diff --git a/dev/articles/pluralization.html b/dev/articles/pluralization.html index 7a2d21ba..593c9c3d 100644 --- a/dev/articles/pluralization.html +++ b/dev/articles/pluralization.html @@ -80,7 +80,7 @@

cli pluralization

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source: vignettes/pluralization.Rmd
pluralization.Rmd
diff --git a/dev/articles/progress-advanced.html b/dev/articles/progress-advanced.html index 90272d23..095b7c0d 100644 --- a/dev/articles/progress-advanced.html +++ b/dev/articles/progress-advanced.html @@ -80,7 +80,7 @@

Advanced cli progress bars

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source: vignettes/progress-advanced.Rmd
progress-advanced.Rmd
diff --git a/dev/articles/progress-advanced_files/figure-html/custom-spinner.svg b/dev/articles/progress-advanced_files/figure-html/custom-spinner.svg index c81fb269..bb6550d6 100644 --- a/dev/articles/progress-advanced_files/figure-html/custom-spinner.svg +++ b/dev/articles/progress-advanced_files/figure-html/custom-spinner.svg @@ -1 +1 @@ -🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑 \ No newline at end of file +🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌒🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌓🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌔🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌕🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌖🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌗🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌘🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑🌑 \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/function-of-token.svg b/dev/articles/progress-advanced_files/figure-html/function-of-token.svg index bb157789..9764dec1 100644 --- a/dev/articles/progress-advanced_files/figure-html/function-of-token.svg +++ b/dev/articles/progress-advanced_files/figure-html/function-of-token.svg @@ -1 +1 @@ -🌒Thisisstepz.🌒🌒Thisisstepa.🌒🌓Thisisstepb.🌓🌔Thisisstepc.🌔🌕Thisisstepd.🌕🌖Thisisstepe.🌖🌗Thisisstepf.🌗🌘Thisisstepg.🌘🌑Thisissteph.🌑🌒Thisisstepi.🌒🌓Thisisstepj.🌓🌔Thisisstepk.🌔🌕Thisisstepl.🌕🌖Thisisstepm.🌖🌗Thisisstepn.🌗🌘Thisisstepo.🌘🌑Thisisstepp.🌑🌒Thisisstepq.🌒🌓Thisisstepr.🌓🌔Thisissteps.🌔🌕Thisisstept.🌕🌖Thisisstepu.🌖🌗Thisisstepv.🌗🌘Thisisstepw.🌘🌑Thisisstepx.🌑🌒Thisisstepy.🌒 \ No newline at end of file +🌒Thisisstepz.🌒🌒Thisisstepa.🌒🌓Thisisstepb.🌓🌔Thisisstepc.🌔🌕Thisisstepd.🌕🌖Thisisstepe.🌖🌗Thisisstepf.🌗🌘Thisisstepg.🌘🌑Thisissteph.🌑🌒Thisisstepi.🌒🌓Thisisstepj.🌓🌔Thisisstepk.🌔🌕Thisisstepl.🌕🌖Thisisstepm.🌖🌗Thisisstepn.🌗🌘Thisisstepo.🌘🌑Thisisstepp.🌑🌒Thisisstepq.🌒🌓Thisisstepr.🌓🌔Thisissteps.🌔🌕Thisisstept.🌕🌖Thisisstepu.🌖🌗Thisisstepv.🌗🌘Thisisstepw.🌘🌑Thisisstepx.🌑🌒Thisisstepy.🌒 \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-11.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-11.svg index 458eee5e..ab6940e9 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-11.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-11.svg @@ -1 +1 @@ -■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0s□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□0%|ETA:?■■■□□□□□□□□□□□□□□□□□□□□□□□□□□□□8%|ETA:5s■■■■□□□□□□□□□□□□□□□□□□□□□□□□□□□12%|ETA:5s■■■■■■□□□□□□□□□□□□□□□□□□□□□□□□□15%|ETA:5s■■■■■■■□□□□□□□□□□□□□□□□□□□□□□□□19%|ETA:4s■■■■■■■■□□□□□□□□□□□□□□□□□□□□□□□23%|ETA:4s■■■■■■■■■□□□□□□□□□□□□□□□□□□□□□□27%|ETA:4s■■■■■■■■■■□□□□□□□□□□□□□□□□□□□□□31%|ETA:4s■■■■■■■■■■■□□□□□□□□□□□□□□□□□□□□35%|ETA:4s■■■■■■■■■■■■■□□□□□□□□□□□□□□□□□□38%|ETA:3s■■■■■■■■■■■■■■□□□□□□□□□□□□□□□□□42%|ETA:3s■■■■■■■■■■■■■■■□□□□□□□□□□□□□□□□46%|ETA:3s■■■■■■■■■■■■■■■■□□□□□□□□□□□□□□□50%|ETA:3s■■■■■■■■■■■■■■■■■□□□□□□□□□□□□□□54%|ETA:3s■■■■■■■■■■■■■■■■■■□□□□□□□□□□□□□58%|ETA:2s■■■■■■■■■■■■■■■■■■■□□□□□□□□□□□□62%|ETA:2s■■■■■■■■■■■■■■■■■■■■■□□□□□□□□□□65%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■□□□□□□□□□69%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■■□□□□□□□□73%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■□□□□□□□77%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■□□□□□□81%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■□□□□□85%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■□□□88%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■□□92%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:0s \ No newline at end of file +■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0s□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□0%|ETA:?■■■□□□□□□□□□□□□□□□□□□□□□□□□□□□□8%|ETA:5s■■■■□□□□□□□□□□□□□□□□□□□□□□□□□□□12%|ETA:5s■■■■■■□□□□□□□□□□□□□□□□□□□□□□□□□15%|ETA:5s■■■■■■■□□□□□□□□□□□□□□□□□□□□□□□□19%|ETA:4s■■■■■■■■□□□□□□□□□□□□□□□□□□□□□□□23%|ETA:4s■■■■■■■■■□□□□□□□□□□□□□□□□□□□□□□27%|ETA:4s■■■■■■■■■■□□□□□□□□□□□□□□□□□□□□□31%|ETA:4s■■■■■■■■■■■□□□□□□□□□□□□□□□□□□□□35%|ETA:4s■■■■■■■■■■■■■□□□□□□□□□□□□□□□□□□38%|ETA:3s■■■■■■■■■■■■■■□□□□□□□□□□□□□□□□□42%|ETA:3s■■■■■■■■■■■■■■■□□□□□□□□□□□□□□□□46%|ETA:3s■■■■■■■■■■■■■■■■□□□□□□□□□□□□□□□50%|ETA:3s■■■■■■■■■■■■■■■■■□□□□□□□□□□□□□□54%|ETA:3s■■■■■■■■■■■■■■■■■■□□□□□□□□□□□□□58%|ETA:2s■■■■■■■■■■■■■■■■■■■□□□□□□□□□□□□62%|ETA:2s■■■■■■■■■■■■■■■■■■■■■□□□□□□□□□□65%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■□□□□□□□□□69%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■■□□□□□□□□73%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■□□□□□□□77%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■□□□□□□81%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■□□□□□85%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■□□□88%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■□□92%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:0s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-13.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-13.svg index 36da0e8c..3fdebb2e 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-13.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-13.svg @@ -1 +1 @@ -★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★100%|ETA:0s······························0%|ETA:?★★★····························8%|ETA:5s★★★★···························12%|ETA:5s★★★★★★·························15%|ETA:5s★★★★★★★························19%|ETA:4s★★★★★★★★·······················23%|ETA:4s★★★★★★★★★······················27%|ETA:4s★★★★★★★★★★·····················31%|ETA:4s★★★★★★★★★★★····················35%|ETA:4s★★★★★★★★★★★★★··················38%|ETA:3s★★★★★★★★★★★★★★·················42%|ETA:3s★★★★★★★★★★★★★★★················46%|ETA:3s★★★★★★★★★★★★★★★★···············50%|ETA:3s★★★★★★★★★★★★★★★★★··············54%|ETA:2s★★★★★★★★★★★★★★★★★★·············58%|ETA:2s★★★★★★★★★★★★★★★★★★★············62%|ETA:2s★★★★★★★★★★★★★★★★★★★★★··········65%|ETA:2s★★★★★★★★★★★★★★★★★★★★★★·········69%|ETA:2s★★★★★★★★★★★★★★★★★★★★★★★········73%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★·······77%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★······81%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★★·····85%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★★★★···88%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★★★★★··92%|ETA:0s★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★·96%|ETA:0s \ No newline at end of file +★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★100%|ETA:0s······························0%|ETA:?★★★····························8%|ETA:5s★★★★···························12%|ETA:5s★★★★★★·························15%|ETA:5s★★★★★★★························19%|ETA:4s★★★★★★★★·······················23%|ETA:4s★★★★★★★★★······················27%|ETA:4s★★★★★★★★★★·····················31%|ETA:4s★★★★★★★★★★★····················35%|ETA:4s★★★★★★★★★★★★★··················38%|ETA:3s★★★★★★★★★★★★★★·················42%|ETA:3s★★★★★★★★★★★★★★★················46%|ETA:3s★★★★★★★★★★★★★★★★···············50%|ETA:3s★★★★★★★★★★★★★★★★★··············54%|ETA:2s★★★★★★★★★★★★★★★★★★·············58%|ETA:2s★★★★★★★★★★★★★★★★★★★············62%|ETA:2s★★★★★★★★★★★★★★★★★★★★★··········65%|ETA:2s★★★★★★★★★★★★★★★★★★★★★★·········69%|ETA:2s★★★★★★★★★★★★★★★★★★★★★★★········73%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★·······77%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★······81%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★★·····85%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★★★★···88%|ETA:1s★★★★★★★★★★★★★★★★★★★★★★★★★★★★★··92%|ETA:0s★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★·96%|ETA:0s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-16.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-16.svg index 4dd83bcd..14155fa6 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-16.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-16.svg @@ -1 +1 @@ -🌒Downloading[5.1kB/10kB] \ No newline at end of file +🌒Downloading[5.1kB/10kB] \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-17.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-17.svg index 2e4b926a..1d9d613e 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-17.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-17.svg @@ -1 +1 @@ -■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0s0%|ETA:?1%|ETA:6s■■3%|ETA:5s■■■5%|ETA:4s■■■8%|ETA:4s■■■■10%|ETA:4s■■■■■12%|ETA:4s■■■■■14%|ETA:4s■■■■■■16%|ETA:4s■■■■■■■19%|ETA:4s■■■■■■■21%|ETA:4s■■■■■■■■23%|ETA:3s■■■■■■■■■25%|ETA:3s■■■■■■■■■26%|ETA:3s■■■■■■■■■■29%|ETA:3s■■■■■■■■■■31%|ETA:3s■■■■■■■■■■■33%|ETA:3s■■■■■■■■■■■■36%|ETA:3s■■■■■■■■■■■■38%|ETA:3s■■■■■■■■■■■■■40%|ETA:3s■■■■■■■■■■■■■■42%|ETA:3s■■■■■■■■■■■■■■45%|ETA:3s■■■■■■■■■■■■■■■47%|ETA:2s■■■■■■■■■■■■■■■■49%|ETA:2s■■■■■■■■■■■■■■■■51%|ETA:2s■■■■■■■■■■■■■■■■■54%|ETA:2s■■■■■■■■■■■■■■■■■■56%|ETA:2s■■■■■■■■■■■■■■■■■■58%|ETA:2s■■■■■■■■■■■■■■■■■■■60%|ETA:2s■■■■■■■■■■■■■■■■■■■■63%|ETA:2s■■■■■■■■■■■■■■■■■■■■■65%|ETA:2s■■■■■■■■■■■■■■■■■■■■■67%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■70%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■72%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■74%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■76%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■79%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■81%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■83%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■86%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■88%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■90%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■92%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■99%|ETA:0s \ No newline at end of file +■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0s0%|ETA:?2%|ETA:5s■■4%|ETA:5s■■■6%|ETA:4s■■■8%|ETA:4s■■■■10%|ETA:4s■■■■■12%|ETA:4s■■■■■15%|ETA:4s■■■■■■17%|ETA:4s■■■■■■■19%|ETA:4s■■■■■■■22%|ETA:4s■■■■■■■■24%|ETA:3s■■■■■■■■■26%|ETA:3s■■■■■■■■■27%|ETA:3s■■■■■■■■■■30%|ETA:3s■■■■■■■■■■■32%|ETA:3s■■■■■■■■■■■34%|ETA:3s■■■■■■■■■■■■36%|ETA:3s■■■■■■■■■■■■■39%|ETA:3s■■■■■■■■■■■■■41%|ETA:3s■■■■■■■■■■■■■■43%|ETA:3s■■■■■■■■■■■■■■■46%|ETA:2s■■■■■■■■■■■■■■■48%|ETA:2s■■■■■■■■■■■■■■■■50%|ETA:2s■■■■■■■■■■■■■■■■■52%|ETA:2s■■■■■■■■■■■■■■■■■55%|ETA:2s■■■■■■■■■■■■■■■■■■57%|ETA:2s■■■■■■■■■■■■■■■■■■■59%|ETA:2s■■■■■■■■■■■■■■■■■■■61%|ETA:2s■■■■■■■■■■■■■■■■■■■■64%|ETA:2s■■■■■■■■■■■■■■■■■■■■■66%|ETA:2s■■■■■■■■■■■■■■■■■■■■■68%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■70%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■75%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■77%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■80%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■84%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■86%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■89%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:0s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■98%|ETA:0s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-2.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-2.svg index 2a45019f..2cea4e46 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-2.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-2.svg @@ -1 +1 @@ -Datacleaning■■■■■■■■■■■■■■■■50%|ETA:5s \ No newline at end of file +Datacleaning■■■■■■■■■■■■■■■■50%|ETA:5s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-3.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-3.svg index 0883c83b..bb3f4cd6 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-3.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-3.svg @@ -1 +1 @@ -Datacleaning50done(10/s)|5s \ No newline at end of file +Datacleaning50done(10/s)|5s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-4.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-4.svg index 5f60d3d9..c55447fa 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-4.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-4.svg @@ -1 +1 @@ -50/100ETA:5s|Findingdatafiles \ No newline at end of file +50/100ETA:5s|Findingdatafiles \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-5.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-5.svg index 3ebbd64d..e80c5e27 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-5.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-5.svg @@ -1 +1 @@ -Findingdatafiles50done(10/s)|5s \ No newline at end of file +Findingdatafiles50done(10/s)|5s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-6.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-6.svg index 18aa85e5..3273a78d 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-6.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-6.svg @@ -1 +1 @@ -Downloading■■■■■■■■■■■■■■■■|5.1kB/10kBETA:5s \ No newline at end of file +Downloading■■■■■■■■■■■■■■■■|5.1kB/10kBETA:5s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-7.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-7.svg index eb3dc754..82197acc 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-7.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-7.svg @@ -1 +1 @@ -Downloading5.1kB(1.0kB/s)|5s \ No newline at end of file +Downloading5.1kB(1.0kB/s)|5s \ No newline at end of file diff --git a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-8.svg b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-8.svg index 407e48e0..b5a7f673 100644 --- a/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-8.svg +++ b/dev/articles/progress-advanced_files/figure-html/unnamed-chunk-8.svg @@ -1 +1 @@ -Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%Step1|0%Step1|1%Step1|■■3%Step1|■■4%Step1|■■■6%Step1|■■■8%Step1|■■■■9%Step1|■■■■11%Step1|■■■■■12%Step1|■■■■■14%Step1|■■■■■■16%Step1|■■■■■■17%Step1|■■■■■■■19%Step1|■■■■■■■21%Step1|■■■■■■■■22%Step1|■■■■■■■■24%Step1|■■■■■■■■■25%Step1|■■■■■■■■■27%Step1|■■■■■■■■■■29%Step1|■■■■■■■■■■30%Step1|■■■■■■■■■■■32%Step1|■■■■■■■■■■■34%Step1|■■■■■■■■■■■■35%Step1|■■■■■■■■■■■■37%Step1|■■■■■■■■■■■■■38%Step1|■■■■■■■■■■■■■40%Step1|■■■■■■■■■■■■■42%Step1|■■■■■■■■■■■■■■43%Step1|■■■■■■■■■■■■■■45%Step1|■■■■■■■■■■■■■■■46%Step1|■■■■■■■■■■■■■■■48%Step1|■■■■■■■■■■■■■■■■49%Step2|■■■■■■■■■■■■■■■■51%Step2|■■■■■■■■■■■■■■■■■53%Step2|■■■■■■■■■■■■■■■■■54%Step2|■■■■■■■■■■■■■■■■■■56%Step2|■■■■■■■■■■■■■■■■■■58%Step2|■■■■■■■■■■■■■■■■■■■59%Step2|■■■■■■■■■■■■■■■■■■■61%Step2|■■■■■■■■■■■■■■■■■■■■62%Step2|■■■■■■■■■■■■■■■■■■■■64%Step2|■■■■■■■■■■■■■■■■■■■■■66%Step2|■■■■■■■■■■■■■■■■■■■■■67%Step2|■■■■■■■■■■■■■■■■■■■■■■69%Step2|■■■■■■■■■■■■■■■■■■■■■■70%Step2|■■■■■■■■■■■■■■■■■■■■■■■72%Step2|■■■■■■■■■■■■■■■■■■■■■■■74%Step2|■■■■■■■■■■■■■■■■■■■■■■■■75%Step2|■■■■■■■■■■■■■■■■■■■■■■■■77%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■78%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■80%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■82%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■83%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■85%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■87%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■88%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■90%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■98% \ No newline at end of file +Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%Step1|0%Step1|1%Step1|■■2%Step1|■■4%Step1|■■■5%Step1|■■■7%Step1|■■■■9%Step1|■■■■10%Step1|■■■■■12%Step1|■■■■■13%Step1|■■■■■■15%Step1|■■■■■■17%Step1|■■■■■■18%Step1|■■■■■■■20%Step1|■■■■■■■21%Step1|■■■■■■■■23%Step1|■■■■■■■■25%Step1|■■■■■■■■■26%Step1|■■■■■■■■■28%Step1|■■■■■■■■■■29%Step1|■■■■■■■■■■31%Step1|■■■■■■■■■■■33%Step1|■■■■■■■■■■■34%Step1|■■■■■■■■■■■■36%Step1|■■■■■■■■■■■■37%Step1|■■■■■■■■■■■■■39%Step1|■■■■■■■■■■■■■41%Step1|■■■■■■■■■■■■■■42%Step1|■■■■■■■■■■■■■■43%Step1|■■■■■■■■■■■■■■■45%Step1|■■■■■■■■■■■■■■■47%Step1|■■■■■■■■■■■■■■■48%Step1|■■■■■■■■■■■■■■■■50%Step2|■■■■■■■■■■■■■■■■51%Step2|■■■■■■■■■■■■■■■■■53%Step2|■■■■■■■■■■■■■■■■■55%Step2|■■■■■■■■■■■■■■■■■■56%Step2|■■■■■■■■■■■■■■■■■■58%Step2|■■■■■■■■■■■■■■■■■■■59%Step2|■■■■■■■■■■■■■■■■■■■61%Step2|■■■■■■■■■■■■■■■■■■■■63%Step2|■■■■■■■■■■■■■■■■■■■■64%Step2|■■■■■■■■■■■■■■■■■■■■■66%Step2|■■■■■■■■■■■■■■■■■■■■■67%Step2|■■■■■■■■■■■■■■■■■■■■■■69%Step2|■■■■■■■■■■■■■■■■■■■■■■71%Step2|■■■■■■■■■■■■■■■■■■■■■■■72%Step2|■■■■■■■■■■■■■■■■■■■■■■■74%Step2|■■■■■■■■■■■■■■■■■■■■■■■■75%Step2|■■■■■■■■■■■■■■■■■■■■■■■■77%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■79%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■80%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■82%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■83%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■85%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■87%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■88%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■90%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■92%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%Step2|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■98% \ No newline at end of file diff --git a/dev/articles/progress-benchmark.html b/dev/articles/progress-benchmark.html index 2e2f3fcb..b9a8b865 100644 --- a/dev/articles/progress-benchmark.html +++ b/dev/articles/progress-benchmark.html @@ -76,7 +76,7 @@

cli progress bar benchmark

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source: vignettes/progress-benchmark.Rmd
progress-benchmark.Rmd
@@ -117,10 +117,10 @@

The timer#> # A tibble: 4 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 __cli_update_due 8.96ns 20ns 52709559. 0B 0 -#> 2 fun() 130.04ns 160.1ns 4444554. 0B 0 -#> 3 .Call(ccli_tick_reset) 99.88ns 119.9ns 8004264. 0B 0 -#> 4 interactive() 8.85ns 19.9ns 49341663. 0B 0

+#> 1 __cli_update_due 8.96ns 20ns 54252984. 0B 0 +#> 2 fun() 130.04ns 151ns 4723967. 0B 0 +#> 3 .Call(ccli_tick_reset) 99.88ns 120ns 7845446. 0B 0 +#> 4 interactive() 8.96ns 20ns 61376404. 0B 0

+#> 1 if (`__cli_update_due`) fooba… 40ns 50.1ns 20255296. 0B 0

@@ -142,8 +142,8 @@

#> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 seq[[1]] 110ns 140ns 5514945. 0B 0 -#> 2 ta[[1]] 140ns 160ns 6008532. 0B 0

+#> 1 seq[[1]] 120ns 140ns 6595195. 0B 0 +#> 2 ta[[1]] 140ns 160ns 5830179. 0B 0

for loop @@ -175,10 +175,10 @@

#> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0() 12.1ms 12.2ms 82.2 21.6KB 384. -#> 2 fp() 14.4ms 14.5ms 68.4 82.4KB 342. +#> 1 f0() 12ms 12ms 82.7 21.6KB 372. +#> 2 fp() 13.9ms 14.1ms 70.0 82.4KB 350. (ben_taf$median[2] - ben_taf$median[1]) / 1e5 -#> [1] 23.2ns

+#> [1] 20.6ns
 ben_taf2 <- bench::mark(f0(1e6), fp(1e6))
 #> Warning: Some expressions had a GC in every iteration; so filtering is
@@ -187,10 +187,10 @@ 

#> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0(1e+06) 144ms 157ms 5.79 0B 48.2 -#> 2 fp(1e+06) 159ms 160ms 6.24 1.93KB 51.5 +#> 1 f0(1e+06) 134ms 145ms 6.36 0B 52.5 +#> 2 fp(1e+06) 148ms 152ms 6.61 1.93KB 54.6 (ben_taf2$median[2] - ben_taf2$median[1]) / 1e6 -#> [1] 3.5ns

+#> [1] 6.76ns
 ben_taf3 <- bench::mark(f0(1e7), fp(1e7))
 #> Warning: Some expressions had a GC in every iteration; so filtering is
@@ -199,10 +199,10 @@ 

#> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0(1e+07) 1.51s 1.51s 0.660 0B 54.8 -#> 2 fp(1e+07) 1.56s 1.56s 0.639 1.93KB 53.1 +#> 1 f0(1e+07) 1.46s 1.46s 0.683 0B 57.4 +#> 2 fp(1e+07) 1.59s 1.59s 0.629 1.93KB 51.6 (ben_taf3$median[2] - ben_taf3$median[1]) / 1e7 -#> [1] 5ns

+#> [1] 12.6ns
 ben_taf4 <- bench::mark(f0(1e8), fp(1e8))
 #> Warning: Some expressions had a GC in every iteration; so filtering is
@@ -211,10 +211,10 @@ 

#> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0(1e+08) 14.4s 14.4s 0.0697 0B 34.8 -#> 2 fp(1e+08) 15.7s 15.7s 0.0635 1.93KB 31.5 +#> 1 f0(1e+08) 13.8s 13.8s 0.0723 0B 36.0 +#> 2 fp(1e+08) 15.1s 15.1s 0.0663 1.93KB 32.9 (ben_taf4$median[2] - ben_taf4$median[1]) / 1e8 -#> [1] 13.9ns

+#> [1] 12.5ns

Mapping with lapply() @@ -255,11 +255,11 @@

Mapping with lapply()#> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0() 84ms 90.4ms 10.6 781KB 23.0 -#> 2 f01() 124.1ms 132.3ms 6.44 781KB 16.1 -#> 3 fp() 94.4ms 104.2ms 8.74 783KB 12.2 +#> 1 f0() 78.7ms 91.3ms 10.8 781KB 23.4 +#> 2 f01() 126.7ms 128.5ms 6.49 781KB 14.6 +#> 3 fp() 97.9ms 106.4ms 8.87 783KB 14.2 (ben_tam$median[3] - ben_tam$median[1]) / 1e5 -#> [1] 138ns

+#> [1] 151ns
 ben_tam2 <- bench::mark(f0(1e6), f01(1e6), fp(1e6))
 #> Warning: Some expressions had a GC in every iteration; so filtering is
@@ -268,13 +268,13 @@ 

Mapping with lapply()#> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0(1e+06) 831.95ms 831.95ms 1.20 7.63MB 3.61 -#> 2 f01(1e+06) 1.01s 1.01s 0.989 7.63MB 5.93 -#> 3 fp(1e+06) 1.39s 1.39s 0.722 7.63MB 4.33 +#> 1 f0(1e+06) 848.49ms 848.49ms 1.18 7.63MB 3.54 +#> 2 f01(1e+06) 1.04s 1.04s 0.964 7.63MB 5.79 +#> 3 fp(1e+06) 1.42s 1.42s 0.702 7.63MB 4.21 (ben_tam2$median[3] - ben_tam2$median[1]) / 1e6 -#> [1] 554ns +#> [1] 575ns (ben_tam2$median[3] - ben_tam2$median[2]) / 1e6 -#> [1] 375ns

+#> [1] 387ns

Mapping with purrr @@ -313,13 +313,13 @@

Mapping with purrr#> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0() 64.8ms 65.3ms 15.2 1.11MB 9.12 -#> 2 f01() 81.3ms 81.6ms 12.1 781.3KB 6.07 -#> 3 fp() 85.5ms 85.8ms 11.7 783.29KB 17.5 +#> 1 f0() 66.8ms 67ms 14.8 1.11MB 8.88 +#> 2 f01() 83.7ms 84.4ms 11.8 781.3KB 5.90 +#> 3 fp() 88.2ms 88.2ms 11.3 783.29KB 17.0 (ben_pur$median[3] - ben_pur$median[1]) / 1e5 -#> [1] 205ns +#> [1] 212ns (ben_pur$median[3] - ben_pur$median[2]) / 1e5 -#> [1] 41.9ns

+#> [1] 37.5ns
 ben_pur2 <- bench::mark(f0(1e6), f01(1e6), fp(1e6))
 #> Warning: Some expressions had a GC in every iteration; so filtering is
@@ -328,13 +328,13 @@ 

Mapping with purrr#> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0(1e+06) 831.59ms 831.59ms 1.20 7.63MB 3.61 -#> 2 f01(1e+06) 1.09s 1.09s 0.916 7.63MB 3.66 -#> 3 fp(1e+06) 2.47s 2.47s 0.405 7.63MB 1.62 +#> 1 f0(1e+06) 823.77ms 823.77ms 1.21 7.63MB 3.64 +#> 2 f01(1e+06) 1.05s 1.05s 0.948 7.63MB 2.85 +#> 3 fp(1e+06) 2.68s 2.68s 0.373 7.63MB 1.87 (ben_pur2$median[3] - ben_pur2$median[1]) / 1e6 -#> [1] 1.64µs +#> [1] 1.86µs (ben_pur2$median[3] - ben_pur2$median[2]) / 1e6 -#> [1] 1.38µs

+#> [1] 1.63µs
@@ -369,10 +369,10 @@

#> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0() 13.01ms 13.19ms 69.7 39.3KB 5.97 -#> 2 fp() 4.18s 4.18s 0.239 99.9KB 3.11 +#> 1 f0() 12.87ms 12.98ms 70.8 39.3KB 5.90 +#> 2 fp() 4.09s 4.09s 0.245 99.9KB 2.93 (ben_tk$median[2] - ben_tk$median[1]) / 1e5 -#> [1] 41.7µs

+#> [1] 40.8µs

Traditional API @@ -413,11 +413,11 @@

Traditional API#> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0() 11.88ms 12.86ms 67.0 18.7KB 7.89 -#> 2 ff() 22.11ms 22.94ms 38.7 27.7KB 5.81 -#> 3 fp() 2.25s 2.25s 0.443 25.2KB 3.10 +#> 1 f0() 11.99ms 12.46ms 64.8 18.7KB 7.85 +#> 2 ff() 22.1ms 22.61ms 40.3 27.7KB 3.84 +#> 3 fp() 2.29s 2.29s 0.437 25.2KB 3.06 (ben_api$median[3] - ben_api$median[1]) / 1e5 -#> [1] 22.4µs +#> [1] 22.8µs (ben_api$median[2] - ben_api$median[1]) / 1e5 #> [1] 101ns

@@ -428,13 +428,13 @@ 

Traditional API#> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 f0(1e+06) 127.2ms 139.4ms 6.87 0B 6.87 -#> 2 ff(1e+06) 233.8ms 233.8ms 4.27 1.95KB 4.27 -#> 3 fp(1e+06) 22.2s 22.2s 0.0450 1.95KB 2.66 +#> 1 f0(1e+06) 123.4ms 123.5ms 8.06 0B 8.06 +#> 2 ff(1e+06) 219.3ms 220.3ms 4.54 1.95KB 4.54 +#> 3 fp(1e+06) 22.3s 22.3s 0.0449 1.95KB 2.47 (ben_api2$median[3] - ben_api2$median[1]) / 1e6 #> [1] 22.1µs (ben_api2$median[2] - ben_api2$median[1]) / 1e6 -#> [1] 94.4ns

+#> [1] 96.8ns
@@ -501,10 +501,10 @@

C benchmarks#> # A tibble: 4 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl> -#> 1 test_baseline() 622.75ms 622.75ms 1.61 2.08KB 0 +#> 1 test_baseline() 636.84ms 636.84ms 1.57 2.08KB 0 #> 2 test_modulo() 1.25s 1.25s 0.803 2.23KB 0 #> 3 test_cli() 1.25s 1.25s 0.803 23.91KB 0 -#> 4 test_cli_unroll() 624.5ms 624.5ms 1.60 3.58KB 0 +#> 4 test_cli_unroll() 623.89ms 623.89ms 1.60 3.58KB 0 (ben_c$median[3] - ben_c$median[1]) / 2000000000 #> [1] 1ns

@@ -525,17 +525,20 @@

Iterator with a bar#> 0% | ETA: 1h #> 0% | ETA: 1h #> 0% | ETA: 1h -#> 0% | ETA: 47m -#> 0% | ETA: 42m -#> 0% | ETA: 38m +#> 0% | ETA: 1h +#> 0% | ETA: 45m +#> 0% | ETA: 41m +#> 0% | ETA: 37m #> 0% | ETA: 35m -#> 0% | ETA: 32m -#> 0% | ETA: 30m +#> 0% | ETA: 33m +#> 0% | ETA: 31m #> 0% | ETA: 29m +#> 0% | ETA: 28m #> 0% | ETA: 27m #> 0% | ETA: 26m #> 0% | ETA: 25m #> 0% | ETA: 24m +#> 0% | ETA: 24m #> 0% | ETA: 23m #> 0% | ETA: 22m #> 0% | ETA: 22m @@ -543,6 +546,8 @@

Iterator with a bar#> 0% | ETA: 21m #> 0% | ETA: 20m #> 0% | ETA: 20m +#> 0% | ETA: 20m +#> 0% | ETA: 19m #> 0% | ETA: 19m #> 0% | ETA: 19m #> 0% | ETA: 19m @@ -554,6 +559,10 @@

Iterator with a bar#> 0% | ETA: 17m #> 0% | ETA: 17m #> 0% | ETA: 17m +#> 0% | ETA: 17m +#> 0% | ETA: 17m +#> 0% | ETA: 16m +#> 0% | ETA: 16m #> 0% | ETA: 16m #> 0% | ETA: 16m #> 0% | ETA: 16m @@ -572,8 +581,6 @@

Iterator with a bar#> 0% | ETA: 15m #> 0% | ETA: 15m #> 0% | ETA: 15m -#> 0% | ETA: 15m -#> 0% | ETA: 14m #> 0% | ETA: 14m #> 0% | ETA: 14m #> 0% | ETA: 14m @@ -590,21 +597,10 @@

Iterator with a bar#> 0% | ETA: 14m #> 0% | ETA: 14m #> 0% | ETA: 14m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m -#> 0% | ETA: 13m #> # A tibble: 1 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> <bch:expr> <bch:> <bch:> <dbl> <bch:byt> <dbl> -#> 1 cli_progress_update(force = … 5.91ms 6.03ms 161. 1.41MB 2.04 +#> 1 cli_progress_update(force = … 6.04ms 6.38ms 156. 1.41MB 2.08 cli_progress_done()
@@ -613,82 +609,77 @@

Iterator without a bar
 cli_progress_bar(total = NA)
 bench::mark(cli_progress_update(force = TRUE), max_iterations = 10000)
-#> ⠙ 1 done (308/s) | 4ms
-#> ⠹ 2 done (64/s) | 32ms
-#> ⠸ 3 done (78/s) | 39ms
-#> ⠼ 4 done (89/s) | 46ms
-#> ⠴ 5 done (96/s) | 53ms
-#> ⠦ 6 done (102/s) | 60ms
-#> ⠧ 7 done (106/s) | 66ms
-#> ⠇ 8 done (110/s) | 74ms
-#> ⠏ 9 done (113/s) | 81ms
-#> ⠋ 10 done (115/s) | 87ms
-#> ⠙ 11 done (117/s) | 94ms
-#> ⠹ 12 done (119/s) | 101ms
-#> ⠸ 13 done (121/s) | 108ms
-#> ⠼ 14 done (122/s) | 115ms
-#> ⠴ 15 done (124/s) | 122ms
-#> ⠦ 16 done (125/s) | 129ms
-#> ⠧ 17 done (126/s) | 136ms
-#> ⠇ 18 done (127/s) | 143ms
-#> ⠏ 19 done (127/s) | 150ms
-#> ⠋ 20 done (128/s) | 157ms
-#> ⠙ 21 done (129/s) | 164ms
-#> ⠹ 22 done (130/s) | 170ms
-#> ⠸ 23 done (130/s) | 177ms
-#> ⠼ 24 done (131/s) | 184ms
-#> ⠴ 25 done (131/s) | 191ms
-#> ⠦ 26 done (132/s) | 198ms
-#> ⠧ 27 done (132/s) | 205ms
-#> ⠇ 28 done (132/s) | 212ms
-#> ⠏ 29 done (133/s) | 219ms
-#> ⠋ 30 done (133/s) | 226ms
-#> ⠙ 31 done (131/s) | 237ms
-#> ⠹ 32 done (131/s) | 245ms
-#> ⠸ 33 done (131/s) | 252ms
-#> ⠼ 34 done (131/s) | 260ms
-#> ⠴ 35 done (131/s) | 267ms
-#> ⠦ 36 done (131/s) | 275ms
-#> ⠧ 37 done (131/s) | 283ms
-#> ⠇ 38 done (131/s) | 291ms
-#> ⠏ 39 done (131/s) | 299ms
-#> ⠋ 40 done (131/s) | 306ms
-#> ⠙ 41 done (131/s) | 314ms
-#> ⠹ 42 done (131/s) | 321ms
-#> ⠸ 43 done (131/s) | 328ms
-#> ⠼ 44 done (131/s) | 335ms
-#> ⠴ 45 done (132/s) | 342ms
-#> ⠦ 46 done (132/s) | 349ms
-#> ⠧ 47 done (132/s) | 356ms
-#> ⠇ 48 done (132/s) | 363ms
-#> ⠏ 49 done (133/s) | 370ms
-#> ⠋ 50 done (133/s) | 377ms
-#> ⠙ 51 done (133/s) | 384ms
-#> ⠹ 52 done (133/s) | 391ms
-#> ⠸ 53 done (133/s) | 398ms
-#> ⠼ 54 done (133/s) | 405ms
-#> ⠴ 55 done (134/s) | 412ms
-#> ⠦ 56 done (134/s) | 419ms
-#> ⠧ 57 done (134/s) | 426ms
-#> ⠇ 58 done (134/s) | 433ms
-#> ⠏ 59 done (134/s) | 441ms
-#> ⠋ 60 done (134/s) | 448ms
-#> ⠙ 61 done (134/s) | 455ms
-#> ⠹ 62 done (134/s) | 462ms
-#> ⠸ 63 done (135/s) | 469ms
-#> ⠼ 64 done (135/s) | 476ms
-#> ⠴ 65 done (135/s) | 483ms
-#> ⠦ 66 done (135/s) | 490ms
-#> ⠧ 67 done (135/s) | 497ms
-#> ⠇ 68 done (135/s) | 504ms
-#> ⠏ 69 done (135/s) | 510ms
-#> ⠋ 70 done (135/s) | 518ms
-#> ⠙ 71 done (135/s) | 525ms
-#> ⠹ 72 done (136/s) | 532ms
+#> ⠙ 1 done (423/s) | 3ms
+#> ⠹ 2 done (60/s) | 34ms
+#> ⠸ 3 done (71/s) | 43ms
+#> ⠼ 4 done (79/s) | 51ms
+#> ⠴ 5 done (85/s) | 60ms
+#> ⠦ 6 done (89/s) | 68ms
+#> ⠧ 7 done (93/s) | 76ms
+#> ⠇ 8 done (96/s) | 84ms
+#> ⠏ 9 done (98/s) | 93ms
+#> ⠋ 10 done (100/s) | 101ms
+#> ⠙ 11 done (102/s) | 109ms
+#> ⠹ 12 done (104/s) | 116ms
+#> ⠸ 13 done (106/s) | 123ms
+#> ⠼ 14 done (108/s) | 131ms
+#> ⠴ 15 done (109/s) | 138ms
+#> ⠦ 16 done (110/s) | 145ms
+#> ⠧ 17 done (112/s) | 153ms
+#> ⠇ 18 done (113/s) | 160ms
+#> ⠏ 19 done (114/s) | 168ms
+#> ⠋ 20 done (114/s) | 175ms
+#> ⠙ 21 done (115/s) | 183ms
+#> ⠹ 22 done (116/s) | 191ms
+#> ⠸ 23 done (116/s) | 198ms
+#> ⠼ 24 done (117/s) | 206ms
+#> ⠴ 25 done (117/s) | 213ms
+#> ⠦ 26 done (118/s) | 221ms
+#> ⠧ 27 done (118/s) | 229ms
+#> ⠇ 28 done (119/s) | 236ms
+#> ⠏ 29 done (119/s) | 244ms
+#> ⠋ 30 done (120/s) | 251ms
+#> ⠙ 31 done (120/s) | 259ms
+#> ⠹ 32 done (121/s) | 266ms
+#> ⠸ 33 done (121/s) | 274ms
+#> ⠼ 34 done (121/s) | 281ms
+#> ⠴ 35 done (122/s) | 289ms
+#> ⠦ 36 done (122/s) | 296ms
+#> ⠧ 37 done (122/s) | 303ms
+#> ⠇ 38 done (122/s) | 311ms
+#> ⠏ 39 done (123/s) | 319ms
+#> ⠋ 40 done (123/s) | 326ms
+#> ⠙ 41 done (123/s) | 334ms
+#> ⠹ 42 done (123/s) | 342ms
+#> ⠸ 43 done (123/s) | 350ms
+#> ⠼ 44 done (123/s) | 357ms
+#> ⠴ 45 done (123/s) | 365ms
+#> ⠦ 46 done (124/s) | 373ms
+#> ⠧ 47 done (124/s) | 380ms
+#> ⠇ 48 done (124/s) | 388ms
+#> ⠏ 49 done (124/s) | 395ms
+#> ⠋ 50 done (124/s) | 403ms
+#> ⠙ 51 done (124/s) | 411ms
+#> ⠹ 52 done (125/s) | 418ms
+#> ⠸ 53 done (125/s) | 426ms
+#> ⠼ 54 done (125/s) | 433ms
+#> ⠴ 55 done (125/s) | 441ms
+#> ⠦ 56 done (125/s) | 448ms
+#> ⠧ 57 done (125/s) | 456ms
+#> ⠇ 58 done (125/s) | 463ms
+#> ⠏ 59 done (125/s) | 471ms
+#> ⠋ 60 done (126/s) | 478ms
+#> ⠙ 61 done (126/s) | 485ms
+#> ⠹ 62 done (126/s) | 493ms
+#> ⠸ 63 done (126/s) | 500ms
+#> ⠼ 64 done (126/s) | 507ms
+#> ⠴ 65 done (125/s) | 519ms
+#> ⠦ 66 done (125/s) | 527ms
+#> ⠧ 67 done (126/s) | 534ms
 #> # A tibble: 1 × 6
 #>   expression                       min median `itr/sec` mem_alloc `gc/sec`
 #>   <bch:expr>                    <bch:> <bch:>     <dbl> <bch:byt>    <dbl>
-#> 1 cli_progress_update(force = … 6.84ms 6.94ms      141.     265KB     2.02
+#> 1 cli_progress_update(force = … 7.04ms 7.54ms      131.     265KB     2.02
 cli_progress_done()

diff --git a/dev/articles/progress.html b/dev/articles/progress.html index 0eb7cd6f..05dcbaa9 100644 --- a/dev/articles/progress.html +++ b/dev/articles/progress.html @@ -80,7 +80,7 @@

Introduction to progress bars in cli

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source: vignettes/progress.Rmd
progress.Rmd
diff --git a/dev/articles/progress_files/figure-html/classic-example.svg b/dev/articles/progress_files/figure-html/classic-example.svg index 0c3bd240..72297d30 100644 --- a/dev/articles/progress_files/figure-html/classic-example.svg +++ b/dev/articles/progress_files/figure-html/classic-example.svg @@ -1 +1 @@ -Cleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata1%|ETA:5sCleaningdata■■2%|ETA:6sCleaningdata■■4%|ETA:6sCleaningdata■■■6%|ETA:5sCleaningdata■■■8%|ETA:5sCleaningdata■■■■10%|ETA:5sCleaningdata■■■■11%|ETA:5sCleaningdata■■■■■13%|ETA:5sCleaningdata■■■■■15%|ETA:5sCleaningdata■■■■■■17%|ETA:5sCleaningdata■■■■■■■19%|ETA:4sCleaningdata■■■■■■■21%|ETA:4sCleaningdata■■■■■■■■23%|ETA:4sCleaningdata■■■■■■■■24%|ETA:4sCleaningdata■■■■■■■■■26%|ETA:4sCleaningdata■■■■■■■■■28%|ETA:4sCleaningdata■■■■■■■■■■30%|ETA:4sCleaningdata■■■■■■■■■■■32%|ETA:4sCleaningdata■■■■■■■■■■■34%|ETA:4sCleaningdata■■■■■■■■■■■■36%|ETA:3sCleaningdata■■■■■■■■■■■■37%|ETA:3sCleaningdata■■■■■■■■■■■■■39%|ETA:3sCleaningdata■■■■■■■■■■■■■41%|ETA:3sCleaningdata■■■■■■■■■■■■■■43%|ETA:3sCleaningdata■■■■■■■■■■■■■■■45%|ETA:3sCleaningdata■■■■■■■■■■■■■■■47%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■49%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■50%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■52%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■54%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■56%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■58%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■60%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■62%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■63%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■65%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■67%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■69%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■71%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■75%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■76%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■78%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■80%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■84%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■86%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■88%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■89%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■99%|ETA:0s \ No newline at end of file +Cleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata1%|ETA:5sCleaningdata■■2%|ETA:6sCleaningdata■■4%|ETA:6sCleaningdata■■■6%|ETA:6sCleaningdata■■■8%|ETA:5sCleaningdata■■■■9%|ETA:5sCleaningdata■■■■11%|ETA:5sCleaningdata■■■■■13%|ETA:5sCleaningdata■■■■■15%|ETA:5sCleaningdata■■■■■■17%|ETA:5sCleaningdata■■■■■■■19%|ETA:4sCleaningdata■■■■■■■20%|ETA:4sCleaningdata■■■■■■■■22%|ETA:4sCleaningdata■■■■■■■■24%|ETA:4sCleaningdata■■■■■■■■■26%|ETA:4sCleaningdata■■■■■■■■■28%|ETA:4sCleaningdata■■■■■■■■■■30%|ETA:4sCleaningdata■■■■■■■■■■■32%|ETA:4sCleaningdata■■■■■■■■■■■33%|ETA:4sCleaningdata■■■■■■■■■■■35%|ETA:4sCleaningdata■■■■■■■■■■■■37%|ETA:3sCleaningdata■■■■■■■■■■■■■39%|ETA:3sCleaningdata■■■■■■■■■■■■■41%|ETA:3sCleaningdata■■■■■■■■■■■■■■43%|ETA:3sCleaningdata■■■■■■■■■■■■■■■45%|ETA:3sCleaningdata■■■■■■■■■■■■■■■46%|ETA:3sCleaningdata■■■■■■■■■■■■■■■48%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■50%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■52%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■54%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■■56%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■57%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■59%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■61%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■63%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■65%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■67%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■69%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■70%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■72%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■74%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■76%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■78%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■80%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■83%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■85%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■87%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■89%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■98%|ETA:0s \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/cli_progress_message.svg b/dev/articles/progress_files/figure-html/cli_progress_message.svg index 4cb1f104..f69d5f20 100644 --- a/dev/articles/progress_files/figure-html/cli_progress_message.svg +++ b/dev/articles/progress_files/figure-html/cli_progress_message.svg @@ -1 +1 @@ -Taskoneisrunning...Tasktwoisrunning...Taskthreeisunderway:step1Taskthreeisunderway:step5Taskthreeisunderway:step2Taskthreeisunderway:step3Taskthreeisunderway:step4 \ No newline at end of file +Taskoneisrunning...Tasktwoisrunning...Taskthreeisunderway:step1Taskthreeisunderway:step5Taskthreeisunderway:step2Taskthreeisunderway:step3Taskthreeisunderway:step4 \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/cli_progress_step.svg b/dev/articles/progress_files/figure-html/cli_progress_step.svg index 1249cba8..ff4e1835 100644 --- a/dev/articles/progress_files/figure-html/cli_progress_step.svg +++ b/dev/articles/progress_files/figure-html/cli_progress_step.svg @@ -1 +1 @@ -Abouttostartdownloadsof10filesGot4/10files.Alreadyhalfway!Got10/10files.[5.1s]Got0/10files.Got1/10file.Got2/10files.Got3/10files.Got5/10files.Got6/10files.Got7/10files.Got8/10files.Got9/10files.Got10/10files. \ No newline at end of file +Abouttostartdownloadsof10filesGot4/10files.Alreadyhalfway!Got10/10files.[5.1s]Got0/10files.Got1/10file.Got2/10files.Got3/10files.Got5/10files.Got6/10files.Got7/10files.Got8/10files.Got9/10files.Got10/10files. \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/cli_progress_step_simple.svg b/dev/articles/progress_files/figure-html/cli_progress_step_simple.svg index 8de92264..d2a6f272 100644 --- a/dev/articles/progress_files/figure-html/cli_progress_step_simple.svg +++ b/dev/articles/progress_files/figure-html/cli_progress_step_simple.svg @@ -1 +1 @@ -Downloadingdata[2s]Importingdata[1s]Cleaningdata[2s]Fittingmodel[3s]DownloadingdataImportingdataCleaningdataFittingmodel \ No newline at end of file +Downloadingdata[2s]Importingdata[1s]Cleaningdata[2s]Fittingmodel[3s]DownloadingdataImportingdataCleaningdataFittingmodel \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/cli_progress_step_spinner.svg b/dev/articles/progress_files/figure-html/cli_progress_step_spinner.svg index 11f61201..f7eeb1a7 100644 --- a/dev/articles/progress_files/figure-html/cli_progress_step_spinner.svg +++ b/dev/articles/progress_files/figure-html/cli_progress_step_spinner.svg @@ -1 +1 @@ -DownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdata[2.1s]ImportingdataImportingdata[1.1s]CleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdata[2.1s]FittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodel[3.1s]ImportingdataImportingdataImportingdataImportingdataImportingdataImportingdataImportingdataImportingdataImportingdata \ No newline at end of file +DownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdataDownloadingdata[2.1s]ImportingdataImportingdata[1.1s]CleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdataCleaningdata[2.1s]FittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodelFittingmodel[3.1s]ImportingdataImportingdataImportingdataImportingdataImportingdataImportingdataImportingdataImportingdataImportingdata \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/current.svg b/dev/articles/progress_files/figure-html/current.svg index 7622e426..799f050a 100644 --- a/dev/articles/progress_files/figure-html/current.svg +++ b/dev/articles/progress_files/figure-html/current.svg @@ -1 +1 @@ -Cleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata#11%|ETA:5sCleaningdata#1■■4%|ETA:3sCleaningdata#1■■■7%|ETA:3sCleaningdata#1■■■■10%|ETA:3sCleaningdata#1■■■■■13%|ETA:3sCleaningdata#1■■■■■■16%|ETA:3sCleaningdata#1■■■■■■■19%|ETA:3sCleaningdata#1■■■■■■■■22%|ETA:3sCleaningdata#1■■■■■■■■■25%|ETA:2sCleaningdata#1■■■■■■■■■28%|ETA:2sCleaningdata#1■■■■■■■■■■■32%|ETA:2sCleaningdata#1■■■■■■■■■■■35%|ETA:2sCleaningdata#1■■■■■■■■■■■■38%|ETA:2sCleaningdata#1■■■■■■■■■■■■■41%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■44%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■46%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■■49%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■■■52%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■■■■56%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■59%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■62%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■65%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■68%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■71%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■74%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■77%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■80%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■83%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■87%|ETA:0sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■90%|ETA:0sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:0sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■99%|ETA:0sCleaningdata#2■■2%|ETA:3sCleaningdata#2■■■5%|ETA:3sCleaningdata#2■■■8%|ETA:3sCleaningdata#2■■■■11%|ETA:3sCleaningdata#2■■■■■14%|ETA:3sCleaningdata#2■■■■■■17%|ETA:3sCleaningdata#2■■■■■■■20%|ETA:3sCleaningdata#2■■■■■■■■23%|ETA:2sCleaningdata#2■■■■■■■■■26%|ETA:2sCleaningdata#2■■■■■■■■■■29%|ETA:2sCleaningdata#2■■■■■■■■■■■33%|ETA:2sCleaningdata#2■■■■■■■■■■■■36%|ETA:2sCleaningdata#2■■■■■■■■■■■■■39%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■42%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■45%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■48%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■■51%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■■■54%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■57%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■60%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■63%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■66%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■70%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■76%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■79%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■85%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■88%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■■94%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97%|ETA:0s \ No newline at end of file +Cleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata#11%|ETA:5sCleaningdata#1■■2%|ETA:4sCleaningdata#1■■■5%|ETA:3sCleaningdata#1■■■8%|ETA:3sCleaningdata#1■■■■11%|ETA:3sCleaningdata#1■■■■■14%|ETA:3sCleaningdata#1■■■■■■17%|ETA:3sCleaningdata#1■■■■■■■21%|ETA:3sCleaningdata#1■■■■■■■■24%|ETA:3sCleaningdata#1■■■■■■■■■27%|ETA:2sCleaningdata#1■■■■■■■■■■30%|ETA:2sCleaningdata#1■■■■■■■■■■■33%|ETA:2sCleaningdata#1■■■■■■■■■■■■36%|ETA:2sCleaningdata#1■■■■■■■■■■■■■39%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■42%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■44%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■47%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■■50%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■■■54%|ETA:2sCleaningdata#1■■■■■■■■■■■■■■■■■■57%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■60%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■63%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■66%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■69%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■72%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■75%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■78%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■81%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■84%|ETA:1sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■87%|ETA:0sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■90%|ETA:0sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0sCleaningdata#1■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97%|ETA:0sCleaningdata#2■■3%|ETA:3sCleaningdata#2■■■6%|ETA:3sCleaningdata#2■■■■9%|ETA:3sCleaningdata#2■■■■■12%|ETA:3sCleaningdata#2■■■■■15%|ETA:3sCleaningdata#2■■■■■■18%|ETA:3sCleaningdata#2■■■■■■■21%|ETA:3sCleaningdata#2■■■■■■■■24%|ETA:2sCleaningdata#2■■■■■■■■■27%|ETA:2sCleaningdata#2■■■■■■■■■■30%|ETA:2sCleaningdata#2■■■■■■■■■■■33%|ETA:2sCleaningdata#2■■■■■■■■■■■■36%|ETA:2sCleaningdata#2■■■■■■■■■■■■■39%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■43%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■46%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■■49%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■■■52%|ETA:2sCleaningdata#2■■■■■■■■■■■■■■■■■55%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■58%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■61%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■64%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■67%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■70%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■76%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■79%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■86%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■89%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■■92%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%|ETA:0sCleaningdata#2■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■98%|ETA:0s \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/step-error.svg b/dev/articles/progress_files/figure-html/step-error.svg index 7ec4b976..79327a82 100644 --- a/dev/articles/progress_files/figure-html/step-error.svg +++ b/dev/articles/progress_files/figure-html/step-error.svg @@ -1 +1 @@ -Firststep,thiswillsucceed[1s]Errorinf():SomethingiswronghereSecondstep,thiswillfail[1s]Firststep,thiswillsucceedSecondstep,thiswillfail \ No newline at end of file +Firststep,thiswillsucceed[1s]Errorinf():SomethingiswronghereSecondstep,thiswillfail[1s]Firststep,thiswillsucceedSecondstep,thiswillfail \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/tickalong.svg b/dev/articles/progress_files/figure-html/tickalong.svg index dd2c77b6..4b0fe97e 100644 --- a/dev/articles/progress_files/figure-html/tickalong.svg +++ b/dev/articles/progress_files/figure-html/tickalong.svg @@ -1 +1 @@ -■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0s0%|ETA:?■■■8%|ETA:12s■■■■12%|ETA:12s■■■■■■15%|ETA:11s■■■■■■■19%|ETA:11s■■■■■■■■23%|ETA:10s■■■■■■■■■27%|ETA:10s■■■■■■■■■■31%|ETA:9s■■■■■■■■■■■35%|ETA:9s■■■■■■■■■■■■■38%|ETA:8s■■■■■■■■■■■■■■42%|ETA:8s■■■■■■■■■■■■■■■46%|ETA:7s■■■■■■■■■■■■■■■■50%|ETA:7s■■■■■■■■■■■■■■■■■54%|ETA:6s■■■■■■■■■■■■■■■■■■58%|ETA:6s■■■■■■■■■■■■■■■■■■■62%|ETA:5s■■■■■■■■■■■■■■■■■■■■■65%|ETA:5s■■■■■■■■■■■■■■■■■■■■■■69%|ETA:4s■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:4s■■■■■■■■■■■■■■■■■■■■■■■■77%|ETA:3s■■■■■■■■■■■■■■■■■■■■■■■■■81%|ETA:3s■■■■■■■■■■■■■■■■■■■■■■■■■■85%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■■■■■■■88%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■92%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:1s \ No newline at end of file +■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0s0%|ETA:?■■■8%|ETA:12s■■■■12%|ETA:12s■■■■■■15%|ETA:11s■■■■■■■19%|ETA:11s■■■■■■■■23%|ETA:10s■■■■■■■■■27%|ETA:10s■■■■■■■■■■31%|ETA:9s■■■■■■■■■■■35%|ETA:9s■■■■■■■■■■■■■38%|ETA:8s■■■■■■■■■■■■■■42%|ETA:8s■■■■■■■■■■■■■■■46%|ETA:7s■■■■■■■■■■■■■■■■50%|ETA:7s■■■■■■■■■■■■■■■■■54%|ETA:6s■■■■■■■■■■■■■■■■■■58%|ETA:6s■■■■■■■■■■■■■■■■■■■62%|ETA:5s■■■■■■■■■■■■■■■■■■■■■65%|ETA:5s■■■■■■■■■■■■■■■■■■■■■■69%|ETA:4s■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:4s■■■■■■■■■■■■■■■■■■■■■■■■77%|ETA:3s■■■■■■■■■■■■■■■■■■■■■■■■■81%|ETA:3s■■■■■■■■■■■■■■■■■■■■■■■■■■85%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■■■■■■■88%|ETA:2s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■92%|ETA:1s■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:1s \ No newline at end of file diff --git a/dev/articles/progress_files/figure-html/unknown-total.svg b/dev/articles/progress_files/figure-html/unknown-total.svg index 06a66803..cabe612d 100644 --- a/dev/articles/progress_files/figure-html/unknown-total.svg +++ b/dev/articles/progress_files/figure-html/unknown-total.svg @@ -1 +1 @@ -Walkingdirectories463done(90/s)|5.1sWalkingdirectories1done(86/s)|12msWalkingdirectories3done(67/s)|45msWalkingdirectories12done(84/s)|143msWalkingdirectories21done(87/s)|242msWalkingdirectories30done(88/s)|342msWalkingdirectories40done(89/s)|451msWalkingdirectories49done(89/s)|550msWalkingdirectories58done(89/s)|651msWalkingdirectories67done(89/s)|750msWalkingdirectories76done(90/s)|849msWalkingdirectories85done(90/s)|949msWalkingdirectories94done(90/s)|1sWalkingdirectories103done(90/s)|1.1sWalkingdirectories112done(90/s)|1.2sWalkingdirectories121done(90/s)|1.3sWalkingdirectories130done(90/s)|1.4sWalkingdirectories139done(90/s)|1.5sWalkingdirectories149done(90/s)|1.7sWalkingdirectories158done(90/s)|1.8sWalkingdirectories167done(90/s)|1.9sWalkingdirectories176done(90/s)|2sWalkingdirectories185done(90/s)|2sWalkingdirectories194done(90/s)|2.2sWalkingdirectories203done(90/s)|2.3sWalkingdirectories212done(90/s)|2.3sWalkingdirectories221done(90/s)|2.4sWalkingdirectories230done(90/s)|2.5sWalkingdirectories239done(90/s)|2.6sWalkingdirectories248done(90/s)|2.7sWalkingdirectories257done(90/s)|2.8sWalkingdirectories266done(90/s)|2.9sWalkingdirectories276done(90/s)|3.1sWalkingdirectories285done(90/s)|3.2sWalkingdirectories294done(90/s)|3.3sWalkingdirectories303done(90/s)|3.4sWalkingdirectories312done(90/s)|3.5sWalkingdirectories321done(90/s)|3.6sWalkingdirectories330done(90/s)|3.6sWalkingdirectories339done(90/s)|3.8sWalkingdirectories348done(90/s)|3.8sWalkingdirectories357done(90/s)|3.9sWalkingdirectories366done(90/s)|4sWalkingdirectories375done(90/s)|4.1sWalkingdirectories384done(90/s)|4.2sWalkingdirectories393done(90/s)|4.3sWalkingdirectories402done(90/s)|4.4sWalkingdirectories412done(90/s)|4.6sWalkingdirectories421done(90/s)|4.7sWalkingdirectories430done(90/s)|4.8sWalkingdirectories439done(90/s)|4.9sWalkingdirectories448done(90/s)|5sWalkingdirectories457done(90/s)|5.1sWalkingdirectories463done(91/s)|5.1s \ No newline at end of file +Walkingdirectories463done(89/s)|5.2sWalkingdirectories1done(85/s)|12msWalkingdirectories2done(57/s)|36msWalkingdirectories11done(82/s)|135msWalkingdirectories20done(85/s)|235msWalkingdirectories29done(86/s)|338msWalkingdirectories38done(87/s)|437msWalkingdirectories47done(88/s)|536msWalkingdirectories56done(88/s)|637msWalkingdirectories65done(88/s)|737msWalkingdirectories74done(89/s)|837msWalkingdirectories82done(88/s)|929msWalkingdirectories92done(89/s)|1sWalkingdirectories101done(89/s)|1.1sWalkingdirectories109done(89/s)|1.2sWalkingdirectories119done(89/s)|1.3sWalkingdirectories128done(89/s)|1.4sWalkingdirectories136done(89/s)|1.5sWalkingdirectories145done(89/s)|1.6sWalkingdirectories154done(89/s)|1.7sWalkingdirectories163done(89/s)|1.8sWalkingdirectories172done(89/s)|1.9sWalkingdirectories181done(89/s)|2sWalkingdirectories190done(89/s)|2.1sWalkingdirectories199done(89/s)|2.2sWalkingdirectories208done(89/s)|2.3sWalkingdirectories217done(89/s)|2.4sWalkingdirectories226done(89/s)|2.5sWalkingdirectories235done(89/s)|2.6sWalkingdirectories244done(89/s)|2.7sWalkingdirectories253done(89/s)|2.8sWalkingdirectories262done(89/s)|2.9sWalkingdirectories271done(89/s)|3sWalkingdirectories280done(89/s)|3.1sWalkingdirectories289done(89/s)|3.2sWalkingdirectories298done(89/s)|3.3sWalkingdirectories307done(89/s)|3.4sWalkingdirectories316done(89/s)|3.5sWalkingdirectories325done(89/s)|3.6sWalkingdirectories334done(89/s)|3.7sWalkingdirectories343done(89/s)|3.8sWalkingdirectories352done(89/s)|3.9sWalkingdirectories361done(89/s)|4sWalkingdirectories370done(89/s)|4.1sWalkingdirectories379done(89/s)|4.2sWalkingdirectories388done(89/s)|4.3sWalkingdirectories397done(89/s)|4.4sWalkingdirectories406done(89/s)|4.5sWalkingdirectories415done(89/s)|4.6sWalkingdirectories424done(89/s)|4.7sWalkingdirectories433done(89/s)|4.8sWalkingdirectories442done(89/s)|4.9sWalkingdirectories451done(89/s)|5sWalkingdirectories460done(89/s)|5.1sWalkingdirectories463done(90/s)|5.2s \ No newline at end of file diff --git a/dev/articles/semantic-cli.html b/dev/articles/semantic-cli.html index bf0a93a2..54562ea4 100644 --- a/dev/articles/semantic-cli.html +++ b/dev/articles/semantic-cli.html @@ -80,7 +80,7 @@

Building a Semantic CLI

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source: vignettes/semantic-cli.Rmd
semantic-cli.Rmd
@@ -609,8 +609,8 @@

Tags, ids and classes @@ -728,8 +728,8 @@

Sub-Processesinvisible(rs$close())
-#> This is sub-process 15418 from callr                                            
-#> [1] 15418                                                                       
+#> This is sub-process 15568 from callr                                            
+#> [1] 15568                                                                       
 
diff --git a/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-28.svg b/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-28.svg index d3fa431c..247b7105 100644 --- a/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-28.svg +++ b/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-28.svg @@ -1 +1 @@ -Abouttostartdownloads.Got4files,downloading6Alreadyhalf-way!Downloadsdone.Downloading10files.Got1file,downloading9Got2files,downloading8Got3files,downloading7Got5files,downloading5Got6files,downloading4Got7files,downloading3Got8files,downloading2Got9files,downloading1 \ No newline at end of file +Abouttostartdownloads.Got4files,downloading6Alreadyhalf-way!Downloadsdone.Downloading10files.Got1file,downloading9Got2files,downloading8Got3files,downloading7Got5files,downloading5Got6files,downloading4Got7files,downloading3Got8files,downloading2Got9files,downloading1 \ No newline at end of file diff --git a/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-50.svg b/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-50.svg index cd393444..724ef2e5 100644 --- a/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-50.svg +++ b/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-50.svg @@ -1 +1 @@ -dotsdotsdotsdotsdotsdotsdotsdotsdotsdots \ No newline at end of file +dotsdotsdotsdotsdotsdotsdotsdotsdotsdots \ No newline at end of file diff --git a/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-51.svg b/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-51.svg index 041d7f21..12dae294 100644 --- a/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-51.svg +++ b/dev/articles/semantic-cli_files/figure-html/unnamed-chunk-51.svg @@ -1 +1 @@ -🕛🕛clock🕐clock🕑clock🕒clock🕓clock🕔clock🕕clock🕖clock🕗clock🕘clock🕙clock🕚clock \ No newline at end of file +🕛🕛clock🕐clock🕑clock🕒clock🕓clock🕔clock🕕clock🕖clock🕗clock🕘clock🕙clock🕚clock \ No newline at end of file diff --git a/dev/articles/usethis-ui.html b/dev/articles/usethis-ui.html index 4fd85500..49fcdd5c 100644 --- a/dev/articles/usethis-ui.html +++ b/dev/articles/usethis-ui.html @@ -80,7 +80,7 @@

From usethis::ui functions to cli

Gábor Csárdi

-

2024-09-19

+

2024-10-03

Source: vignettes/usethis-ui.Rmd
usethis-ui.Rmd
diff --git a/dev/articles/usethis-ui_files/figure-html/unnamed-chunk-9.svg b/dev/articles/usethis-ui_files/figure-html/unnamed-chunk-9.svg index 5b7ab52f..e3f6f3f6 100644 --- a/dev/articles/usethis-ui_files/figure-html/unnamed-chunk-9.svg +++ b/dev/articles/usethis-ui_files/figure-html/unnamed-chunk-9.svg @@ -1 +1 @@ -SettingVignetteBuilderfieldinDESCRIPTIONto"knitr,rmarkdown"...doneSettingVignetteBuilderfieldinDESCRIPTIONto"knitr,rmarkdown" \ No newline at end of file +SettingVignetteBuilderfieldinDESCRIPTIONto"knitr,rmarkdown"...doneSettingVignetteBuilderfieldinDESCRIPTIONto"knitr,rmarkdown" \ No newline at end of file diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index b02fcf7b..f5bc2892 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -12,7 +12,7 @@ articles: progress: progress.html semantic-cli: semantic-cli.html usethis-ui: usethis-ui.html -last_built: 2024-09-19T16:59Z +last_built: 2024-10-03T20:13Z urls: reference: https://cli.r-lib.org/reference article: https://cli.r-lib.org/articles diff --git a/dev/reference/cli_format_method.html b/dev/reference/cli_format_method.html index b198b205..a14beead 100644 --- a/dev/reference/cli_format_method.html +++ b/dev/reference/cli_format_method.html @@ -179,7 +179,7 @@

Examples#> [1] "yes" #> #> $desc$Packaged -#> [1] "2024-09-19 16:57:44 UTC; runner" +#> [1] "2024-10-03 20:11:36 UTC; runner" #> #> $desc$Author #> [1] "Gábor Csárdi [aut, cre],\n Hadley Wickham [ctb],\n Kirill Müller [ctb],\n Salim Brüggemann [ctb] (<https://orcid.org/0000-0002-5329-5987>),\n Posit Software, PBC [cph, fnd]" @@ -188,7 +188,7 @@

Examples#> [1] "Gábor Csárdi <csardi.gabor@gmail.com>" #> #> $desc$Built -#> [1] "R 4.4.1; x86_64-pc-linux-gnu; 2024-09-19 16:57:45 UTC; unix" +#> [1] "R 4.4.1; x86_64-pc-linux-gnu; 2024-10-03 20:11:38 UTC; unix" #> #> attr(,"file") #> [1] "/home/runner/work/_temp/Library/cli/Meta/package.rds" diff --git a/dev/reference/figures/README/progress.svg b/dev/reference/figures/README/progress.svg index e0908b0d..43710ec6 100644 --- a/dev/reference/figures/README/progress.svg +++ b/dev/reference/figures/README/progress.svg @@ -1 +1 @@ -Cleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata1%|ETA:5sCleaningdata■■2%|ETA:5sCleaningdata■■4%|ETA:5sCleaningdata■■■6%|ETA:5sCleaningdata■■■8%|ETA:5sCleaningdata■■■■10%|ETA:5sCleaningdata■■■■■12%|ETA:5sCleaningdata■■■■■13%|ETA:5sCleaningdata■■■■■15%|ETA:5sCleaningdata■■■■■■17%|ETA:5sCleaningdata■■■■■■■19%|ETA:4sCleaningdata■■■■■■■21%|ETA:4sCleaningdata■■■■■■■■23%|ETA:4sCleaningdata■■■■■■■■■25%|ETA:4sCleaningdata■■■■■■■■■26%|ETA:4sCleaningdata■■■■■■■■■28%|ETA:4sCleaningdata■■■■■■■■■■30%|ETA:4sCleaningdata■■■■■■■■■■■32%|ETA:4sCleaningdata■■■■■■■■■■■34%|ETA:4sCleaningdata■■■■■■■■■■■■36%|ETA:3sCleaningdata■■■■■■■■■■■■38%|ETA:3sCleaningdata■■■■■■■■■■■■■39%|ETA:3sCleaningdata■■■■■■■■■■■■■41%|ETA:3sCleaningdata■■■■■■■■■■■■■■43%|ETA:3sCleaningdata■■■■■■■■■■■■■■■45%|ETA:3sCleaningdata■■■■■■■■■■■■■■■47%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■49%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■51%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■52%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■54%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■56%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■58%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■60%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■62%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■64%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■65%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■67%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■69%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■71%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■73%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■75%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■77%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■78%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■80%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■84%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■86%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■88%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■90%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■95%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■97%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■99%|ETA:0s \ No newline at end of file +Cleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■100%|ETA:0sCleaningdata1%|ETA:5sCleaningdata■■2%|ETA:5sCleaningdata■■4%|ETA:5sCleaningdata■■■6%|ETA:5sCleaningdata■■■7%|ETA:5sCleaningdata■■■■9%|ETA:5sCleaningdata■■■■11%|ETA:5sCleaningdata■■■■■13%|ETA:5sCleaningdata■■■■■15%|ETA:5sCleaningdata■■■■■■17%|ETA:5sCleaningdata■■■■■■■19%|ETA:4sCleaningdata■■■■■■■20%|ETA:4sCleaningdata■■■■■■■■22%|ETA:4sCleaningdata■■■■■■■■24%|ETA:4sCleaningdata■■■■■■■■■26%|ETA:4sCleaningdata■■■■■■■■■28%|ETA:4sCleaningdata■■■■■■■■■■30%|ETA:4sCleaningdata■■■■■■■■■■■32%|ETA:4sCleaningdata■■■■■■■■■■■33%|ETA:4sCleaningdata■■■■■■■■■■■35%|ETA:4sCleaningdata■■■■■■■■■■■■37%|ETA:3sCleaningdata■■■■■■■■■■■■■39%|ETA:3sCleaningdata■■■■■■■■■■■■■41%|ETA:3sCleaningdata■■■■■■■■■■■■■■43%|ETA:3sCleaningdata■■■■■■■■■■■■■■44%|ETA:3sCleaningdata■■■■■■■■■■■■■■■46%|ETA:3sCleaningdata■■■■■■■■■■■■■■■48%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■50%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■52%|ETA:3sCleaningdata■■■■■■■■■■■■■■■■■54%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■56%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■57%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■59%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■61%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■63%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■65%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■67%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■69%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■70%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■72%|ETA:2sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■74%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■76%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■78%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■80%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■82%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■83%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■85%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■87%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■89%|ETA:1sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■91%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■93%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■94%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■96%|ETA:0sCleaningdata■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■98%|ETA:0s \ No newline at end of file diff --git a/dev/search.json b/dev/search.json index f4bd4935..88844c04 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://cli.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 cli authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"ANSI function benchmarks","text":"Often can use corresponding base R function baseline. also compare fansi package, possible.","code":""},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"data","dir":"Articles","previous_headings":"","what":"Data","title":"ANSI function benchmarks","text":"cli typical use case short string scalars, run benchmarks longer strings string vectors well.","code":"library(cli) library(fansi) options(cli.unicode = TRUE) options(cli.num_colors = 256) ansi <- format_inline( \"{col_green(symbol$tick)} {.code print(x)} {.emph emphasised}\" ) plain <- ansi_strip(ansi) vec_plain <- rep(plain, 100) vec_ansi <- rep(ansi, 100) vec_plain6 <- rep(plain, 6) vec_ansi6 <- rep(plain, 6) txt_plain <- paste(vec_plain, collapse = \" \") txt_ansi <- paste(vec_ansi, collapse = \" \") uni <- paste( \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\U0001f3ff\\u200d\\u2640\\ufe0f\" ) vec_uni <- rep(uni, 100) txt_uni <- paste(vec_uni, collapse = \" \")"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_align","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_align()","title":"ANSI function benchmarks","text":"","code":"bench::mark( ansi = ansi_align(ansi, width = 20), plain = ansi_align(plain, width = 20), base = format(plain, width = 20), check = FALSE ) #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 44.8µs 48.1µs 20216. 98.5KB 19.0 #> 2 plain 44.5µs 48.1µs 20143. 0B 20.0 #> 3 base 11.2µs 12.5µs 78243. 48.4KB 23.5 bench::mark( ansi = ansi_align(ansi, width = 20, align = \"right\"), plain = ansi_align(plain, width = 20, align = \"right\"), base = format(plain, width = 20, justify = \"right\"), check = FALSE ) #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 46µs 49.6µs 19569. 0B 21.2 #> 2 plain 46µs 49.6µs 19561. 0B 21.5 #> 3 base 13.4µs 14.6µs 66301. 0B 26.5"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_chartr","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_chartr()","title":"ANSI function benchmarks","text":"","code":"bench::mark( ansi = ansi_chartr(\"abc\", \"XYZ\", ansi), plain = ansi_chartr(\"abc\", \"XYZ\", plain), base = chartr(\"abc\", \"XYZ\", plain), check = FALSE ) #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 110.31µs 117.6µs 8286. 75.07KB 14.7 #> 2 plain 88.27µs 93.2µs 10414. 8.73KB 14.7 #> 3 base 1.85µs 2.01µs 476859. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_columns","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_columns()","title":"ANSI function benchmarks","text":"","code":"bench::mark( ansi = ansi_columns(vec_ansi6, width = 120), plain = ansi_columns(vec_plain6, width = 120), check = FALSE ) #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 337µs 360µs 2747. 33.17KB 19.2 #> 2 plain 336µs 358µs 2768. 1.09KB 19.2"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_has_any","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_has_any()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_has_any(ansi), fansi_ansi = has_sgr(ansi), cli_plain = ansi_has_any(plain), fansi_plain = has_sgr(plain), cli_vec_ansi = ansi_has_any(vec_ansi), fansi_vec_ansi = has_sgr(vec_ansi), cli_vec_plain = ansi_has_any(vec_plain), fansi_vec_plain = has_sgr(vec_plain), cli_txt_ansi = ansi_has_any(txt_ansi), fansi_txt_ansi = has_sgr(txt_ansi), cli_txt_plain = ansi_has_any(txt_plain), fansi_txt_plain = has_sgr(vec_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 5.43µs 5.94µs 162670. 8.02KB 32.5 #> 2 fansi_ansi 29.47µs 32.78µs 29600. 4.18KB 23.7 #> 3 cli_plain 5.39µs 5.9µs 163593. 0B 16.4 #> 4 fansi_plain 29.45µs 32.54µs 29167. 688B 26.3 #> 5 cli_vec_ansi 6.68µs 7.12µs 137148. 448B 13.7 #> 6 fansi_vec_ansi 38.48µs 40.53µs 24047. 5.02KB 19.3 #> 7 cli_vec_plain 7.24µs 7.62µs 128337. 448B 25.7 #> 8 fansi_vec_plain 37.65µs 39.62µs 24586. 5.02KB 19.7 #> 9 cli_txt_ansi 5.36µs 5.7µs 170372. 0B 34.1 #> 10 fansi_txt_ansi 29.14µs 31.21µs 31169. 688B 25.0 #> 11 cli_txt_plain 6.2µs 6.55µs 148660. 0B 14.9 #> 12 fansi_txt_plain 37.7µs 39.98µs 24216. 5.02KB 19.4"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_html","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_html()","title":"ANSI function benchmarks","text":"typically used longer text.","code":"bench::mark( cli = ansi_html(txt_ansi), fansi = sgr_to_html(txt_ansi, classes = TRUE), check = FALSE ) #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 65.5µs 67.1µs 14648. 28.8KB 6.10 #> 2 fansi 121.5µs 124.9µs 7880. 55.3KB 8.20"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_nchar","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_nchar()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_nchar(ansi), fansi_ansi = nchar_sgr(ansi), base_ansi = nchar(ansi), cli_plain = ansi_nchar(plain), fansi_plain = nchar_sgr(plain), base_plain = nchar(plain), cli_vec_ansi = ansi_nchar(vec_ansi), fansi_vec_ansi = nchar_sgr(vec_ansi), base_vec_ansi = nchar(vec_ansi), cli_vec_plain = ansi_nchar(vec_plain), fansi_vec_plain = nchar_sgr(vec_plain), base_vec_plain = nchar(vec_plain), cli_txt_ansi = ansi_nchar(txt_ansi), fansi_txt_ansi = nchar_sgr(txt_ansi), base_txt_ansi = nchar(txt_ansi), cli_txt_plain = ansi_nchar(txt_plain), fansi_txt_plain = nchar_sgr(txt_plain), base_txt_plain = nchar(txt_plain), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 6.5µs 7.06µs 137564. 0B 13.8 #> 2 fansi_ansi 89.79µs 94.07µs 10372. 31.85KB 16.7 #> 3 base_ansi 852.04ns 901.99ns 1037868. 0B 104. #> 4 cli_plain 6.46µs 7.01µs 139185. 0B 13.9 #> 5 fansi_plain 89.03µs 94.27µs 10353. 688B 16.8 #> 6 base_plain 782.08ns 831.09ns 1108880. 0B 111. #> 7 cli_vec_ansi 27.77µs 28.86µs 34033. 448B 3.40 #> 8 fansi_vec_ansi 109.44µs 114.28µs 8531. 5.02KB 14.7 #> 9 base_vec_ansi 14.8µs 14.87µs 66383. 448B 0 #> 10 cli_vec_plain 26.3µs 27.1µs 35870. 448B 7.18 #> 11 fansi_vec_plain 100.43µs 105.09µs 9259. 5.02KB 14.7 #> 12 base_vec_plain 8.1µs 8.18µs 120435. 448B 0 #> 13 cli_txt_ansi 28.06µs 28.72µs 34260. 0B 6.85 #> 14 fansi_txt_ansi 101.51µs 106.27µs 9174. 688B 14.6 #> 15 base_txt_ansi 14.26µs 14.32µs 68916. 0B 0 #> 16 cli_txt_plain 25.93µs 26.55µs 36864. 0B 7.37 #> 17 fansi_txt_plain 91.45µs 96.41µs 10113. 688B 16.7 #> 18 base_txt_plain 8.39µs 8.91µs 112390. 0B 0 bench::mark( cli_ansi = ansi_nchar(ansi, type = \"width\"), fansi_ansi = nchar_sgr(ansi, type = \"width\"), base_ansi = nchar(ansi, \"width\"), cli_plain = ansi_nchar(plain, type = \"width\"), fansi_plain = nchar_sgr(plain, type = \"width\"), base_plain = nchar(plain, \"width\"), cli_vec_ansi = ansi_nchar(vec_ansi, type = \"width\"), fansi_vec_ansi = nchar_sgr(vec_ansi, type = \"width\"), base_vec_ansi = nchar(vec_ansi, \"width\"), cli_vec_plain = ansi_nchar(vec_plain, type = \"width\"), fansi_vec_plain = nchar_sgr(vec_plain, type = \"width\"), base_vec_plain = nchar(vec_plain, \"width\"), cli_txt_ansi = ansi_nchar(txt_ansi, type = \"width\"), fansi_txt_ansi = nchar_sgr(txt_ansi, type = \"width\"), base_txt_ansi = nchar(txt_ansi, \"width\"), cli_txt_plain = ansi_nchar(txt_plain, type = \"width\"), fansi_txt_plain = nchar_sgr(txt_plain, type = \"width\"), base_txt_plain = nchar(txt_plain, type = \"width\"), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 8.05µs 8.9µs 109054. 0B 32.7 #> 2 fansi_ansi 90.14µs 94.72µs 10295. 688B 16.7 #> 3 base_ansi 1.18µs 1.22µs 777520. 0B 0 #> 4 cli_plain 8.02µs 8.66µs 112638. 0B 22.5 #> 5 fansi_plain 89.99µs 94.6µs 10289. 688B 16.8 #> 6 base_plain 971.02ns 1.01µs 924743. 0B 0 #> 7 cli_vec_ansi 33.91µs 34.67µs 28357. 448B 8.51 #> 8 fansi_vec_ansi 117.25µs 121.53µs 8025. 5.02KB 12.5 #> 9 base_vec_ansi 41.75µs 42.49µs 23311. 448B 0 #> 10 cli_vec_plain 32.93µs 33.63µs 29261. 448B 5.85 #> 11 fansi_vec_plain 106.6µs 110.84µs 8798. 5.02KB 14.6 #> 12 base_vec_plain 21.36µs 21.54µs 45852. 448B 0 #> 13 cli_txt_ansi 34.22µs 34.85µs 28222. 0B 5.65 #> 14 fansi_txt_ansi 107.6µs 112.86µs 8637. 688B 14.6 #> 15 base_txt_ansi 44.92µs 45.12µs 21890. 0B 0 #> 16 cli_txt_plain 32.65µs 33.35µs 29505. 0B 5.90 #> 17 fansi_txt_plain 97.54µs 102.39µs 9537. 688B 16.7 #> 18 base_txt_plain 23.93µs 24.14µs 40963. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_simplify","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_simplify()","title":"ANSI function benchmarks","text":"Nothing compare .","code":"bench::mark( cli_ansi = ansi_simplify(ansi), cli_plain = ansi_simplify(plain), cli_vec_ansi = ansi_simplify(vec_ansi), cli_vec_plain = ansi_simplify(vec_plain), cli_txt_ansi = ansi_simplify(txt_ansi), cli_txt_plain = ansi_simplify(txt_plain), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 6.54µs 7.05µs 138018. 0B 27.6 #> 2 cli_plain 5.98µs 6.48µs 150248. 0B 15.0 #> 3 cli_vec_ansi 39.34µs 40.49µs 24313. 848B 4.86 #> 4 cli_vec_plain 9.94µs 10.51µs 93042. 848B 18.6 #> 5 cli_txt_ansi 37.36µs 38.67µs 25448. 0B 2.55 #> 6 cli_txt_plain 6.82µs 7.32µs 133171. 0B 26.6"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strip","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strip()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_strip(ansi), fansi_ansi = strip_sgr(ansi), cli_plain = ansi_strip(plain), fansi_plain = strip_sgr(plain), cli_vec_ansi = ansi_strip(vec_ansi), fansi_vec_ansi = strip_sgr(vec_ansi), cli_vec_plain = ansi_strip(vec_plain), fansi_vec_plain = strip_sgr(vec_plain), cli_txt_ansi = ansi_strip(txt_ansi), fansi_txt_ansi = strip_sgr(txt_ansi), cli_txt_plain = ansi_strip(txt_plain), fansi_txt_plain = strip_sgr(txt_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 11.3µs 12µs 81379. 0B 24.4 #> 2 fansi_ansi 27.6µs 29.2µs 32970. 688B 26.4 #> 3 cli_plain 11.1µs 11.8µs 82576. 0B 24.8 #> 4 fansi_plain 27µs 28.8µs 33811. 688B 27.1 #> 5 cli_vec_ansi 19.8µs 20.7µs 47376. 848B 14.2 #> 6 fansi_vec_ansi 52.5µs 54.7µs 17862. 5.41KB 12.6 #> 7 cli_vec_plain 13.8µs 14.6µs 67055. 848B 20.1 #> 8 fansi_vec_plain 35.9µs 37.9µs 25722. 4.59KB 20.6 #> 9 cli_txt_ansi 19.6µs 20.3µs 47050. 0B 14.1 #> 10 fansi_txt_ansi 43µs 44.9µs 21685. 5.12KB 17.4 #> 11 cli_txt_plain 11.9µs 12.6µs 77481. 0B 23.3 #> 12 fansi_txt_plain 27.8µs 29.8µs 32618. 688B 26.1"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strsplit","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strsplit()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_strsplit(ansi, \"i\"), fansi_ansi = strsplit_sgr(ansi, \"i\"), base_ansi = strsplit(ansi, \"i\"), cli_plain = ansi_strsplit(plain, \"i\"), fansi_plain = strsplit_sgr(plain, \"i\"), base_plain = strsplit(plain, \"i\"), cli_vec_ansi = ansi_strsplit(vec_ansi, \"i\"), fansi_vec_ansi = strsplit_sgr(vec_ansi, \"i\"), base_vec_ansi = strsplit(vec_ansi, \"i\"), cli_vec_plain = ansi_strsplit(vec_plain, \"i\"), fansi_vec_plain = strsplit_sgr(vec_plain, \"i\"), base_vec_plain = strsplit(vec_plain, \"i\"), cli_txt_ansi = ansi_strsplit(txt_ansi, \"i\"), fansi_txt_ansi = strsplit_sgr(txt_ansi, \"i\"), base_txt_ansi = strsplit(txt_ansi, \"i\"), cli_txt_plain = ansi_strsplit(txt_plain, \"i\"), fansi_txt_plain = strsplit_sgr(txt_plain, \"i\"), base_txt_plain = strsplit(txt_plain, \"i\"), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 145.77µs 151.5µs 6430. 103.31KB 16.8 #> 2 fansi_ansi 124.86µs 131.88µs 7401. 102.13KB 22.1 #> 3 base_ansi 3.96µs 4.32µs 226461. 224B 0 #> 4 cli_plain 144.01µs 149.83µs 6492. 8.09KB 19.0 #> 5 fansi_plain 122.85µs 129µs 7594. 9.62KB 19.0 #> 6 base_plain 3.57µs 3.79µs 256633. 0B 25.7 #> 7 cli_vec_ansi 7.46ms 7.62ms 131. 823.77KB 25.3 #> 8 fansi_vec_ansi 1.05ms 1.08ms 898. 846.81KB 17.3 #> 9 base_vec_ansi 155.34µs 163.92µs 5965. 22.7KB 4.12 #> 10 cli_vec_plain 7.38ms 7.56ms 132. 823.77KB 25.4 #> 11 fansi_vec_plain 985.73µs 1.03ms 954. 845.98KB 19.8 #> 12 base_vec_plain 113.48µs 116.28µs 8475. 848B 2.02 #> 13 cli_txt_ansi 3.31ms 3.58ms 278. 63.6KB 2.03 #> 14 fansi_txt_ansi 1.54ms 1.56ms 640. 35.05KB 2.05 #> 15 base_txt_ansi 135.62µs 138.18µs 7150. 18.47KB 2.01 #> 16 cli_txt_plain 2.41ms 2.69ms 374. 63.6KB 0 #> 17 fansi_txt_plain 515.39µs 538.71µs 1837. 30.6KB 4.07 #> 18 base_txt_plain 89.87µs 91.56µs 10768. 11.05KB 4.03"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strtrim","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strtrim()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_strtrim(ansi, 10), fansi_ansi = strtrim_sgr(ansi, 10), base_ansi = strtrim(ansi, 10), cli_plain = ansi_strtrim(plain, 10), fansi_plain = strtrim_sgr(plain, 10), base_plain = strtrim(plain, 10), cli_vec_ansi = ansi_strtrim(vec_ansi, 10), fansi_vec_ansi = strtrim_sgr(vec_ansi, 10), base_vec_ansi = strtrim(vec_ansi, 10), cli_vec_plain = ansi_strtrim(vec_plain, 10), fansi_vec_plain = strtrim_sgr(vec_plain, 10), base_vec_plain = strtrim(vec_plain, 10), cli_txt_ansi = ansi_strtrim(txt_ansi, 10), fansi_txt_ansi = strtrim_sgr(txt_ansi, 10), base_txt_ansi = strtrim(txt_ansi, 10), cli_txt_plain = ansi_strtrim(txt_plain, 10), fansi_txt_plain = strtrim_sgr(txt_plain, 10), base_txt_plain = strtrim(txt_plain, 10), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 96.12µs 101.34µs 9514. 32.23KB 21.2 #> 2 fansi_ansi 52.86µs 56.5µs 17117. 31.43KB 23.5 #> 3 base_ansi 991.04ns 1.04µs 908669. 4.2KB 0 #> 4 cli_plain 94.02µs 98.36µs 9843. 0B 21.2 #> 5 fansi_plain 52.29µs 55.91µs 17320. 872B 23.5 #> 6 base_plain 932.14ns 973.12ns 972295. 0B 0 #> 7 cli_vec_ansi 231.76µs 240.74µs 4055. 16.73KB 8.26 #> 8 fansi_vec_ansi 123.76µs 128.74µs 7596. 5.59KB 12.5 #> 9 base_vec_ansi 35.27µs 36.62µs 27155. 848B 0 #> 10 cli_vec_plain 177.19µs 183.97µs 5324. 16.73KB 10.4 #> 11 fansi_vec_plain 116.21µs 119.78µs 8118. 5.59KB 12.0 #> 12 base_vec_plain 30.78µs 31.01µs 31908. 848B 3.19 #> 13 cli_txt_ansi 102.88µs 107.03µs 9129. 0B 18.9 #> 14 fansi_txt_ansi 51.81µs 55.02µs 17737. 872B 23.5 #> 15 base_txt_ansi 1.03µs 1.07µs 882716. 0B 0 #> 16 cli_txt_plain 93.95µs 98.14µs 9965. 0B 23.3 #> 17 fansi_txt_plain 51.78µs 55.22µs 17720. 872B 23.3 #> 18 base_txt_plain 962.06ns 1.01µs 948472. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strwrap","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strwrap()","title":"ANSI function benchmarks","text":"function useful longer text, often called short text cli, makes sense benchmark well.","code":"bench::mark( cli_ansi = ansi_strwrap(ansi, 30), fansi_ansi = strwrap_sgr(ansi, 30), base_ansi = strwrap(ansi, 30), cli_plain = ansi_strwrap(plain, 30), fansi_plain = strwrap_sgr(plain, 30), base_plain = strwrap(plain, 30), cli_vec_ansi = ansi_strwrap(vec_ansi, 30), fansi_vec_ansi = strwrap_sgr(vec_ansi, 30), base_vec_ansi = strwrap(vec_ansi, 30), cli_vec_plain = ansi_strwrap(vec_plain, 30), fansi_vec_plain = strwrap_sgr(vec_plain, 30), base_vec_plain = strwrap(vec_plain, 30), cli_txt_ansi = ansi_strwrap(txt_ansi, 30), fansi_txt_ansi = strwrap_sgr(txt_ansi, 30), base_txt_ansi = strwrap(txt_ansi, 30), cli_txt_plain = ansi_strwrap(txt_plain, 30), fansi_txt_plain = strwrap_sgr(txt_plain, 30), base_txt_plain = strwrap(txt_plain, 30), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 320.18µs 334.16µs 2958. 266.59KB 19.0 #> 2 fansi_ansi 96.37µs 102.85µs 9416. 10.29KB 21.3 #> 3 base_ansi 36.89µs 38.98µs 24770. 0B 19.8 #> 4 cli_plain 198.11µs 206.47µs 4688. 0B 19.0 #> 5 fansi_plain 94.67µs 101.08µs 9632. 872B 21.2 #> 6 base_plain 30.55µs 32.35µs 29710. 0B 20.8 #> 7 cli_vec_ansi 33.47ms 33.6ms 29.6 2.48KB 53.3 #> 8 fansi_vec_ansi 240.79µs 249.3µs 3951. 7.25KB 10.3 #> 9 base_vec_ansi 2.17ms 2.27ms 440. 48.18KB 26.0 #> 10 cli_vec_plain 20.4ms 20.62ms 48.5 2.48KB 29.1 #> 11 fansi_vec_plain 200.34µs 206.77µs 4770. 6.42KB 12.5 #> 12 base_vec_plain 1.6ms 1.65ms 603. 47.4KB 24.5 #> 13 cli_txt_ansi 23.11ms 23.21ms 42.9 507.59KB 10.1 #> 14 fansi_txt_ansi 227.49µs 234.79µs 4182. 6.77KB 10.3 #> 15 base_txt_ansi 2.05ms 2.08ms 474. 582.06KB 13.3 #> 16 cli_txt_plain 1.64ms 1.67ms 594. 369.84KB 10.8 #> 17 fansi_txt_plain 179.65µs 188.17µs 5129. 2.51KB 12.5 #> 18 base_txt_plain 1.31ms 1.34ms 733. 367.31KB 13.1"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_substr","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_substr()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_substr(ansi, 2, 10), fansi_ansi = substr_sgr(ansi, 2, 10), base_ansi = substr(ansi, 2, 10), cli_plain = ansi_substr(plain, 2, 10), fansi_plain = substr_sgr(plain, 2, 10), base_plain = substr(plain, 2, 10), cli_vec_ansi = ansi_substr(vec_ansi, 2, 10), fansi_vec_ansi = substr_sgr(vec_ansi, 2, 10), base_vec_ansi = substr(vec_ansi, 2, 10), cli_vec_plain = ansi_substr(vec_plain, 2, 10), fansi_vec_plain = substr_sgr(vec_plain, 2, 10), base_vec_plain = substr(vec_plain, 2, 10), cli_txt_ansi = ansi_substr(txt_ansi, 2, 10), fansi_txt_ansi = substr_sgr(txt_ansi, 2, 10), base_txt_ansi = substr(txt_ansi, 2, 10), cli_txt_plain = ansi_substr(txt_plain, 2, 10), fansi_txt_plain = substr_sgr(txt_plain, 2, 10), base_txt_plain = substr(txt_plain, 2, 10), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 6.19µs 6.74µs 143029. 23.82KB 28.6 #> 2 fansi_ansi 75.71µs 80.98µs 12024. 28.48KB 21.3 #> 3 base_ansi 961.01ns 1µs 919766. 0B 92.0 #> 4 cli_plain 6.03µs 6.53µs 148235. 0B 29.7 #> 5 fansi_plain 75.82µs 80.7µs 12068. 1.98KB 21.3 #> 6 base_plain 912.11ns 972.07ns 969238. 0B 0 #> 7 cli_vec_ansi 26.51µs 27.83µs 35194. 1.7KB 7.04 #> 8 fansi_vec_ansi 112.13µs 117.32µs 8259. 8.86KB 14.8 #> 9 base_vec_ansi 5.83µs 6.01µs 161782. 848B 16.2 #> 10 cli_vec_plain 22.39µs 23.8µs 41218. 1.7KB 8.25 #> 11 fansi_vec_plain 106.63µs 111.46µs 8727. 8.86KB 14.8 #> 12 base_vec_plain 5.45µs 5.66µs 171162. 848B 0 #> 13 cli_txt_ansi 6.09µs 6.63µs 144852. 0B 43.5 #> 14 fansi_txt_ansi 76.14µs 81.08µs 12008. 1.98KB 21.2 #> 15 base_txt_ansi 5.12µs 5.18µs 174804. 0B 0 #> 16 cli_txt_plain 6.84µs 7.41µs 129506. 0B 25.9 #> 17 fansi_txt_plain 75.14µs 80.26µs 12165. 1.98KB 22.1 #> 18 base_txt_plain 3.34µs 3.39µs 286102. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_tolower-ansi_toupper","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_tolower() , ansi_toupper()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_tolower(ansi), base_ansi = tolower(ansi), cli_plain = ansi_tolower(plain), base_plain = tolower(plain), cli_vec_ansi = ansi_tolower(vec_ansi), base_vec_ansi = tolower(vec_ansi), cli_vec_plain = ansi_tolower(vec_plain), base_vec_plain = tolower(vec_plain), cli_txt_ansi = ansi_tolower(txt_ansi), base_txt_ansi = tolower(txt_ansi), cli_txt_plain = ansi_tolower(txt_plain), base_txt_plain = tolower(txt_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 103.42µs 107.61µs 9038. 11.88KB 16.9 #> 2 base_ansi 1.32µs 1.36µs 710841. 0B 0 #> 3 cli_plain 83.77µs 87.13µs 11149. 8.73KB 14.6 #> 4 base_plain 1µs 1.04µs 934392. 0B 0 #> 5 cli_vec_ansi 3.99ms 4.09ms 244. 838.77KB 29.0 #> 6 base_vec_ansi 77.98µs 78.8µs 12561. 848B 0 #> 7 cli_vec_plain 2.23ms 2.29ms 431. 816.9KB 30.4 #> 8 base_vec_plain 47.07µs 47.91µs 20644. 848B 0 #> 9 cli_txt_ansi 12.94ms 13.04ms 76.0 114.42KB 6.52 #> 10 base_txt_ansi 78.87µs 79.22µs 12485. 0B 0 #> 11 cli_txt_plain 251.74µs 260.84µs 3760. 18.16KB 6.12 #> 12 base_txt_plain 44.43µs 44.7µs 22015. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_trimws","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_trimws()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_trimws(ansi), base_ansi = trimws(ansi), cli_plain = ansi_trimws(plain), base_plain = trimws(plain), cli_vec_ansi = ansi_trimws(vec_ansi), base_vec_ansi = trimws(vec_ansi), cli_vec_plain = ansi_trimws(vec_plain), base_vec_plain = trimws(vec_plain), cli_txt_ansi = ansi_trimws(txt_ansi), base_txt_ansi = trimws(txt_ansi), cli_txt_plain = ansi_trimws(txt_plain), base_txt_plain = trimws(txt_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 72µs 76.3µs 12466. 0B 21.1 #> 2 base_ansi 15.8µs 17.2µs 56540. 0B 22.6 #> 3 cli_plain 70.3µs 74.2µs 13034. 0B 21.1 #> 4 base_plain 16.1µs 17.2µs 56572. 0B 22.6 #> 5 cli_vec_ansi 154.4µs 162µs 6000. 7.2KB 10.3 #> 6 base_vec_ansi 54.2µs 59.1µs 16587. 1.66KB 6.12 #> 7 cli_vec_plain 142.2µs 149.6µs 6533. 7.2KB 10.4 #> 8 base_vec_plain 47.2µs 52.1µs 18763. 1.66KB 6.12 #> 9 cli_txt_ansi 137.2µs 141.6µs 6835. 0B 12.4 #> 10 base_txt_ansi 37.7µs 38.9µs 25127. 0B 7.54 #> 11 cli_txt_plain 121.3µs 125.7µs 7740. 0B 12.5 #> 12 base_txt_plain 32.9µs 34.1µs 28627. 0B 11.5"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"utf8_nchar","dir":"Articles","previous_headings":"UTF-8 functions","what":"utf8_nchar()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli = utf8_nchar(uni, type = \"chars\"), base = nchar(uni, \"chars\"), cli_vec = utf8_nchar(vec_uni, type = \"chars\"), base_vec = nchar(vec_uni, \"chars\"), cli_txt = utf8_nchar(txt_uni, type = \"chars\"), base_txt = nchar(txt_uni, \"chars\"), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 7.86µs 8.54µs 113596. 12.3KB 22.7 #> 2 base 842.03ns 901.99ns 1045080. 0B 0 #> 3 cli_vec 24.28µs 25.16µs 38948. 448B 7.79 #> 4 base_vec 11.7µs 11.97µs 82185. 448B 0 #> 5 cli_txt 24.93µs 25.7µs 38120. 0B 11.4 #> 6 base_txt 12.78µs 12.86µs 76649. 0B 0 bench::mark( cli = utf8_nchar(uni, type = \"width\"), base = nchar(uni, \"width\"), cli_vec = utf8_nchar(vec_uni, type = \"width\"), base_vec = nchar(vec_uni, \"width\"), cli_txt = utf8_nchar(txt_uni, type = \"width\"), base_txt = nchar(txt_uni, \"width\"), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 7.84µs 8.52µs 113429. 0B 22.7 #> 2 base 1.23µs 1.3µs 719909. 0B 72.0 #> 3 cli_vec 28.64µs 29.61µs 33178. 448B 6.64 #> 4 base_vec 45.34µs 48.31µs 20748. 448B 0 #> 5 cli_txt 30.02µs 30.74µs 31988. 0B 6.40 #> 6 base_txt 83.55µs 85.62µs 11573. 0B 0 bench::mark( cli = utf8_nchar(uni, type = \"codepoints\"), base = nchar(uni, \"chars\"), cli_vec = utf8_nchar(vec_uni, type = \"codepoints\"), base_vec = nchar(vec_uni, \"chars\"), cli_txt = utf8_nchar(txt_uni, type = \"codepoints\"), base_txt = nchar(txt_uni, \"chars\"), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 8.35µs 9.1µs 107290. 0B 21.5 #> 2 base 851ns 902ns 1046810. 0B 0 #> 3 cli_vec 19.84µs 20.5µs 47894. 448B 14.4 #> 4 base_vec 11.64µs 12µs 82206. 448B 0 #> 5 cli_txt 20.48µs 21.1µs 46558. 0B 14.0 #> 6 base_txt 12.78µs 12.8µs 76776. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"utf8_substr","dir":"Articles","previous_headings":"UTF-8 functions","what":"utf8_substr()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli = utf8_substr(uni, 2, 10), base = substr(uni, 2, 10), cli_vec = utf8_substr(vec_uni, 2, 10), base_vec = substr(vec_uni, 2, 10), cli_txt = utf8_substr(txt_uni, 2, 10), base_txt = substr(txt_uni, 2, 10), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 5.76µs 6.12µs 158909. 21.1KB 31.8 #> 2 base 980.92ns 1.02µs 929060. 0B 92.9 #> 3 cli_vec 29.32µs 30.04µs 32762. 1.7KB 6.55 #> 4 base_vec 7.66µs 7.86µs 124779. 848B 0 #> 5 cli_txt 5.79µs 6.16µs 158403. 0B 31.7 #> 6 base_txt 5.84µs 5.9µs 166578. 0B 16.7"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"session-info","dir":"Articles","previous_headings":"","what":"Session info","title":"ANSI function benchmarks","text":"","code":"sessioninfo::session_info() #> ─ Session info ───────────────────────────────────────────────────────── #> setting value #> version R version 4.4.1 (2024-06-14) #> os Ubuntu 22.04.5 LTS #> system x86_64, linux-gnu #> ui X11 #> language en #> collate C.UTF-8 #> ctype C.UTF-8 #> tz UTC #> date 2024-09-19 #> pandoc 3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/ (via rmarkdown) #> #> ─ Packages ───────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> bench 1.1.3 2023-05-04 [1] RSPM #> bslib 0.8.0 2024-07-29 [1] RSPM #> cachem 1.1.0 2024-05-16 [1] RSPM #> cli * 3.6.3.9000 2024-09-19 [1] local #> codetools 0.2-20 2024-03-31 [3] CRAN (R 4.4.1) #> desc 1.4.3 2023-12-10 [1] RSPM #> digest 0.6.37 2024-08-19 [1] RSPM #> evaluate 1.0.0 2024-09-17 [1] RSPM #> fansi * 1.0.6 2023-12-08 [1] RSPM #> fastmap 1.2.0 2024-05-15 [1] RSPM #> fs 1.6.4 2024-04-25 [1] RSPM #> glue 1.7.0 2024-01-09 [1] RSPM #> htmltools 0.5.8.1 2024-04-04 [1] RSPM #> htmlwidgets 1.6.4 2023-12-06 [1] RSPM #> jquerylib 0.1.4 2021-04-26 [1] RSPM #> jsonlite 1.8.8 2023-12-04 [1] RSPM #> knitr 1.48 2024-07-07 [1] RSPM #> lifecycle 1.0.4 2023-11-07 [1] RSPM #> magrittr 2.0.3 2022-03-30 [1] RSPM #> pillar 1.9.0 2023-03-22 [1] RSPM #> pkgconfig 2.0.3 2019-09-22 [1] RSPM #> pkgdown 2.1.1 2024-09-17 [1] any (@2.1.1) #> profmem 0.6.0 2020-12-13 [1] RSPM #> R6 2.5.1 2021-08-19 [1] RSPM #> ragg 1.3.3 2024-09-11 [1] RSPM #> rlang 1.1.4 2024-06-04 [1] RSPM #> rmarkdown 2.28 2024-08-17 [1] RSPM #> sass 0.4.9 2024-03-15 [1] RSPM #> sessioninfo 1.2.2 2021-12-06 [1] RSPM #> systemfonts 1.1.0 2024-05-15 [1] RSPM #> textshaping 0.4.0 2024-05-24 [1] RSPM #> tibble 3.2.1 2023-03-20 [1] RSPM #> utf8 1.2.4 2023-10-22 [1] RSPM #> vctrs 0.6.5 2023-12-01 [1] RSPM #> xfun 0.47 2024-08-17 [1] RSPM #> yaml 2.3.10 2024-07-26 [1] RSPM #> #> [1] /home/runner/work/_temp/Library #> [2] /opt/R/4.4.1/lib/R/site-library #> [3] /opt/R/4.4.1/lib/R/library #> #> ────────────────────────────────────────────────────────────────────────"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"asciicast","dir":"Articles","previous_headings":"Internal environment variables","what":"ASCIICAST","title":"Configuration (internal)","text":"Used detect asciicast sub-process RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"ansicon","dir":"Articles","previous_headings":"Internal environment variables","what":"ANSICON","title":"Configuration (internal)","text":"Used detect ANSICON detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"ci","dir":"Articles","previous_headings":"Internal environment variables","what":"CI","title":"Configuration (internal)","text":"Used detect code running CI. yes, avoid ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_debug_bad_end","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_DEBUG_BAD_END","title":"Configuration (internal)","text":"Whether warn cli_end() calls container close.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_no_builtin_theme","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_NO_BUILTIN_THEME","title":"Configuration (internal)","text":"Set true omit builtin theme.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_speed_time","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_SPEED_TIME","title":"Configuration (internal)","text":"Can used speed cli’s timer. factor, e.g. setting 2 makes cli’s time go twice fast.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_tick_time","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_TICK_TIME","title":"Configuration (internal)","text":"often cli timer alert, milliseconds.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cmder_root","dir":"Articles","previous_headings":"Internal environment variables","what":"CMDER_ROOT","title":"Configuration (internal)","text":"Used detect cmder detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"colorterm","dir":"Articles","previous_headings":"Internal environment variables","what":"COLORTERM","title":"Configuration (internal)","text":"Used detecting ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"conemuansi","dir":"Articles","previous_headings":"Internal environment variables","what":"ConEmuANSI","title":"Configuration (internal)","text":"Used detect ConEmu detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"emacs","dir":"Articles","previous_headings":"Internal environment variables","what":"EMACS","title":"Configuration (internal)","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"inside_emacs","dir":"Articles","previous_headings":"Internal environment variables","what":"INSIDE_EMACS","title":"Configuration (internal)","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"not_cran","dir":"Articles","previous_headings":"Internal environment variables","what":"NOT_CRAN","title":"Configuration (internal)","text":"Set true run tests / examples / checks, run CRAN.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_check_package_name_","dir":"Articles","previous_headings":"Internal environment variables","what":"_R_CHECK_PACKAGE_NAME_","title":"Configuration (internal)","text":"Used detect R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_browser","dir":"Articles","previous_headings":"Internal environment variables","what":"R_BROWSER","title":"Configuration (internal)","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_gui_app_version","dir":"Articles","previous_headings":"Internal environment variables","what":"R_GUI_APP_VERSION","title":"Configuration (internal)","text":"Used detect R.app macOS, decide console ANSI control sequences.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_package_dir","dir":"Articles","previous_headings":"Internal environment variables","what":"R_PACKAGE_DIR","title":"Configuration (internal)","text":"Used detect code running R CMD INSTALL.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_pdfviewer","dir":"Articles","previous_headings":"Internal environment variables","what":"R_PDFVIEWER","title":"Configuration (internal)","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_progress_no_examples","dir":"Articles","previous_headings":"Internal environment variables","what":"R_PROGRESS_NO_EXAMPLES","title":"Configuration (internal)","text":"Set true avoid running examples, outside R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO","title":"Configuration (internal)","text":"Used detect RStudio, various functions.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio_console_color","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO_CONSOLE_COLOR","title":"Configuration (internal)","text":"Used detect number colors RStudio. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio_console_width","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO_CONSOLE_WIDTH","title":"Configuration (internal)","text":"Used auto-detect console width RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio_term","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO_TERM","title":"Configuration (internal)","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"teamcity_version","dir":"Articles","previous_headings":"Internal environment variables","what":"TEAMCITY_VERSION","title":"Configuration (internal)","text":"Used detect TeamCity CI, turn ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"term","dir":"Articles","previous_headings":"Internal environment variables","what":"TERM","title":"Configuration (internal)","text":"Used detect console ANSI control sequences, terminal.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"term_program","dir":"Articles","previous_headings":"Internal environment variables","what":"TERM_PROGRAM","title":"Configuration (internal)","text":"Used detect iTerm dark theme detection ANSI hyperlink support detection.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"term_program_version","dir":"Articles","previous_headings":"Internal environment variables","what":"TERM_PROGRAM_VERSION","title":"Configuration (internal)","text":"Used detect suitable iTerm version ANSI hyperlink support.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"testthat","dir":"Articles","previous_headings":"Internal environment variables","what":"TESTTHAT","title":"Configuration (internal)","text":"Used detect running testthat tests.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"vte_version","dir":"Articles","previous_headings":"Internal environment variables","what":"VTE_VERSION","title":"Configuration (internal)","text":"Used detect suitable VTE version ANSI hyperlinks.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli__pb","dir":"Articles","previous_headings":"Internal options","what":"cli__pb","title":"Configuration (internal)","text":"option set progress bar updated, interpolating format string.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli-record","dir":"Articles","previous_headings":"Internal options","what":"cli.record","title":"Configuration (internal)","text":"Internal option mark state cli recording messages.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"crayon-colors","dir":"Articles","previous_headings":"Internal options","what":"crayon.colors","title":"Configuration (internal)","text":"Deprecated option number ANSI colors, still supported cli, new options set. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"crayon-enabled","dir":"Articles","previous_headings":"Internal options","what":"crayon.enabled","title":"Configuration (internal)","text":"Deprecated option turn ANSI colors /. still supported cli new options set. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"crayon-hyperlink","dir":"Articles","previous_headings":"Internal options","what":"crayon.hyperlink","title":"Configuration (internal)","text":"Whether assume ANSI hyperlink support. See [ansi_has_hyperlink_support()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"knitr-in-progress","dir":"Articles","previous_headings":"Internal options","what":"knitr.in.progress","title":"Configuration (internal)","text":"Used detect knitr detecting interactive sessions ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio-notebook-executing","dir":"Articles","previous_headings":"Internal options","what":"rstudio.notebook.executing","title":"Configuration (internal)","text":"Used detect knitr detecting interactive sessions.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_hyperlink_mode","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_HYPERLINK_MODE","title":"Configuration","text":"Set posix force generating POSIX compatible ANSI hyperlinks. set, RStudio compatible links generated. temporary crutch RStudio handles POSIX hyperlinks correctly, removed.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"no_color","dir":"Articles","previous_headings":"User facing environment variables","what":"NO_COLOR","title":"Configuration","text":"Set nonempty value turn ANSI colors. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"ess_background_mode","dir":"Articles","previous_headings":"User facing environment variables","what":"ESS_BACKGROUND_MODE","title":"Configuration","text":"Set environment variable light dark indicate dark mode Emacs. https://github.com/emacs-ess/ESS/pull/1178 merged, ESS set automatically.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_dynamic","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_DYNAMIC","title":"Configuration","text":"Set true, TRUE True assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See [is_dynamic_tty()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_num_colors","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_NUM_COLORS","title":"Configuration","text":"Set positive integer assume given number colors. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_hyperlinks","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_HYPERLINKS","title":"Configuration","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See [style_hyperlink()].","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-ansi","dir":"Articles","previous_headings":"User facing options","what":"cli.ansi","title":"Configuration","text":"Set true, TRUE True assume terminal supports ANSI control sequences. Set anything else assume non-ANSI terminal. See [is_ansi_tty()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-condition_unicode_bullets","dir":"Articles","previous_headings":"User facing options","what":"cli.condition_unicode_bullets","title":"Configuration","text":"TRUE FALSE force turn Unicode symbols printing conditions. E.g. format_error(), format_warning(), format_message() also cli_abort(), cli_warn() cli_inform().","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-condition_width","dir":"Articles","previous_headings":"User facing options","what":"cli.condition_width","title":"Configuration","text":"Integer scalar (Inf) set console width cli formatting errors, warnings messages format_error(), format_warning() format_message(). formatting conditions option takes precedence cli.width.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-default_handler","dir":"Articles","previous_headings":"User facing options","what":"cli.default_handler","title":"Configuration","text":"General handler function cli conditions. See https://cli.r-lib.org/articles/semantic-cli.html#cli-messages-1","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-default_num_colors","dir":"Articles","previous_headings":"User facing options","what":"cli.default_num_colors","title":"Configuration","text":"Default number ANSI colors. value used number colors already set * cli.num_colors option, * R_CLI_NUM_COLORS environment variable, * crayon.enabled crayon.colors options, * NO_COLOR environment variable, * knitr..progress option, * sink() call stream. can also use option color support detected correctly, want adjust number colors. E.g. * crayon.enabled TRUE, crayon.colors , * Emacs Windows, * terminals. See [num_ansi_colors()]. See also cli.num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-dynamic","dir":"Articles","previous_headings":"User facing options","what":"cli.dynamic","title":"Configuration","text":"Set TRUE assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See [is_dynamic_tty()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-hide_cursor","dir":"Articles","previous_headings":"User facing options","what":"cli.hide_cursor","title":"Configuration","text":"Whether cli status bar try hide cursor terminals. Set FALSE hidden cursor causes issues.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-hyperlink","dir":"Articles","previous_headings":"User facing options","what":"cli.hyperlink","title":"Configuration","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See [style_hyperlink()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-ignore_unknown_rstudio_theme","dir":"Articles","previous_headings":"User facing options","what":"cli.ignore_unknown_rstudio_theme","title":"Configuration","text":"Set TRUE omit warning unknown RStudio theme code_highlight().","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-num_colors","dir":"Articles","previous_headings":"User facing options","what":"cli.num_colors","title":"Configuration","text":"Number ANSI colors. See [num_ansi_colors()]. See also cli.default_num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-message_class","dir":"Articles","previous_headings":"User facing options","what":"cli.message_class","title":"Configuration","text":"Character vector classes add cli’s conditions.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_bar_style","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_bar_style","title":"Configuration","text":"Progress bar style. See [cli_progress_styles()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_bar_style_ascii","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_bar_style_ascii","title":"Configuration","text":"Progress bar style ASCII consoles. See [cli_progress_styles()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_bar_style_unicode","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_bar_style_unicode","title":"Configuration","text":"Progress bar style Unicode (UTF-8) consoles; See [cli_progress_styles()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_clear","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_clear","title":"Configuration","text":"Whether clear terminated progress bar screen dynamic terminals. See [cli_progress_bar()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_demo_live","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_demo_live","title":"Configuration","text":"Whether cli_progress_demo() show live demo, just record progress bar frames.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_download","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_download","title":"Configuration","text":"Default format string download progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_download_nototal","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_download_nototal","title":"Configuration","text":"Default format string download progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_iterator","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_iterator","title":"Configuration","text":"Default format string iterator progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_iterator_nototal","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_iterator_nototal","title":"Configuration","text":"Default format string iterator progress bars unknown total number progress units.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_tasks","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_tasks","title":"Configuration","text":"Default format string tasks progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_tasks_nototal","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_tasks_nototal","title":"Configuration","text":"Default format string tasks progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_handlers","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_handlers","title":"Configuration","text":"Progress handlers try. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_handlers_force","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_handlers_force","title":"Configuration","text":"Progress handlers always used, even another handler already selected. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_handlers_only","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_handlers_only","title":"Configuration","text":"Progress handlers force, ignoring handlers set cli.progress_handlers cli.progress_handlers_force. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_say_args","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_say_args","title":"Configuration","text":"Command line arguments say progress handlers. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_say_command","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_say_command","title":"Configuration","text":"External command use say progress handler. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_say_frequency","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_say_frequency","title":"Configuration","text":"Minimum delay say calls say progress handler. say ignores frequent updates, keep speech comprehensible. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_show_after","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_show_after","title":"Configuration","text":"Delay showing progress bar, seconds. Progress bars finish delay shown . cli also shows progress bars 50% go half delay passed.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-spinner","dir":"Articles","previous_headings":"User facing options","what":"cli.spinner","title":"Configuration","text":"Default spinner use, see [get_spinner()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-spinner_ascii","dir":"Articles","previous_headings":"User facing options","what":"cli.spinner_ascii","title":"Configuration","text":"Default spinner use ASCII terminals, see [get_spinner()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-spinner_unicode","dir":"Articles","previous_headings":"User facing options","what":"cli.spinner_unicode","title":"Configuration","text":"Default spinner use Unicode terminals, see [get_spinner()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-theme","dir":"Articles","previous_headings":"User facing options","what":"cli.theme","title":"Configuration","text":"Default cli theme, addition built-theme. option intended package developers. See [themes] [start_app()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-theme_dark","dir":"Articles","previous_headings":"User facing options","what":"cli.theme_dark","title":"Configuration","text":"Whether cli assume dark theme builtin theme. See [builtin_theme()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-unicode","dir":"Articles","previous_headings":"User facing options","what":"cli.unicode","title":"Configuration","text":"Whether assume Unicode terminal. set, auto-detected. See [is_utf8_output()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-user_theme","dir":"Articles","previous_headings":"User facing options","what":"cli.user_theme","title":"Configuration","text":"cli user theme. option intended end users. See [themes].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-warn_inline_newlines","dir":"Articles","previous_headings":"User facing options","what":"cli.warn_inline_newlines","title":"Configuration","text":"Whether emit warning cli replaces newline characters spaces within {.class } inline style. Defaults FALSE.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-width","dir":"Articles","previous_headings":"User facing options","what":"cli.width","title":"Configuration","text":"Terminal width assume. set, auto-detected. See [console_width()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"rlib_interactive","dir":"Articles","previous_headings":"User facing options","what":"rlib_interactive","title":"Configuration","text":"Whether assume interactive R session. set, auto-detected.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"width","dir":"Articles","previous_headings":"User facing options","what":"width","title":"Configuration","text":"Terminal width. used platforms, cli.width set.","code":""},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"built-in-palettes","dir":"Articles","previous_headings":"","what":"Built-in palettes","title":"cli color palettes","text":"vignette demonstrates various palettes included package look like easy visual reference. See ?ansi_palettes reference source use {cli}.","code":""},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"dichro","dir":"Articles","previous_headings":"Built-in palettes","what":"dichro","title":"cli color palettes","text":"Colorblind friendly palette, https://github.com/romainl/vim-dichromatic#dichromatic.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"vga","dir":"Articles","previous_headings":"Built-in palettes","what":"vga","title":"cli color palettes","text":"Typical colors used booting PCs leaving text mode, used 16-entry color table. colors different EGA/VGA graphic modes. https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"winxp","dir":"Articles","previous_headings":"Built-in palettes","what":"winxp","title":"cli color palettes","text":"Windows XP Console. Seen Windows XP Windows 8.1. https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"vscode","dir":"Articles","previous_headings":"Built-in palettes","what":"vscode","title":"cli color palettes","text":"Visual Studio Debug console, ‘Dark+’ theme. https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"win10","dir":"Articles","previous_headings":"Built-in palettes","what":"win10","title":"cli color palettes","text":"Campbell theme, used Windows 10 version 1709. Also usedby PowerShell 6.https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"macos","dir":"Articles","previous_headings":"Built-in palettes","what":"macos","title":"cli color palettes","text":"Terminal.app macOSFrom https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"putty","dir":"Articles","previous_headings":"Built-in palettes","what":"putty","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"mirc","dir":"Articles","previous_headings":"Built-in palettes","what":"mirc","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"xterm","dir":"Articles","previous_headings":"Built-in palettes","what":"xterm","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"ubuntu","dir":"Articles","previous_headings":"Built-in palettes","what":"ubuntu","title":"cli color palettes","text":"virtual terminals, /etc/vtrgb.https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"eclipse","dir":"Articles","previous_headings":"Built-in palettes","what":"eclipse","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-pastel","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-pastel","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-smoooooth","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-smoooooth","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-snazzy","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-snazzy","title":"cli color palettes","text":"https://github.com/sindresorhus/iterm2-snazzy.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-solarized","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-solarized","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-tango","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-tango","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"cli pluralization","text":"cli tools create messages printed correctly singular plural forms. usually requires minimal extra work, increases quality messages greatly. document first show pluralization examples can use guidelines. Hopefully intuitive enough, can used without knowing exact cli pluralization rules. need pluralization without semantic cli functions, see pluralize() function.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"pluralization-markup","dir":"Articles","previous_headings":"Examples","what":"Pluralization markup","title":"cli pluralization","text":"simplest case message contains single {} glue substitution, specifies quantity used select singular plural forms. Pluralization uses markup similar glue, uses {? } delimiters: value nfile used decide whether singular plural form file used. common case English messages.","code":"library(cli) nfile <- 0; cli_text(\"Found {nfile} file{?s}.\") #> Found 0 files. nfile <- 1; cli_text(\"Found {nfile} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {nfile} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"irregular-plurals","dir":"Articles","previous_headings":"Examples","what":"Irregular plurals","title":"cli pluralization","text":"plural form difficult simple s suffix, singular plural forms can given, separated forward slash:","code":"ndir <- 1; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 1 directory. ndir <- 5; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 5 directories."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"use-no-instead-of-zero","dir":"Articles","previous_headings":"Examples","what":"Use \"no\" instead of zero","title":"cli pluralization","text":"readability, better use () helper function include count message. () prints word \"\" count zero, prints numeric count otherwise:","code":"nfile <- 0; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found no files. nfile <- 1; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"use-the-length-of-character-vectors","dir":"Articles","previous_headings":"Examples","what":"Use the length of character vectors","title":"cli pluralization","text":"auto-collapsing feature cli easy include list objects message. cli interprets character vector pluralization quantity, takes length vector: Note length used non-numeric vectors (.numeric(x) return FALSE). want use length numeric vector, convert character via .character(). can combine collapsed vectors \"\", like : pluralization markup contains three alternatives, like , first one used zero, second one, third one larger quantities.","code":"pkgs <- \"pkg1\" cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1 package. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. pkgs <- character() cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove no packages. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"choosing-the-right-quantity","dir":"Articles","previous_headings":"Examples","what":"Choosing the right quantity","title":"cli pluralization","text":"text contains multiple glue {} substitutions, one right pluralization markup used. example: sometimes correct one. can explicitly specify correct quantity using qty() function. sets quantity without printing anything: Note message contains single {} substitution, may appear pluralization markup. message contains multiple {} substitutions pluralization markup, error thrown. Similarly, message contains {} substitutions , pluralization markup, error thrown.","code":"nfiles <- 3; ndirs <- 1 cli_text(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}\") #> Found 3 files and 1 directory nupd <- 3; ntotal <- 10 cli_text(\"{nupd}/{ntotal} {qty(nupd)} file{?s} {?needs/need} updates\") #> 3/10 files need updates"},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"rules","dir":"Articles","previous_headings":"","what":"Rules","title":"cli pluralization","text":"exact rules cli pluralization. two sets rules. first set specifies quantity associated {?} pluralization markup. second set describes {?} parsed interpreted.","code":""},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"quantities","dir":"Articles","previous_headings":"Rules","what":"Quantities","title":"cli pluralization","text":"{} substitutions define quantities. value {} substitution numeric (.numeric(x) holds), length one define quantity. enforced {} substitution used pluralization. quantity defined value {} , rounded .integer(). value {} numeric, quantity defined length. message {?} markup {} substitution, error thrown. message exactly one {} substitution, value used pluralization quantity {?} markup message. message multiple {} substitutions, {?} markup cli uses quantity {} substitution precedes . message multiple {} substitutions pluralization markup without preceding {} substitution, error thrown.","code":""},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"pluralization-markup-1","dir":"Articles","previous_headings":"Rules","what":"Pluralization markup","title":"cli pluralization","text":"Pluralization markup starts {? ends }. may contain { } characters, may contain {} substitutions either. Alternative words suffixes separated /. single alternative, nothing used quantity == 1 single alternative used quantity != 1. two alternatives, first one used quantity == 1, second one quantity != 1 (including `quantity == 0). three alternatives, first one used quantity == 0, second one quantity == 1, third one otherwise.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"overhead","dir":"Articles","previous_headings":"","what":"Overhead","title":"Advanced cli progress bars","text":"cli progress bars overhead may may significant use case. R API, tight loop, update progress bar often.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"minimizing-overhead","dir":"Articles","previous_headings":"Overhead","what":"Minimizing overhead","title":"Advanced cli progress bars","text":"minimize progress bar overhead, cli_progress_update() uses internal timer update progress bar screen timer due. C code, can refer timer directly avoid update. CLI_SHOULD_TICK macro evaluates one timer due update needed, otherwise zero. CLI_SHOULD_TICK works already created cli progress bar C, called cli_progress_init_timer(). latter initializes cli timer without creating progress bar. (timer initialized, CLI_SHOULD_TICK evaluates zero.)","code":"SEXP bar = PROTECT(cli_progress_bar(num_iters, NULL)); for (i = 0; i < num_iters; i++) { if (CLI_SHOULD_TICK) cli_progress_set(bar, i); // ... } cli_progress_done(bar);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"non-interactive-r-sessions","dir":"Articles","previous_headings":"","what":"Non-interactive R sessions","title":"Advanced cli progress bars","text":"cli output different terminal platform dynamic, .e. support \\r character move cursor beginning line without starting new line. often happens R running non-interactively standard error redirected file. cli uses cli::is_dynamic_tty() function determine output supports \\r. non-dynamic terminal, cli simply prints progress updates new lines screen. Frequently updating progress fashion produce lot output, non-dynamic terminals cli falls back slower timer update interval. default cli timer signals every 3000 milliseconds R session without dynamic terminal, instead 200 milliseconds.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"progress-bars-in-scripts","dir":"Articles","previous_headings":"","what":"Progress bars in scripts","title":"Advanced cli progress bars","text":"can use progress bars R scripts, just like use R packages. R script might create progress bar global environment, instead within function call. global environment also current progress bar, create progress bar global environment, previous one environment terminated. However, function return , last progress bar script terminated script terminates, explicitly terminate using cli_progress_done().","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"customization","dir":"Articles","previous_headings":"","what":"Customization","title":"Advanced cli progress bars","text":"cli progress bars can customized developer end user, setting options, providing function arguments regular cli themes. aspects can customized developer, others can customized end user. Others can customized , end user’s setting taking precedence.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"about-progress-bar-types","dir":"Articles","previous_headings":"Customization > Developer customization","what":"About progress bar types","title":"Advanced cli progress bars","text":"progress bar type default display (format string), can configured end user. current progress bar types , default display, known unknown number total progress units.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"iterator","dir":"Articles","previous_headings":"Customization > Developer customization","what":"iterator","title":"Advanced cli progress bars","text":"Typically loops mapping functions. shows bar default, total number iterations known.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"tasks","dir":"Articles","previous_headings":"Customization > Developer customization","what":"tasks","title":"Advanced cli progress bars","text":"list tasks, default shows current/total display.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"download","dir":"Articles","previous_headings":"Customization > Developer customization","what":"download","title":"Advanced cli progress bars","text":"downloads, progress units shown bytes default .","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom","dir":"Articles","previous_headings":"Customization > Developer customization","what":"custom","title":"Advanced cli progress bars","text":"custom displays, developer specify format string custom progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-format-strings-by-the-developer","dir":"Articles","previous_headings":"Customization > Developer customization","what":"Custom format strings (by the developer)","title":"Advanced cli progress bars","text":"developer can specify custom format string progress bar. custom progress bars, compulsory. Format strings may use glue templating, cli pluralization cli theming. can also use number built-cli progress variables, see ‘Progress variables’ . custom progress bars cli always uses specified format string. types, end user might customize format string, see .","code":"f <- function() { cli_progress_bar( total = 20000, format = \"Step {step} | {pb_bar} {pb_percent}\" ) step <- 1 for (i in 1:10000) { Sys.sleep(2/10000) cli_progress_update(set = i) } step <- 2 for (i in 10001:20000) { Sys.sleep(2/10000) cli_progress_update(set = i) } } f()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"quick-loops","dir":"Articles","previous_headings":"Customization > End user customization","what":"Quick loops","title":"Advanced cli progress bars","text":"cli.progress_show_after (default two seconds) option number seconds wait showing progress bar.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-bars","dir":"Articles","previous_headings":"Customization > End user customization","what":"Custom bars","title":"Advanced cli progress bars","text":"end user can customize progress bar look, setting one following options: cli.progress_bar_style cli.progress_bar_style_unicode cli.progress_bar_style_ascii UTF-8 displays cli.progress_bar_style_unicode used, set. Otherwise cli.progress_bar_style used. non UTF-8 displays cli.progress_bar_style_ascii used, set. Otherwise cli.progress_bar_style used. options can set built-progress bar style name: Alternatively, can set list entries complete, incomplete current, specify characters (strings) parts progress bar:","code":"names(cli_progress_styles()) #> [1] \"classic\" \"squares\" \"dot\" \"fillsquares\" \"bar\" options(cli.progress_bar_style = \"fillsquares\") f <- function() lapply(cli_progress_along(letters), function(l) Sys.sleep(0.2)) x <- f() options(cli.progress_bar_style = list( complete = cli::col_yellow(\"\\u2605\"), incomplete = cli::col_grey(\"\\u00b7\") )) f <- function() lapply(cli_progress_along(letters), function(l) Sys.sleep(0.2)) x <- f()"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-spinners","dir":"Articles","previous_headings":"Customization > End user customization","what":"Custom spinners","title":"Advanced cli progress bars","text":"Options customize cli spinners: cli.spinner cli.spinner_unicode cli.spinner_ascii UTF-8 displays cli.spinner_unicode used, set, otherwise cli.spinner. ASCII displays cli.spinner_ascii used, set, otherwise cli.spinner. Use list_spinners() list spinners demo_spinners() take peek .","code":"options(cli.spinner = \"moon\") f <- function() { cli_progress_bar(format = strrep(\"{cli::pb_spin} \", 20), clear = TRUE) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-format-strings","dir":"Articles","previous_headings":"Customization > End user customization","what":"Custom format strings","title":"Advanced cli progress bars","text":"end user may use number global options customize built-progress bar types displayed screen: cli.progress_format_iterator used iterator progress bars. cli.progress_format_iterator_nototal used iterator progress bars unknown number total units. cli.progress_format_tasks used tasks progress bars. cli.progress_format_tasks_nototal used tasks progress bars unknown number total units. cli.progress_format_download used download progress bars. cli.progress_format_download_nototal used download progress bars unknown number total units.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"progress-variables","dir":"Articles","previous_headings":"Customization","what":"Progress variables","title":"Advanced cli progress bars","text":"Custom format strings may use progress variables glue interpolated expressions, refer state progress bar. See ?\"progress-variables\" manual list supported variables. refer progress variable package, need need import qualify reference cli::. set custom format string end user option, suggest always use qualified form, case cli package attached. example, set minimal display downloads might write get can use expressions functions progress bar tokens. E.g. show current number steps letters instead numbers, use letters[pb_current]:","code":"options(cli.progress_format_download = paste0( \"{cli::col_cyan('\\u2B07')} {cli::pb_spin} \", \"{cli::pb_name}[{cli::pb_current_bytes}/{cli::pb_total_bytes}]\" ) ) f <- function() { cli_progress_bar( total = 26, format = \"{pb_spin} This is step {.emph {letters[pb_current]}}. {pb_spin}\" ) for (i in 1:26) { Sys.sleep(3/26) cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"clearing-or-keeping-terminated-progress-bars","dir":"Articles","previous_headings":"Customization","what":"Clearing or keeping terminated progress bars","title":"Advanced cli progress bars","text":"default terminated progress bars removed screen. end user can set cli.progress_clear option FALSE override default. addition, developer can also change default, using clear parameter cli_progress_bar(). option parameter set, parameter used.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"the-c-api","dir":"Articles","previous_headings":"","what":"The C API","title":"Advanced cli progress bars","text":"use C cli progress API package, need add cli LinkingTo Imports: C files want use API include cli/progress.h: Now ready call cli functions. C API similar traditional R API: cli_progress_bar() creates progress bar. cli_progress_update() updates progress bar. cli_progress_done() terminates . complete example:","code":"LinkingTo: cli Imports: cli #include SEXP progress_test1() { int i; SEXP bar = PROTECT(cli_progress_bar(1000, NULL)); for (i = 0; i < 1000; i++) { cli_progress_sleep(0, 4 * 1000 * 1000); if (CLI_SHOULD_TICK) cli_progress_set(bar, i); } cli_progress_done(bar); UNPROTECT(1); return Rf_ScalarInteger(i); }"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_should_tick","dir":"Articles","previous_headings":"The C API > C API reference","what":"CLI_SHOULD_TICK","title":"Advanced cli progress bars","text":"macro evaluates (int) 1 cli progress bar update due, (int) 0 otherwise. timer hasn’t initialized compilation unit yet, always 0. initialize timer, call cli_progress_init_timer() create progress bar cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_add","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_add()","title":"Advanced cli progress bars","text":"Add number progress units progress bar. also trigger update update due. bar: progress bar object. inc: progress increment.","code":"void cli_progress_add(SEXP bar, double inc);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_bar","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_bar()","title":"Advanced cli progress bars","text":"Create new progress bar object. returned progress bar object must PROTECT()-ed. total: Total number progress units. Use NA_REAL known. config: R named list object additional parameters. May NULL (C NULL~) orR_NilValue(RNULL`) defaults. config may contain following entries: name: progress bar name. status: (initial) progress bar status. type: progress bar type. total: total number progress units. show_after: show progress bar specified number seconds. overrides global show_after option. format: format string, must specified custom progress bars. format_done: format string successful termination. format_failed: format string unsuccessful termination. clear: whether remove progress bar screen termination. auto_terminate: whether terminate progress bar number current units equals number total progress units.","code":"SEXP cli_progress_bar(double total, SEXP config);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"example","dir":"Articles","previous_headings":"The C API > C API reference > cli_progress_bar()","what":"Example","title":"Advanced cli progress bars","text":"","code":"#include SEXP progress_test1() { int i; SEXP bar = PROTECT(cli_progress_bar(1000, NULL)); for (i = 0; i < 1000; i++) { cli_progress_sleep(0, 4 * 1000 * 1000); if (CLI_SHOULD_TICK) cli_progress_set(bar, i); } cli_progress_done(bar); UNPROTECT(1); return Rf_ScalarInteger(i); }"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_done","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_done()","title":"Advanced cli progress bars","text":"Terminate progress bar. bar: progress bar object.","code":"void cli_progress_done(SEXP bar);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_init_timer","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_init_timer()","title":"Advanced cli progress bars","text":"Initialize cli timer without creating progress bar.","code":"void cli_progress_init_timer();"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_num","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_num()","title":"Advanced cli progress bars","text":"Returns number currently active progress bars.","code":"int cli_progress_num();"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set()","title":"Advanced cli progress bars","text":"Set progress bar specified number progress units. bar: progress bar object. set: number current progress progress units.","code":"void cli_progress_set(SEXP bar, double set);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_clear","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_clear()","title":"Advanced cli progress bars","text":"Set whether remove progress bar screen. can call time cli_progress_done() called. bar: progress bar object. clear: whether remove progress bar screen, zero one.","code":"void cli_progress_set_clear(SEXP bar, int clear);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_format","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_format()","title":"Advanced cli progress bars","text":"Set custom format string progress bar. call try update progress bar. want request update, call cli_progress_add(), cli_progress_set() cli_progress_update(). bar: progress bar object. format: format string. ...: values substitute format. format ... passed vsnprintf() create format string. Format strings may contain glue substitutions, referring progress variables, pluralization, cli styling.","code":"void cli_progress_set_format(SEXP bar, const char *format, ...);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_name","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_name()","title":"Advanced cli progress bars","text":"Set name progress bar. bar; progress bar object. name: progress bar name.","code":"void cli_progress_set_name(SEXP bar, const char *name);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_status","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_status()","title":"Advanced cli progress bars","text":"Set status progress bar. bar: progress bar object. status: progress bar status.","code":"void cli_progress_set_status(SEXP bar, const char *status);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_type","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_type()","title":"Advanced cli progress bars","text":"Set progress bar type. Call function right creating progress bar cli_progress_bar(). Otherwise behavior undefined. bar: progress bar object. type: progress bar type. Possible progress bar types: iterator, tasks, download custom.","code":"void cli_progress_set_type(SEXP bar, const char *type);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_update","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_update()","title":"Advanced cli progress bars","text":"Update progress bar. Unlike simpler cli_progress_add() cli_progress_set() function, can force update force set 1. bar: progress bar object. set: number current progress units. ignored negative. inc: increment add current number progress units. ignored set negative. force: whether force update, even update due. force update without changing current number progress units, supply set = -1, inc = 0 force = 1.","code":"void cli_progress_update(SEXP bar, double set, double inc, int force);"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"cli progress bar benchmark","text":"make sure timer TRUE, setting ten hours.","code":"library(cli) # 10 hours cli:::cli_tick_set(10 * 60 * 60 * 1000) cli_tick_reset() #> NULL `__cli_update_due` #> [1] FALSE"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"the-timer","dir":"Articles","previous_headings":"R benchmarks","what":"The timer","title":"cli progress bar benchmark","text":"","code":"fun <- function() NULL ben_st <- bench::mark( `__cli_update_due`, fun(), .Call(ccli_tick_reset), interactive(), check = FALSE ) ben_st #> # A tibble: 4 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 __cli_update_due 8.96ns 20ns 52709559. 0B 0 #> 2 fun() 130.04ns 160.1ns 4444554. 0B 0 #> 3 .Call(ccli_tick_reset) 99.88ns 119.9ns 8004264. 0B 0 #> 4 interactive() 8.85ns 19.9ns 49341663. 0B 0 ben_st2 <- bench::mark( if (`__cli_update_due`) foobar() ) ben_st2 #> # A tibble: 1 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 if (`__cli_update_due`) fooba… 40ns 50.1ns 20774999. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"cli_progress_along","dir":"Articles","previous_headings":"R benchmarks","what":"cli_progress_along()","title":"cli progress bar benchmark","text":"","code":"seq <- 1:100000 ta <- cli_progress_along(seq) bench::mark(seq[[1]], ta[[1]]) #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 seq[[1]] 110ns 140ns 5514945. 0B 0 #> 2 ta[[1]] 140ns 160ns 6008532. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"for-loop","dir":"Articles","previous_headings":"R benchmarks > cli_progress_along()","what":"for loop","title":"cli progress bar benchmark","text":"baseline: progress bars: Overhead per iteration:","code":"f0 <- function(n = 1e5) { x <- 0 seq <- 1:n for (i in seq) { x <- x + i %% 2 } x } fp <- function(n = 1e5) { x <- 0 seq <- 1:n for (i in cli_progress_along(seq)) { x <- x + seq[[i]] %% 2 } x } ben_taf <- bench::mark(f0(), fp()) ben_taf #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 12.1ms 12.2ms 82.2 21.6KB 384. #> 2 fp() 14.4ms 14.5ms 68.4 82.4KB 342. (ben_taf$median[2] - ben_taf$median[1]) / 1e5 #> [1] 23.2ns ben_taf2 <- bench::mark(f0(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_taf2 #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 144ms 157ms 5.79 0B 48.2 #> 2 fp(1e+06) 159ms 160ms 6.24 1.93KB 51.5 (ben_taf2$median[2] - ben_taf2$median[1]) / 1e6 #> [1] 3.5ns ben_taf3 <- bench::mark(f0(1e7), fp(1e7)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_taf3 #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+07) 1.51s 1.51s 0.660 0B 54.8 #> 2 fp(1e+07) 1.56s 1.56s 0.639 1.93KB 53.1 (ben_taf3$median[2] - ben_taf3$median[1]) / 1e7 #> [1] 5ns ben_taf4 <- bench::mark(f0(1e8), fp(1e8)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_taf4 #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+08) 14.4s 14.4s 0.0697 0B 34.8 #> 2 fp(1e+08) 15.7s 15.7s 0.0635 1.93KB 31.5 (ben_taf4$median[2] - ben_taf4$median[1]) / 1e8 #> [1] 13.9ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"mapping-with-lapply","dir":"Articles","previous_headings":"R benchmarks > cli_progress_along()","what":"Mapping with lapply()","title":"cli progress bar benchmark","text":"baseline: index vector: progress bars: Overhead per iteration:","code":"f0 <- function(n = 1e5) { seq <- 1:n ret <- lapply(seq, function(x) { x %% 2 }) invisible(ret) } f01 <- function(n = 1e5) { seq <- 1:n ret <- lapply(seq_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } fp <- function(n = 1e5) { seq <- 1:n ret <- lapply(cli_progress_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } ben_tam <- bench::mark(f0(), f01(), fp()) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_tam #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 84ms 90.4ms 10.6 781KB 23.0 #> 2 f01() 124.1ms 132.3ms 6.44 781KB 16.1 #> 3 fp() 94.4ms 104.2ms 8.74 783KB 12.2 (ben_tam$median[3] - ben_tam$median[1]) / 1e5 #> [1] 138ns ben_tam2 <- bench::mark(f0(1e6), f01(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_tam2 #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 831.95ms 831.95ms 1.20 7.63MB 3.61 #> 2 f01(1e+06) 1.01s 1.01s 0.989 7.63MB 5.93 #> 3 fp(1e+06) 1.39s 1.39s 0.722 7.63MB 4.33 (ben_tam2$median[3] - ben_tam2$median[1]) / 1e6 #> [1] 554ns (ben_tam2$median[3] - ben_tam2$median[2]) / 1e6 #> [1] 375ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"mapping-with-purrr","dir":"Articles","previous_headings":"R benchmarks > cli_progress_along()","what":"Mapping with purrr","title":"cli progress bar benchmark","text":"baseline: index vector: progress bars: Overhead per iteration:","code":"f0 <- function(n = 1e5) { seq <- 1:n ret <- purrr::map(seq, function(x) { x %% 2 }) invisible(ret) } f01 <- function(n = 1e5) { seq <- 1:n ret <- purrr::map(seq_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } fp <- function(n = 1e5) { seq <- 1:n ret <- purrr::map(cli_progress_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } ben_pur <- bench::mark(f0(), f01(), fp()) ben_pur #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 64.8ms 65.3ms 15.2 1.11MB 9.12 #> 2 f01() 81.3ms 81.6ms 12.1 781.3KB 6.07 #> 3 fp() 85.5ms 85.8ms 11.7 783.29KB 17.5 (ben_pur$median[3] - ben_pur$median[1]) / 1e5 #> [1] 205ns (ben_pur$median[3] - ben_pur$median[2]) / 1e5 #> [1] 41.9ns ben_pur2 <- bench::mark(f0(1e6), f01(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_pur2 #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 831.59ms 831.59ms 1.20 7.63MB 3.61 #> 2 f01(1e+06) 1.09s 1.09s 0.916 7.63MB 3.66 #> 3 fp(1e+06) 2.47s 2.47s 0.405 7.63MB 1.62 (ben_pur2$median[3] - ben_pur2$median[1]) / 1e6 #> [1] 1.64µs (ben_pur2$median[3] - ben_pur2$median[2]) / 1e6 #> [1] 1.38µs"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"ticking","dir":"Articles","previous_headings":"R benchmarks","what":"ticking()","title":"cli progress bar benchmark","text":"","code":"f0 <- function(n = 1e5) { i <- 0 x <- 0 while (i < n) { x <- x + i %% 2 i <- i + 1 } x } fp <- function(n = 1e5) { i <- 0 x <- 0 while (ticking(i < n)) { x <- x + i %% 2 i <- i + 1 } x } ben_tk <- bench::mark(f0(), fp()) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_tk #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 13.01ms 13.19ms 69.7 39.3KB 5.97 #> 2 fp() 4.18s 4.18s 0.239 99.9KB 3.11 (ben_tk$median[2] - ben_tk$median[1]) / 1e5 #> [1] 41.7µs"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"traditional-api","dir":"Articles","previous_headings":"R benchmarks","what":"Traditional API","title":"cli progress bar benchmark","text":"","code":"f0 <- function(n = 1e5) { x <- 0 for (i in 1:n) { x <- x + i %% 2 } x } fp <- function(n = 1e5) { cli_progress_bar(total = n) x <- 0 for (i in 1:n) { x <- x + i %% 2 cli_progress_update() } x } ff <- function(n = 1e5) { cli_progress_bar(total = n) x <- 0 for (i in 1:n) { x <- x + i %% 2 if (`__cli_update_due`) cli_progress_update() } x } ben_api <- bench::mark(f0(), ff(), fp()) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_api #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 11.88ms 12.86ms 67.0 18.7KB 7.89 #> 2 ff() 22.11ms 22.94ms 38.7 27.7KB 5.81 #> 3 fp() 2.25s 2.25s 0.443 25.2KB 3.10 (ben_api$median[3] - ben_api$median[1]) / 1e5 #> [1] 22.4µs (ben_api$median[2] - ben_api$median[1]) / 1e5 #> [1] 101ns ben_api2 <- bench::mark(f0(1e6), ff(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_api2 #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 127.2ms 139.4ms 6.87 0B 6.87 #> 2 ff(1e+06) 233.8ms 233.8ms 4.27 1.95KB 4.27 #> 3 fp(1e+06) 22.2s 22.2s 0.0450 1.95KB 2.66 (ben_api2$median[3] - ben_api2$median[1]) / 1e6 #> [1] 22.1µs (ben_api2$median[2] - ben_api2$median[1]) / 1e6 #> [1] 94.4ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"c-benchmarks","dir":"Articles","previous_headings":"","what":"C benchmarks","title":"cli progress bar benchmark","text":"Baseline function: Switch + modulo check: cli progress bar API:","code":"SEXP test_baseline() { int i; int res = 0; for (i = 0; i < 2000000000; i++) { res += i % 2; } return ScalarInteger(res); } SEXP test_modulo(SEXP progress) { int i; int res = 0; int progress_ = LOGICAL(progress)[0]; for (i = 0; i < 2000000000; i++) { if (i % 10000 == 0 && progress_) cli_progress_set(R_NilValue, i); res += i % 2; } return ScalarInteger(res); } SEXP test_cli() { int i; int res = 0; SEXP bar = PROTECT(cli_progress_bar(2000000000, NULL)); for (i = 0; i < 2000000000; i++) { if (CLI_SHOULD_TICK) cli_progress_set(bar, i); res += i % 2; } cli_progress_done(bar); UNPROTECT(1); return ScalarInteger(res); } SEXP test_cli_unroll() { int i = 0; int res = 0; SEXP bar = PROTECT(cli_progress_bar(2000000000, NULL)); int s, final, step = 2000000000 / 100000; for (s = 0; s < 100000; s++) { if (CLI_SHOULD_TICK) cli_progress_set(bar, i); final = (s + 1) * step; for (i = s * step; i < final; i++) { res += i % 2; } } cli_progress_done(bar); UNPROTECT(1); return ScalarInteger(res); } library(progresstest) ben_c <- bench::mark( test_baseline(), test_modulo(), test_cli(), test_cli_unroll() ) ben_c #> # A tibble: 4 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 test_baseline() 622.75ms 622.75ms 1.61 2.08KB 0 #> 2 test_modulo() 1.25s 1.25s 0.803 2.23KB 0 #> 3 test_cli() 1.25s 1.25s 0.803 23.91KB 0 #> 4 test_cli_unroll() 624.5ms 624.5ms 1.60 3.58KB 0 (ben_c$median[3] - ben_c$median[1]) / 2000000000 #> [1] 1ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"display-update","dir":"Articles","previous_headings":"","what":"Display update","title":"cli progress bar benchmark","text":"update display fixed number times per second. (Currently maximum five times per second.) Let’s measure long single update takes.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"iterator-with-a-bar","dir":"Articles","previous_headings":"Display update","what":"Iterator with a bar","title":"cli progress bar benchmark","text":"","code":"cli_progress_bar(total = 100000) bench::mark(cli_progress_update(force = TRUE), max_iterations = 10000) #> ■ 0% | ETA: 5m #> ■ 0% | ETA: 2h #> ■ 0% | ETA: 1h #> ■ 0% | ETA: 1h #> ■ 0% | ETA: 1h #> ■ 0% | ETA: 47m #> ■ 0% | ETA: 42m #> ■ 0% | ETA: 38m #> ■ 0% | ETA: 35m #> ■ 0% | ETA: 32m #> ■ 0% | ETA: 30m #> ■ 0% | ETA: 29m #> ■ 0% | ETA: 27m #> ■ 0% | ETA: 26m #> ■ 0% | ETA: 25m #> ■ 0% | ETA: 24m #> ■ 0% | ETA: 23m #> ■ 0% | ETA: 22m #> ■ 0% | ETA: 22m #> ■ 0% | ETA: 21m #> ■ 0% | ETA: 21m #> ■ 0% | ETA: 20m #> ■ 0% | ETA: 20m #> ■ 0% | ETA: 19m #> ■ 0% | ETA: 19m #> ■ 0% | ETA: 19m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> ■ 0% | ETA: 13m #> # A tibble: 1 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_progress_update(force = … 5.91ms 6.03ms 161. 1.41MB 2.04 cli_progress_done()"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"iterator-without-a-bar","dir":"Articles","previous_headings":"Display update","what":"Iterator without a bar","title":"cli progress bar benchmark","text":"","code":"cli_progress_bar(total = NA) bench::mark(cli_progress_update(force = TRUE), max_iterations = 10000) #> ⠙ 1 done (308/s) | 4ms #> ⠹ 2 done (64/s) | 32ms #> ⠸ 3 done (78/s) | 39ms #> ⠼ 4 done (89/s) | 46ms #> ⠴ 5 done (96/s) | 53ms #> ⠦ 6 done (102/s) | 60ms #> ⠧ 7 done (106/s) | 66ms #> ⠇ 8 done (110/s) | 74ms #> ⠏ 9 done (113/s) | 81ms #> ⠋ 10 done (115/s) | 87ms #> ⠙ 11 done (117/s) | 94ms #> ⠹ 12 done (119/s) | 101ms #> ⠸ 13 done (121/s) | 108ms #> ⠼ 14 done (122/s) | 115ms #> ⠴ 15 done (124/s) | 122ms #> ⠦ 16 done (125/s) | 129ms #> ⠧ 17 done (126/s) | 136ms #> ⠇ 18 done (127/s) | 143ms #> ⠏ 19 done (127/s) | 150ms #> ⠋ 20 done (128/s) | 157ms #> ⠙ 21 done (129/s) | 164ms #> ⠹ 22 done (130/s) | 170ms #> ⠸ 23 done (130/s) | 177ms #> ⠼ 24 done (131/s) | 184ms #> ⠴ 25 done (131/s) | 191ms #> ⠦ 26 done (132/s) | 198ms #> ⠧ 27 done (132/s) | 205ms #> ⠇ 28 done (132/s) | 212ms #> ⠏ 29 done (133/s) | 219ms #> ⠋ 30 done (133/s) | 226ms #> ⠙ 31 done (131/s) | 237ms #> ⠹ 32 done (131/s) | 245ms #> ⠸ 33 done (131/s) | 252ms #> ⠼ 34 done (131/s) | 260ms #> ⠴ 35 done (131/s) | 267ms #> ⠦ 36 done (131/s) | 275ms #> ⠧ 37 done (131/s) | 283ms #> ⠇ 38 done (131/s) | 291ms #> ⠏ 39 done (131/s) | 299ms #> ⠋ 40 done (131/s) | 306ms #> ⠙ 41 done (131/s) | 314ms #> ⠹ 42 done (131/s) | 321ms #> ⠸ 43 done (131/s) | 328ms #> ⠼ 44 done (131/s) | 335ms #> ⠴ 45 done (132/s) | 342ms #> ⠦ 46 done (132/s) | 349ms #> ⠧ 47 done (132/s) | 356ms #> ⠇ 48 done (132/s) | 363ms #> ⠏ 49 done (133/s) | 370ms #> ⠋ 50 done (133/s) | 377ms #> ⠙ 51 done (133/s) | 384ms #> ⠹ 52 done (133/s) | 391ms #> ⠸ 53 done (133/s) | 398ms #> ⠼ 54 done (133/s) | 405ms #> ⠴ 55 done (134/s) | 412ms #> ⠦ 56 done (134/s) | 419ms #> ⠧ 57 done (134/s) | 426ms #> ⠇ 58 done (134/s) | 433ms #> ⠏ 59 done (134/s) | 441ms #> ⠋ 60 done (134/s) | 448ms #> ⠙ 61 done (134/s) | 455ms #> ⠹ 62 done (134/s) | 462ms #> ⠸ 63 done (135/s) | 469ms #> ⠼ 64 done (135/s) | 476ms #> ⠴ 65 done (135/s) | 483ms #> ⠦ 66 done (135/s) | 490ms #> ⠧ 67 done (135/s) | 497ms #> ⠇ 68 done (135/s) | 504ms #> ⠏ 69 done (135/s) | 510ms #> ⠋ 70 done (135/s) | 518ms #> ⠙ 71 done (135/s) | 525ms #> ⠹ 72 done (136/s) | 532ms #> # A tibble: 1 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_progress_update(force = … 6.84ms 6.94ms 141. 265KB 2.02 cli_progress_done()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction to progress bars in cli","text":"document discusses structure simplest uses cli progress bar API. advanced usage C progress bar API, see ‘Advanced cli progress bars’ article manual pages. version 3.0.0 cli provides set functions create progress bars. main goals progress bar API : Reduce clutter. Try avoid verbose syntax, unless necessary. Flexibility R C/C++ code. Support cli features progress bars: glue interpolation, theming, pluralization, etc. Predictably small performance penalty. small constant penalty per iteration, reasonable penalty per second.","code":"library(cli) options(cli.progress_show_after = 0) options(cli.progress_clear = FALSE)"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"the-traditional-progress-bar-api","dir":"Articles","previous_headings":"","what":"The traditional progress bar API","title":"Introduction to progress bars in cli","text":"Add progress bar three steps: Call cli_progress_bar() add create progress bar. Call cli_progress_update() update . Call cli_progress_done() terminate . example: traditional API provides full control w.r.t create, update terminate progress bar.","code":"clean <- function() { cli_progress_bar(\"Cleaning data\", total = 100) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } cli_progress_done() } clean()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"the-current-progress-bar","dir":"Articles","previous_headings":"","what":"The current progress bar","title":"Introduction to progress bars in cli","text":"conciseness, progress bar functions refer current progress bar default. Every function one current progress bar time. current progress bar function terminated function creates another progress bar function returns, errors interrupted. current progress bar lets us omit cli_progress_done() call:","code":"clean <- function() { cli_progress_bar(\"Cleaning data #1\", total = 100) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } cli_progress_bar(\"Cleaning data #2\", total = 100) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } } clean()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"unknown-total-number-of-units","dir":"Articles","previous_headings":"","what":"Unknown total number of units","title":"Introduction to progress bars in cli","text":"cases total number progress units unknown, simply omit cli_progress_bar() (set NA). cli uses different display total unknown:","code":"walk_dirs <- function() { cli_progress_bar(\"Walking directories\") while (TRUE) { if (runif(1) < 0.01) break Sys.sleep(0.01) cli_progress_update() } cli_progress_update(force = TRUE) } walk_dirs()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"quick-loops","dir":"Articles","previous_headings":"","what":"Quick loops","title":"Introduction to progress bars in cli","text":"default, cli show progress bars terminated within two seconds creation. end user can configure limit cli.progress_show_after global option. example, document set limit zero seconds, progress bars shown first update.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"progress-bars-for-mapping-functions-cli_progress_along","dir":"Articles","previous_headings":"","what":"Progress bars for mapping functions: cli_progress_along()","title":"Introduction to progress bars in cli","text":"cli_progress_along() currently experimental. add progress bar call lapply() another mapping function, wrap input sequence cli_progress_along(): cli_progress_along() works similarly seq_along(), returns index vector. use cli_progress_along(), lapply() pass indices elements X fun, instead elements . cli_progress_along() expects index vector used , beginning end. best never assign return value cli_progress_along() variable. example: cli_progress_along() uses ALTREP, works R 3.5.0 later. older R versions equivalent seq_along() create progress bar.","code":"lapply(cli_progress_along(X), fun) f <- function() { rawabc <- lapply( cli_progress_along(letters), function(i) { charToRaw(letters[i]) Sys.sleep(0.5) } ) } f()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"for-loops","dir":"Articles","previous_headings":"Progress bars for mapping functions: cli_progress_along()","what":"for loops","title":"Introduction to progress bars in cli","text":"can also use cli_progress_along() loops, additional complication use break, might need terminate progress bar explicitly: cli_progress_done() always returns TRUE allow form. Alternatively, can terminate progress bar right loop: function containing loop returns loop, create another progress bar cli_progress_along() cli_progress_bar(), explicit cli_progress_done() needed.","code":"for (i in cli_progress_along(seq)) { ... if (cond) cli_progress_done() && break ... } for (i in cli_progress_along(seq)) { ... if (cond) break ... } cli_progress_done()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"simplified-api","dir":"Articles","previous_headings":"","what":"Simplified API","title":"Introduction to progress bars in cli","text":"Often don’t need full power progress bar API, want show status message. cli_progress_message() cli_progress_step() functions tailored . cli_progress_message() shows (potentially templated) message status bar. convenience, progress bar rules still apply default: Status messages removed calling function exits. status message removes previous status message progress bar caller function. Status messages may use glue interpolation, cli styling pluralization, usual. can call cli_progress_update() update status message. cli_progress_step() slightly different cli_progress_message(): * adds cli’s alert themes status messages (info, success danger), * prints duration step (default), * keeps messages screen terminated. usual, can use cli_progress_step() update existing status message. can update status message frequently enough, can also add spinner : cli_progress_step() automatically handles errors, styles status message accordingly:","code":"f <- function() { cli_progress_message(\"Task one is running...\") Sys.sleep(2) cli_progress_message(\"Task two is running...\") Sys.sleep(2) step <- 1L cli_progress_message(\"Task three is underway: step {step}\") for (step in 1:5) { Sys.sleep(0.5) cli_progress_update() } } f() f <- function() { cli_progress_step(\"Downloading data\") Sys.sleep(2) cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\") Sys.sleep(3) } f() f <- function(n = 10) { cli_alert_info(\"About to start downloads of {n} file{?s}\") i <- 0 cli_progress_step(\"Got {i}/{n} {qty(i)}file{?s}.\") for (i in seq_len(n)) { Sys.sleep(0.5) if (i == 5) cli_alert_info(\"Already half way!\") cli_progress_update() } } f() f <- function() { cli_progress_step(\"Downloading data\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(2/100) } cli_progress_step(\"Importing data\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(1/100) } cli_progress_step(\"Cleaning data\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(2/100) } cli_progress_step(\"Fitting model\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(3/100) } } f() f <- function() { cli_progress_step(\"First step, this will succeed\") Sys.sleep(1) cli_progress_step(\"Second step, this will fail\") Sys.sleep(1) stop(\"Something is wrong here\") } f()"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Building a Semantic CLI","text":"cli package helps build command line interface (CLI) without getting lost details (colors, wrapping, spacing, etc.) piece output formatted. Instead, can build command line output semantic elements: lists, alerts, quotes code blocks, headers, etc. formatting element specified separately, one cli themes. cli comes builtin theme, satisfied , never need worry formatting. semantic cli similar HTML CSS work together create web site. introduction go functions create semantic CLI elements, also common features .","code":""},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"building-a-command-line-interface","dir":"Articles","previous_headings":"","what":"Building a command line interface","title":"Building a Semantic CLI","text":"build CLI, can simply start using cli_* functions create various CLI elements. exact formatting depends current theme, see ‘Theming’ .","code":"library(cli)"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"alerts","dir":"Articles","previous_headings":"Building a command line interface","what":"Alerts","title":"Building a Semantic CLI","text":"Alerts typically short messages. cli four types alerts (success, info, warning, danger) also generic alert type:","code":"cli_alert_success(\"Updated database.\") #> ✔ Updated database. cli_alert_info(\"Reopened database.\") #> ℹ Reopened database. cli_alert_warning(\"Cannot reach GitHub, using local database cache.\") #> ! Cannot reach GitHub, using local database cache. cli_alert_danger(\"Failed to connect to database.\") #> ✖ Failed to connect to database. cli_alert(\"A generic alert\") #> → A generic alert"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"text","dir":"Articles","previous_headings":"Building a command line interface","what":"Text","title":"Building a Semantic CLI","text":"Text automatically wrapped terminal width. Text may ANSI style markup,","code":"cli_text(cli:::lorem_ipsum()) #> Lorem ad ipsum veniam esse nisi deserunt duis. Qui incididunt elit elit mollit #> sint nulla consectetur aute commodo do elit laboris minim et. Laboris ipsum #> mollit voluptate et non do incididunt eiusmod. Anim consectetur mollit laborum #> occaecat eiusmod excepteur. Ullamco non tempor esse anim tempor magna non."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"paragraphs","dir":"Articles","previous_headings":"Building a command line interface","what":"Paragraphs","title":"Building a Semantic CLI","text":"Paragraphs break output. default theme inserts empty line paragraphs, single empty line added two paragraphs. cli_end() closes latest open paragraph (open container).","code":"fun <- function() { cli_par() cli_text(\"This is some text.\") cli_text(\"Some more text.\") cli_end() cli_par() cli_text(\"Already a new paragraph.\") cli_end() } fun() #> This is some text. #> Some more text. #> #> Already a new paragraph. #>"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"auto-closing-containers","dir":"Articles","previous_headings":"Building a command line interface","what":"Auto-closing containers","title":"Building a Semantic CLI","text":"paragraph (container, see ‘Generic containers’ later), opened within function, cli automatically closes end function, default. previous example last cli_end() call needed. Use .auto_close = FALSE cli_par() leave paragraph open calling function returns.","code":""},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"headings","dir":"Articles","previous_headings":"Building a command line interface","what":"Headings","title":"Building a Semantic CLI","text":"cli supports three levels headings. look default theme. default theme adds empty line headings, empty line cli_h1() cli_h2().","code":"cli_h1(\"Heading 1\") #> ── Heading 1 ─────────────────────────────────────────────────────────────────── cli_h2(\"Heading 2\") #> #> ── Heading 2 ── #> cli_h3(\"Heading 3\") #> ── Heading 3"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"interpolation","dir":"Articles","previous_headings":"Building a command line interface","what":"Interpolation","title":"Building a Semantic CLI","text":"cli text treated glue template, special formatters available (see ‘Inline text formatting’ Section):","code":"size <- 123143123 dt <- 1.3454 cli_alert_info(c( \"Downloaded {prettyunits::pretty_bytes(size)} in \", \"{prettyunits::pretty_sec(dt)}\")) #> ℹ Downloaded 123.14 MB in 1.3s"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"inline-text-formatting","dir":"Articles","previous_headings":"Building a command line interface","what":"Inline text formatting","title":"Building a Semantic CLI","text":"define inline markup, can use regular glue braces, opening brace, supply name markup formatter leading dot, e.g. emphasized text, use .emph. examples , see ?\"inline-markup\" details. combine inline markup string interpolation, need add another set braces: \"val\" special inline style, default theme calls cli_format() tailor conversion values strings. conversion can themed, see “Theming” .","code":"fun <- function() { cli_ul() cli_li(\"{.emph Emphasized} text\") cli_li(\"{.strong Strong} importance\") cli_li(\"A piece of code: {.code sum(a) / length(a)}\") cli_li(\"A package name: {.pkg cli}\") cli_li(\"A function name: {.fn cli_text}\") cli_li(\"A keyboard key: press {.kbd ENTER}\") cli_li(\"A file name: {.file /usr/bin/env}\") cli_li(\"An email address: {.email bugs.bunny@acme.com}\") cli_li(\"A URL: {.url https://acme.com}\") cli_li(\"An environment variable: {.envvar R_LIBS}\") cli_li(\"Some {.field field}\") } fun() #> • Emphasized text #> • Strong importance #> • A piece of code: `sum(a) / length(a)` #> • A package name: cli #> • A function name: `cli_text()` #> • A keyboard key: press [ENTER] #> • A file name: /usr/bin/env #> • An email address: bugs.bunny@acme.com #> • A URL: #> • An environment variable: `R_LIBS` #> • Some field dlurl <- \"https://httpbin.org/status/404\" cli_alert_danger(\"Failed to download {.url {dlurl}}.\") #> ✖ Failed to download . cli_div(theme = list(.val = list(digits = 2))) cli_text(\"Some random numbers: {.val {runif(4)}}.\") cli_end() #> Some random numbers: 0.07, 0.1, 0.32, and 0.52."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"inline-lists-of-items","dir":"Articles","previous_headings":"Building a command line interface","what":"Inline lists of items","title":"Building a Semantic CLI","text":"cli performs inline text formatting, automatically collapses glue substitutions, formatting. handy create lists files, packages, etc. default class names collapsed differently:","code":"pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Packages: {pkgs}.\") #> Packages: pkg1, pkg2, and pkg3. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Packages: {.pkg {pkgs}}\") #> Packages: pkg1, pkg2, and pkg3 x <- Sys.time() cli_text(\"Hey {.var x} has class {.cls {class(x)}}\") #> Hey `x` has class "},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"non-breaking-spaces","dir":"Articles","previous_headings":"Building a command line interface","what":"Non-breaking spaces","title":"Building a Semantic CLI","text":"Use \\u00a0 create non-breaking space. E.g. insert non-breaking spaces, mark X, easy see line breaks non-breaking space:","code":"# Make some spaces non-breaking, and mark them with X txt <- cli:::lorem_ipsum() mch <- gregexpr(txt, pattern = \" \", fixed = TRUE) nbs <- runif(length(mch[[1]])) < 0.5 regmatches(txt, mch)[[1]] <- ifelse(nbs, \"X\\u00a0\", \" \") cli_text(txt) #> Qui mollit anim est in deserunt adipisicing nostrud duis enimX deserunt.X Ad #> quiX quiX magna animX esse non anim magnaX Lorem.X Dolore laboreX cupidatat #> magnaX etX officiaX etX esse nullaX eiusmod Lorem #> exercitationX cupidatatX velitX enim. NostrudX elit id laborum #> dolore.X LoremX esse ea sint proident eu officiaX nisiX fugiat mollit in #> LoremX velit. Exercitation ipsum consectetur ad nisiX utX eu."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"lists","dir":"Articles","previous_headings":"Building a command line interface","what":"Lists","title":"Building a Semantic CLI","text":"cli three types list: ordered, unordered definition lists, see cli_ol(), cli_ul() cli_dl(): Item text wrapped terminal width:","code":"cli_ol(c(\"item 1\", \"item 2\", \"item 3\")) #> 1. item 1 #> 2. item 2 #> 3. item 3 cli_ul(c(\"item 1\", \"item 2\", \"item 3\")) #> • item 1 #> • item 2 #> • item 3 cli_dl(c(\"item 1\" = \"description 1\", \"item 2\" = \"description 2\", \"item 3\" = \"description 3\")) #> item 1: description 1 #> item 2: description 2 #> item 3: description 3 cli_ul(c(\"item 1\" = cli:::lorem_paragraph(1, 50), \"item 2\" = cli:::lorem_paragraph(1, 50))) #> • Officia ad. #> • Minim velit ullamco cupidatat eu ipsum adipisicing ea dolore ipsum consequat #> id irure irure nulla ea nostrud consequat dolor magna commodo proident #> excepteur ullamco est consectetur do quis laboris tempor in laboris Lorem id #> laboris exercitation culpa voluptate deserunt."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"adding-list-items-iteratively","dir":"Articles","previous_headings":"Building a command line interface > Lists","what":"Adding list items iteratively","title":"Building a Semantic CLI","text":"Items can added one one: cli_ul() call creates list container, items specified, leaves container open. items can added one one. (last cli_end() necessary, default containers auto-close calling function exits.)","code":"fun <- function() { lid <- cli_ul() cli_li(\"Item 1\") cli_li(\"Item 2\") cli_li(\"Item 3\") cli_end(lid) } fun() #> • Item 1 #> • Item 2 #> • Item 3"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"adding-text-to-an-item-iteratively","dir":"Articles","previous_headings":"Building a command line interface > Lists","what":"Adding text to an item iteratively","title":"Building a Semantic CLI","text":"cli_li() creates new container list item, within list container. can keep adding text item, container closed via cli_end() new cli_li(), closes current item container, creates another one new item:","code":"fun <- function() { cli_ul() cli_li(\"First item\") cli_text(\"This is still the first item\") cli_li(\"This is the second item\") } fun() #> • First item #> This is still the first item #> • This is the second item"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"nested-lists","dir":"Articles","previous_headings":"Building a command line interface > Lists","what":"Nested lists","title":"Building a Semantic CLI","text":"create nested lists, open nested containers: cli_end(olid), olid necessary, otherwise cli_end() close container list item.","code":"fun <- function() { cli_ol() cli_li(\"Item 1\") ulid <- cli_ul() cli_li(\"Subitem 1\") cli_li(\"Subitem 2\") cli_end(ulid) cli_li(\"Item 2\") cli_end() } fun() #> 1. Item 1 #> • Subitem 1 #> • Subitem 2 #> 2. Item 2"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"horizontal-rules","dir":"Articles","previous_headings":"Building a command line interface","what":"Horizontal rules","title":"Building a Semantic CLI","text":"cli_rule() creates horizontal rule. can use usual inline markup labels rule. rule’s appearance specified current theme. particular: added rule. added rule. color used color rule labels. (Use color within label text different label color.) background-color: background color rule labels. (, can use different background color within label .) margin-top, margin-bottom empty space rule. line-type specifies line type rule. See ?cli_rule line types.","code":"cli_rule(left = \"Compiling {.pkg mypackage}\") #> ── Compiling mypackage ─────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"the-status-bar","dir":"Articles","previous_headings":"Building a command line interface","what":"The status bar","title":"Building a Semantic CLI","text":"cli supports creating status bar last line console, terminal supports carriage return control character move cursor beginning line. supported terminals, RStudio, Emacs, RGui, R.app, etc. supported output file, e.g. typically CI systems. cli_status() creates new status bar, cli_status_update() updates status bar, cli_status_clear() clears . cli_status() returns id, can used cli_status_update() cli_status_clear() refer right status bar. possible create multiple status bars, typical terminal one can shown time. cli default shows one last created updated. status bar active, cli can still produce output, normal. output created “” status bar, always kept last line screen. See following example:","code":"f <- function() { cli_alert_info(\"About to start downloads.\") sb <- cli_status(\"{symbol$arrow_right} Downloading 10 files.\") for (i in 9:1) { Sys.sleep(0.5) if (i == 5) cli_alert_success(\"Already half-way!\") cli_status_update(id = sb, \"{symbol$arrow_right} Got {10-i} file{?s}, downloading {i}\") } cli_status_clear(id = sb) cli_alert_success(\"Downloads done.\") } f()"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"theming","dir":"Articles","previous_headings":"","what":"Theming","title":"Building a Semantic CLI","text":"looks various CLI elements can changed via themes. cli package comes simple built-theme, new themes can added well.","code":""},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"tags-ids-and-classes","dir":"Articles","previous_headings":"Theming","what":"Tags, ids and classes","title":"Building a Semantic CLI","text":"Similarly HTML document, elements CLI form tree nodes. node exactly one tag, one id, optionally set classes. E.g. cli_par() creates node

tag, cli_ol() creates node

    tag, etc. example CLI tree. always starts tag id \"body\", created automatically. cli theme named list, names selectors based tag names, ids classes, elements list style declarations. example, style

    tags looks like built-theme: See also ?cli::themes reference ?cli::simple_theme example theme.","code":"
      builtin_theme()$h1 #> $`font-weight` #> [1] \"bold\" #> #> $`margin-top` #> [1] 1 #> #> $`margin-bottom` #> [1] 0 #> #> $fmt #> function (x) #> cli::rule(x, line_col = \"cyan\") #> #> #>"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"generic-containers","dir":"Articles","previous_headings":"Theming","what":"Generic containers","title":"Building a Semantic CLI","text":"cli_div() generic container, produce output, can add new theme. theme removed
      node closed. (Like containers, cli_div() auto-closes calling function exits.)","code":"fun <- function() { cli_div(theme = list (.alert = list(color = \"red\"))) cli_alert(\"This will be red\") cli_end() cli_alert(\"Back to normal color\") } fun() #> → This will be red #> → Back to normal color"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"theming-inline-markup","dir":"Articles","previous_headings":"Theming","what":"Theming inline markup","title":"Building a Semantic CLI","text":"inline markup formatters always use tag, add name formatter class. addition adding inline markup explicitly, like .emph , cli can use class(es) substituted expression style automatically. can configured part theme, form mapping class() expression, name markup formatter. example, filename S3 class, can make sure always shown .file cli output:","code":"fun <- function() { cli_div(theme = list(span.emph = list(color = \"orange\"))) cli_text(\"This is very {.emph important}\") cli_end() cli_text(\"Back to the {.emph previous theme}\") } fun() #> This is very important #> Back to the previous theme fun <- function() { cli_div(theme = list(body = list(\"class-map\" = list(\"filename\" = \"file\")))) fns <- structure(c(\"file1\", \"file2\", \"file3\"), class = \"filename\") cli_text(\"Found some files: {fns}.\") cli_end() } fun() #> Found some files: file1, file2, and file3."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"cli-messages","dir":"Articles","previous_headings":"","what":"CLI messages","title":"Building a Semantic CLI","text":"cli_*() functions implemented using standard R conditions. example cli_alert() call emits R condition class cli_message. messages can caught, muffled, transferred sub-process main R process. cli function called: cli throws cli_message condition. condition caught muffled (via cli_message_handled restart), nothing else happens. Otherwise cli.default_handler option checked function, called message. cli.default_handler option set, function, default cli handler called, shows text, alert, heading, etc. screen, using standard R message() function.","code":"tryCatch(cli_h1(\"Heading\"), cli_message = function(x) x) suppressMessages(cli_text(\"Not shown\")) #> "},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"sub-processes","dir":"Articles","previous_headings":"","what":"Sub-Processes","title":"Building a Semantic CLI","text":"cli_*() commands invoked sub-process via callr::r_session (see https://callr.r-lib.org), cli.message_class option set \"callr_message\", cli messages automatically copied main R process:","code":"rs <- callr::r_session$new() rs$run(function() { options(cli.message_class = \"callr_message\") cli::cli_text(\"This is sub-process {.emph {Sys.getpid()}} from {.pkg callr}\") Sys.getpid() }) invisible(rs$close()) #> This is sub-process 15418 from callr #> [1] 15418"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"ansi-colors","dir":"Articles","previous_headings":"Utility functions","what":"ANSI colors","title":"Building a Semantic CLI","text":"cli functions create ANSI colored styled output console. col_* functions change foreground color, bg_* functions change background color, style_* functions change style text way. functions concatenate arguments using paste0(), add cli_ansi_string class result: Foreground colors: Note might actually look different depending terminal theme. Background colors: Text styles: style_* functions supported terminals. Colors, background colors styles can combined: make_ansi_style() can create custom colors, assuming terminal supports . combine_ansi_styles() combines several styles function:","code":"cat(col_red(\"This \", \"is \", \"red.\"), sep = \"\\n\") #> This is red. cli_ul(c( col_black(\"black\"), col_blue(\"blue\"), col_cyan(\"cyan\"), col_green(\"green\"), col_magenta(\"magenta\"), col_red(\"red\"), col_white(\"white\"), col_yellow(\"yellow\"), col_grey(\"grey\") )) #> • black #> • blue #> • cyan #> • green #> • magenta #> • red #> • white #> • yellow #> • grey cli_ul(c( bg_black(\"black background\"), bg_blue(\"blue background\"), bg_cyan(\"cyan background\"), bg_green(\"green background\"), bg_magenta(\"magenta background\"), bg_red(\"red background\"), bg_white(\"white background\"), bg_yellow(\"yellow background\") )) #> • black background #> • blue background #> • cyan background #> • green background #> • magenta background #> • red background #> • white background #> • yellow background cli_ul(c( style_dim(\"dim style\"), style_blurred(\"blurred style\"), style_bold(\"bold style\"), style_hidden(\"hidden style\"), style_inverse(\"inverse style\"), style_italic(\"italic style\"), style_reset(\"reset style\"), style_strikethrough(\"strikethrough style\"), style_underline(\"underline style\") )) #> • dim style #> • blurred style #> • bold style #> • hidden style #> • inverse style #> • italic style #> • reset style #> • strikethrough style #> • underline style bg_white(style_bold(col_red(\"TITLE\"))) #> #> [1] TITLE col_warn <- combine_ansi_styles(make_ansi_style(\"pink\"), style_bold) col_warn(\"This is a warning in pink!\") cat(col_warn(\"This is a warning in pink!\")) #> #> [1] This is a warning in pink! #>"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"console-capabilities","dir":"Articles","previous_headings":"Utility functions","what":"Console capabilities","title":"Building a Semantic CLI","text":"Query console width: Query console supports ansi escapes: Hide cursor, console supports (-op otherwise): See also ansi_with_hidden_cursor(). Query console supports \\r: Query console supports UTF-8 output:","code":"console_width() #> [1] 80 is_ansi_tty() #> [1] TRUE ansi_hide_cursor() ansi_show_cursor() is_dynamic_tty() #> [1] TRUE is_utf8_output() #> [1] TRUE"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"unicode-characters","dir":"Articles","previous_headings":"Utility functions","what":"Unicode characters","title":"Building a Semantic CLI","text":"symbol variable includes Unicode characters often useful CLI messages. automatically fall back ASCII symbols platform support . can use symbols semantic cli_*() functions directly. list symbols: symbols inspired (copied ) awesome figures JavaScript project.","code":"cli_text(\"{symbol$tick} no errors | {symbol$cross} 2 warnings\") #> ✔ no errors | ✖ 2 warnings list_symbols() #> ✔tick ≠neq #> ✖cross ≥geq #> ★star ≤leq #> ▇square ×times #> ◻square_small ▔upper_block_1 #> ◼square_small_filled ▀upper_block_4 #> ◯circle ▁lower_block_1 #> ◉circle_filled ▂lower_block_2 #> ◌circle_dotted ▃lower_block_3 #> ◎circle_double ▄lower_block_4 #> ⓞcircle_circle ▅lower_block_5 #> ⓧcircle_cross ▆lower_block_6 #> Ⓘcircle_pipe ▇lower_block_7 #> ?⃝circle_question_mark █lower_block_8 #> •bullet █full_block #> ․dot ⁰sup_0 #> ─line ¹sup_1 #> ═double_line ²sup_2 #> …ellipsis ³sup_3 #> …continue ⁴sup_4 #> ❯pointer ⁵sup_5 #> ℹinfo ⁶sup_6 #> ⚠warning ⁷sup_7 #> ☰menu ⁸sup_8 #> ☺smiley ⁹sup_9 #> ෴mustache ⁻sup_minus #> ♥heart ⁺sup_plus #> ↑arrow_up ▶play #> ↓arrow_down ■stop #> ←arrow_left ●record #> →arrow_right ‒figure_dash #> ◉radio_on –en_dash #> ◯radio_off —em_dash #> ☒checkbox_on “dquote_left #> ☐checkbox_off ”dquote_right #> ⓧcheckbox_circle_on ‘squote_left #> Ⓘcheckbox_circle_off ’squote_right #> ❓fancy_question_mark"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"spinners","dir":"Articles","previous_headings":"Utility functions","what":"Spinners","title":"Building a Semantic CLI","text":"See list_spinners() get_spinner(). awesome cli-spinners project.","code":"list_spinners() #> [1] \"dots\" \"dots2\" \"dots3\" #> [4] \"dots4\" \"dots5\" \"dots6\" #> [7] \"dots7\" \"dots8\" \"dots9\" #> [10] \"dots10\" \"dots11\" \"dots12\" #> [13] \"dots13\" \"dots8Bit\" \"sand\" #> [16] \"line\" \"line2\" \"pipe\" #> [19] \"simpleDots\" \"simpleDotsScrolling\" \"star\" #> [22] \"star2\" \"flip\" \"hamburger\" #> [25] \"growVertical\" \"growHorizontal\" \"balloon\" #> [28] \"balloon2\" \"noise\" \"bounce\" #> [31] \"boxBounce\" \"boxBounce2\" \"triangle\" #> [34] \"arc\" \"circle\" \"squareCorners\" #> [37] \"circleQuarters\" \"circleHalves\" \"squish\" #> [40] \"toggle\" \"toggle2\" \"toggle3\" #> [43] \"toggle4\" \"toggle5\" \"toggle6\" #> [46] \"toggle7\" \"toggle8\" \"toggle9\" #> [49] \"toggle10\" \"toggle11\" \"toggle12\" #> [52] \"toggle13\" \"arrow\" \"arrow2\" #> [55] \"arrow3\" \"bouncingBar\" \"bouncingBall\" #> [58] \"smiley\" \"monkey\" \"hearts\" #> [61] \"clock\" \"earth\" \"material\" #> [64] \"moon\" \"runner\" \"pong\" #> [67] \"shark\" \"dqpb\" \"weather\" #> [70] \"christmas\" \"grenade\" \"point\" #> [73] \"layer\" \"betaWave\" \"fingerDance\" #> [76] \"fistBump\" \"soccerHeader\" \"mindblown\" #> [79] \"speaker\" \"orangePulse\" \"bluePulse\" #> [82] \"orangeBluePulse\" \"timeTravel\" \"aesthetic\" #> [85] \"growVeriticalDotsLR\" \"growVeriticalDotsRL\" \"growVeriticalDotsLL\" #> [88] \"growVeriticalDotsRR\" get_spinner(\"dots\") #> $name #> [1] \"dots\" #> #> $interval #> [1] 80 #> #> $frames #> [1] \"⠋\" \"⠙\" \"⠹\" \"⠸\" \"⠼\" \"⠴\" \"⠦\" \"⠧\" \"⠇\" \"⠏\" #> ansi_with_hidden_cursor(demo_spinners(\"dots\")) ansi_with_hidden_cursor(demo_spinners(\"clock\"))"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"From usethis::ui functions to cli","text":"’ll show transition usethis::ui_* functions cli 2.0.0.","code":"library(cli) library(usethis)"},{"path":[]},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage","dir":"Articles","previous_headings":"How to > usethis::ui_code()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_code(x)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example","dir":"Articles","previous_headings":"How to > usethis::ui_code()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_todo(\"Redocument with {ui_code('devtools::document()')}\") #> • Redocument with `devtools::document()`"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli","dir":"Articles","previous_headings":"How to > usethis::ui_code()","what":"With cli","title":"From usethis::ui functions to cli","text":"general inline code formatting can done inline styles cli. default theme \"code\" class, also one functions, can either :","code":"cli_ul(\"Redocument with {.code devtools::document()}\") #> • Redocument with `devtools::document()` cli_ul(\"Redocument with {.fun devtools::document}\") #> • Redocument with `devtools::document()`"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-1","dir":"Articles","previous_headings":"How to > usethis::ui_code_block()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_code_block(x, copy = interactive(), .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-1","dir":"Articles","previous_headings":"How to > usethis::ui_code_block()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_code_block(\"{format(cli_code)}\") #> function (lines = NULL, ..., language = \"R\", .auto_close = TRUE, #> • .envir = environment()) #> • { #> • lines <- c(lines, unlist(list(...))) #> • id <- cli_div(class = paste(\"code\", language), .auto_close = .auto_close #> , #> • .envir = .envir) #> • cli_verbatim(lines) #> • invisible(id) #> • } #>"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-1","dir":"Articles","previous_headings":"How to > usethis::ui_code_block()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli_code() produces similar output also syntax highlight R code: However, cli copy stuff clipboard, done separately. Another difference also run glue substitutions code text, want happen ’ll need cli call.","code":"cli_code(format(cli_code)) #> function (lines = NULL, ..., language = \"R\", .auto_close = TRUE, #> .envir = environment()) #> { #> lines <- c(lines, unlist(list(...))) #> id <- cli_div(class = paste(\"code\", language), .auto_close = .auto_close, #> .envir = .envir) #> cli_verbatim(lines) #> invisible(id) #> }"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-2","dir":"Articles","previous_headings":"How to > usethis::ui_done()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_done(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-2","dir":"Articles","previous_headings":"How to > usethis::ui_done()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"name <- \"VignetteBuilder\" value <- \"knitr, rmarkdown\" ui_done(\"Setting {ui_field(name)} field in DESCRIPTION to {ui_value(value)}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to 'knitr, rmarkdown'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-2","dir":"Articles","previous_headings":"How to > usethis::ui_done()","what":"With cli","title":"From usethis::ui functions to cli","text":"probably closest cli_alert_success(): want handle success failure, maybe cli_process_*() functions better fit:","code":"cli_alert_success(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to \"knitr, rmarkdown\" tryCatch({ cli_process_start(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") Sys.sleep(1) # <- do the task here, we just sleep cli_process_done() }, error = function(err) { cli_process_failed() cli_alert_danger(\"Failed to ...\") } )"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-3","dir":"Articles","previous_headings":"How to > usethis::ui_field()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_field(x)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-3","dir":"Articles","previous_headings":"How to > usethis::ui_field()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"name <- \"VignetteBuilder\" value <- \"knitr, rmarkdown\" ui_done(\"Setting {ui_field(name)} field in DESCRIPTION to {ui_value(value)}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to 'knitr, rmarkdown'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-3","dir":"Articles","previous_headings":"How to > usethis::ui_field()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli \"field\" class inline styling: Just like usethis::ui_field() similar usethis functions, cli collapses inline vectors, styling: cli also helps correct pluralization:","code":"cli_alert_success(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to \"knitr, rmarkdown\" name <- c(\"Depends\", \"Imports\", \"Suggests\") ui_done(\"Setting the {ui_field(name)} field(s) in DESCRIPTION\") #> ✔ Setting the Depends, Imports, Suggests field(s) in DESCRIPTION cli_alert_success(\"Setting the {.field {name}} field{?s} in DESCRIPTION\") #> ✔ Setting the Depends, Imports, and Suggests fields in DESCRIPTION name <- \"Depends\" cli_alert_success(\"Setting the {.field {name}} field{?s} in DESCRIPTION\") #> ✔ Setting the Depends field in DESCRIPTION"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-4","dir":"Articles","previous_headings":"How to > usethis::ui_info()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_info((x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-4","dir":"Articles","previous_headings":"How to > usethis::ui_info()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_info(\"No labels need renaming\") #> ℹ No labels need renaming"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-4","dir":"Articles","previous_headings":"How to > usethis::ui_info()","what":"With cli","title":"From usethis::ui functions to cli","text":"simply cli_alert_info():","code":"cli_alert_info(\"No labels need renaming\") #> ℹ No labels need renaming"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-5","dir":"Articles","previous_headings":"How to > usethis::ui_line()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_line(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-5","dir":"Articles","previous_headings":"How to > usethis::ui_line()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_line(\"No matching issues/PRs found.\") #> No matching issues/PRs found."},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-5","dir":"Articles","previous_headings":"How to > usethis::ui_line()","what":"With cli","title":"From usethis::ui functions to cli","text":"just line text, cli_text() fine . One difference cli_text() automatically wrap long lines.","code":"cli_text(\"No matching issues/PRs found.\") #> No matching issues/PRs found."},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-6","dir":"Articles","previous_headings":"How to > usethis::ui_nope()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"ui_nope(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-6","dir":"Articles","previous_headings":"How to > usethis::ui_nope()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli support user input currently, stay usethis.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-7","dir":"Articles","previous_headings":"How to > usethis::ui_oops()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_oops(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-6","dir":"Articles","previous_headings":"How to > usethis::ui_oops()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_oops(\"Can't validate token. Is the network reachable?\") #> ✖ Can't validate token. Is the network reachable?"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-7","dir":"Articles","previous_headings":"How to > usethis::ui_oops()","what":"With cli","title":"From usethis::ui functions to cli","text":"mostly just cli_alert_danger(), see also cli_process_*() alternatives usethis::ui_done().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-8","dir":"Articles","previous_headings":"How to > usethis::ui_path()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_path(x, base = NULL)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-7","dir":"Articles","previous_headings":"How to > usethis::ui_path()","what":"Example","title":"From usethis::ui functions to cli","text":"ui_path() formats paths relative project supplied base directory, also appends / directories.","code":"logo_path <- file.path(\"man\", \"figures\", \"logo.svg\") img <- \"/tmp/some-image.svg\" ui_done(\"Copied {ui_path(img)} to {ui_path(logo_path)}\") #> ✔ Copied '/tmp/some-image.svg' to 'man/figures/logo.svg'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-8","dir":"Articles","previous_headings":"How to > usethis::ui_path()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli , inline markup files paths:","code":"cli_alert_success(\"Copied {.file {img}} to {.file {logo_path}}\") #> ✔ Copied /tmp/some-image.svg to man/figures/logo.svg"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-9","dir":"Articles","previous_headings":"How to > usethis::ui_stop()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_stop(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-8","dir":"Articles","previous_headings":"How to > usethis::ui_stop()","what":"Example","title":"From usethis::ui functions to cli","text":"ui_stop() glue substitution string, calls stop() throw error.","code":"ui_stop(\"Could not copy {ui_path(img)} to {ui_path(logo_path)}, file already exists\") #> Error: Could not copy '/tmp/some-image.svg' to 'man/figures/logo.svg', file alr #> eady exists"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-9","dir":"Articles","previous_headings":"How to > usethis::ui_stop()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli_abort() formatted using cli_bullets().","code":"cli_abort(c( \"Could not copy {.file {img}} to {.file {logo_path}}, file already exists\", \"i\" = \"You can set {.arg overwrite = TRUE} to avoid this error\" )) #> Error: #> ! Could not copy /tmp/some-image.svg to man/figures/logo.svg, file #> already exists #> ℹ You can set `overwrite = TRUE` to avoid this error #> Run `rlang::last_trace()` to see where the error occurred."},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-10","dir":"Articles","previous_headings":"How to > usethis::ui_todo()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_todo(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-9","dir":"Articles","previous_headings":"How to > usethis::ui_todo()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_todo(\"Redocument with {ui_code('devtools::document()')}\") #> • Redocument with `devtools::document()`"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-10","dir":"Articles","previous_headings":"How to > usethis::ui_todo()","what":"With cli","title":"From usethis::ui functions to cli","text":"bullet, either cli_ul() cli_alert_info() appropriate:","code":"cli_ul(\"Redocument with {.fun devtools::document}\") #> • Redocument with `devtools::document()`"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-11","dir":"Articles","previous_headings":"How to > usethis::ui_value()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_value(x)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-10","dir":"Articles","previous_headings":"How to > usethis::ui_value()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"name <- \"VignetteBuilder\" value <- \"knitr, rmarkdown\" ui_done(\"Setting {ui_field(name)} field in DESCRIPTION to {ui_value(value)}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to 'knitr, rmarkdown'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-11","dir":"Articles","previous_headings":"How to > usethis::ui_value()","what":"With cli","title":"From usethis::ui functions to cli","text":"\"value\" inline class appropriate .","code":"cli_alert_success(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to \"knitr, rmarkdown\""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-12","dir":"Articles","previous_headings":"How to > usethis::ui_warn()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_warn(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-11","dir":"Articles","previous_headings":"How to > usethis::ui_warn()","what":"Example","title":"From usethis::ui functions to cli","text":"ui_warn() glue substitution string, calls warning() throw warning.","code":"ui_warn(\"Could not copy {ui_path(img)} to {ui_path(logo_path)}, file already exists\") #> Warning: Could not copy '/tmp/some-image.svg' to 'man/figures/logo.svg', file a #> lready exists"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-12","dir":"Articles","previous_headings":"How to > usethis::ui_warn()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli_warn() formatted using cli_bullets().","code":"cli_warn(c( \"Could not copy {.file {img}} to {.file {logo_path}}, file already exists\", \"i\" = \"You can set {.arg overwrite = TRUE} to avoid this warning\" )) #> Warning message: #> Could not copy /tmp/some-image.svg to man/figures/logo.svg, file already exists #> ℹ You can set `overwrite = TRUE` to avoid this warning"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-13","dir":"Articles","previous_headings":"How to > usethis::ui_yeah()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"ui_yeah(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-13","dir":"Articles","previous_headings":"How to > usethis::ui_yeah()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli support user input currently, stay usethis.","code":""},{"path":"https://cli.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Gábor Csárdi. Author, maintainer. Hadley Wickham. Contributor. Kirill Müller. Contributor. Salim Brüggemann. Contributor. . Copyright holder, funder.","code":""},{"path":"https://cli.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Csárdi G (2024). cli: Helpers Developing Command Line Interfaces. R package version 3.6.3.9000, https://github.com/r-lib/cli, https://cli.r-lib.org.","code":"@Manual{, title = {cli: Helpers for Developing Command Line Interfaces}, author = {Gábor Csárdi}, year = {2024}, note = {R package version 3.6.3.9000, https://github.com/r-lib/cli}, url = {https://cli.r-lib.org}, }"},{"path":"https://cli.r-lib.org/dev/index.html","id":"cli","dir":"","previous_headings":"","what":"Helpers for Developing Command Line Interfaces","title":"Helpers for Developing Command Line Interfaces","text":"Helpers Developing Command Line Interfaces suite tools build attractive command line interfaces (CLIs), semantic elements: headers, lists, alerts, paragraphs, etc. Supports theming via CSS-like language. also contains number lower level CLI elements: rules, boxes, trees, Unicode symbols ASCII alternatives. supports ANSI markup terminal colors font styles.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"Helpers for Developing Command Line Interfaces","text":"Build CLI using semantic elements: headings, lists, alerts, paragraphs. Theming via CSS-like language. Terminal colors font styles. cli text can contain interpreted string literals, via glue package. Progress bars R C code. Error warning messages rich text formatting. Support pluralized messages. ANSI styled string manipulation.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Helpers for Developing Command Line Interfaces","text":"Install stable version CRAN: Install development version GitHub:","code":"install.packages(\"cli\") pak::pak(\"r-lib/cli\")"},{"path":"https://cli.r-lib.org/dev/index.html","id":"short-tour","dir":"","previous_headings":"","what":"Short tour","title":"Helpers for Developing Command Line Interfaces","text":"commonly used cli elements, features.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"short-alert-messages","dir":"","previous_headings":"","what":"Short alert messages","title":"Helpers for Developing Command Line Interfaces","text":"One liner messages inform warn.","code":"pkgs <- c(\"foo\", \"bar\", \"foobar\") cli_alert_success(\"Downloaded {length(pkgs)} packages.\") #> ✔ Downloaded 3 packages. db_url <- \"example.com:port\" cli_alert_info(\"Reopened database {.url {db_url}}.\") #> ℹ Reopened database . cli_alert_warning(\"Cannot reach GitHub, using local database cache.\") #> ! Cannot reach GitHub, using local database cache. cli_alert_danger(\"Failed to connect to database.\") #> ✖ Failed to connect to database. cli_alert(\"A generic alert\") #> → A generic alert"},{"path":"https://cli.r-lib.org/dev/index.html","id":"headings","dir":"","previous_headings":"","what":"Headings","title":"Helpers for Developing Command Line Interfaces","text":"Three levels headings.","code":"cli_h1(\"Heading 1\") #> #> ── Heading 1 ─────────────────────────────────────────────────────────────────── cli_h2(\"Heading 2\") #> #> ── Heading 2 ── #> cli_h3(\"Heading 3\") #> ── Heading 3"},{"path":"https://cli.r-lib.org/dev/index.html","id":"lists","dir":"","previous_headings":"","what":"Lists","title":"Helpers for Developing Command Line Interfaces","text":"Ordered, unordered description lists, can nested.","code":"fun <- function() { cli_ol() cli_li(\"Item 1\") ulid <- cli_ul() cli_li(\"Subitem 1\") cli_li(\"Subitem 2\") cli_end(ulid) cli_li(\"Item 2\") cli_end() } fun() #> 1. Item 1 #> • Subitem 1 #> • Subitem 2 #> 2. Item 2"},{"path":"https://cli.r-lib.org/dev/index.html","id":"themes","dir":"","previous_headings":"","what":"Themes","title":"Helpers for Developing Command Line Interfaces","text":"Theming via CSS-like language.","code":"fun <- function() { cli_div(theme = list(span.emph = list(color = \"orange\"))) cli_text(\"This is very {.emph important}\") cli_end() cli_text(\"Back to the {.emph previous theme}\") } fun() #> This is very important #> Back to the previous theme"},{"path":"https://cli.r-lib.org/dev/index.html","id":"command-substitution","dir":"","previous_headings":"","what":"Command substitution","title":"Helpers for Developing Command Line Interfaces","text":"Automatic command substitution via glue package.","code":"size <- 123143123 dt <- 1.3454 cli_alert_info(c( \"Downloaded {prettyunits::pretty_bytes(size)} in \", \"{prettyunits::pretty_sec(dt)}\")) #> ℹ Downloaded 123.14 MB in 1.3s"},{"path":"https://cli.r-lib.org/dev/index.html","id":"pluralization","dir":"","previous_headings":"","what":"Pluralization","title":"Helpers for Developing Command Line Interfaces","text":"Pluralization support.","code":"nfiles <- 3 ndirs <- 1 cli_alert_info(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}.\") #> ℹ Found 3 files and 1 directory."},{"path":"https://cli.r-lib.org/dev/index.html","id":"progress-bars","dir":"","previous_headings":"","what":"Progress bars","title":"Helpers for Developing Command Line Interfaces","text":"","code":"clean <- function() { cli_progress_bar(\"Cleaning data\", total = 100) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } } clean()"},{"path":"https://cli.r-lib.org/dev/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Helpers for Developing Command Line Interfaces","text":"See https://cli.r-lib.org/ also installed package: help(package = \"cli\").","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Helpers for Developing Command Line Interfaces","text":"Please note cli project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Helpers for Developing Command Line Interfaces","text":"MIT © Posit Software, PBC","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":null,"dir":"Reference","previous_headings":"","what":"ANSI colored text — ansi-styles","title":"ANSI colored text — ansi-styles","text":"cli number functions color style text command line. provide modern interface crayon package.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ANSI colored text — ansi-styles","text":"","code":"bg_black(...) bg_blue(...) bg_cyan(...) bg_green(...) bg_magenta(...) bg_red(...) bg_white(...) bg_yellow(...) bg_none(...) bg_br_black(...) bg_br_blue(...) bg_br_cyan(...) bg_br_green(...) bg_br_magenta(...) bg_br_red(...) bg_br_white(...) bg_br_yellow(...) col_black(...) col_blue(...) col_cyan(...) col_green(...) col_magenta(...) col_red(...) col_white(...) col_yellow(...) col_grey(...) col_silver(...) col_none(...) col_br_black(...) col_br_blue(...) col_br_cyan(...) col_br_green(...) col_br_magenta(...) col_br_red(...) col_br_white(...) col_br_yellow(...) style_dim(...) style_blurred(...) style_bold(...) style_hidden(...) style_inverse(...) style_italic(...) style_reset(...) style_strikethrough(...) style_underline(...) style_no_bold(...) style_no_blurred(...) style_no_dim(...) style_no_italic(...) style_no_underline(...) style_no_inverse(...) style_no_hidden(...) style_no_strikethrough(...) style_no_color(...) style_no_bg_color(...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ANSI colored text — ansi-styles","text":"... Character strings, pasted together paste0(), applying style function.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ANSI colored text — ansi-styles","text":"ANSI string (class cli_ansi_string), contains ANSI sequences, current platform supports . can simply use cat() print terminal.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ANSI colored text — ansi-styles","text":"col_* functions change (foreground) color text. eight original ANSI colors. Note terminals, might actually look differently, terminals settings show . col_none() default color, useful substring colored string. col_br_* functions bright versions eight ANSI colors. Note terminal configurations themes might non-bright colors. bg_* functions change background color text. eight original ANSI background colors. , , can vary appearance, depending terminal settings. bg_none() default background color, useful substring background-colored string. bg_br_* functions bright versions eight ANSI background colors. Note terminal configurations themes might non-bright colors. style_* functions apply styling text. currently supported styling functions : style_reset() remove style, including color, style_bold() boldface / strong text, although terminals show bright, high intensity text instead, style_dim() (style_blurred() reduced intensity text. style_italic() (widely supported). style_underline(), style_inverse(), style_hidden(), style_strikethrough() (widely supported). style functions take number character vectors arguments, concatenate using paste0() adding style. Styles can also nested, inner style takes precedence, see examples . Sometimes want revert back default text color, middle colored text, want normal font middle italic text. can use style_no_* functions . Every style_*() function style_no_*() pair, defends argument taking style. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ANSI colored text — ansi-styles","text":"","code":"col_blue(\"Hello \", \"world!\") #> #> [1] Hello world! cat(col_blue(\"Hello \", \"world!\")) #> Hello world! cat(\"... to highlight the\", col_red(\"search term\"), \"in a block of text\\n\") #> ... to highlight the search term in a block of text ## Style stack properly cat(col_green( \"I am a green line \", col_blue(style_underline(style_bold(\"with a blue substring\"))), \" that becomes green again!\" )) #> I am a green line with a blue substring that becomes green again! error <- combine_ansi_styles(\"red\", \"bold\") warn <- combine_ansi_styles(\"magenta\", \"underline\") note <- col_cyan cat(error(\"Error: subscript out of bounds!\\n\")) #> Error: subscript out of bounds! #> cat(warn(\"Warning: shorter argument was recycled.\\n\")) #> Warning: shorter argument was recycled. #> cat(note(\"Note: no such directory.\\n\")) #> Note: no such directory. #> # style_no_* functions, note that the color is not removed style_italic(col_green(paste0( \"italic before, \", style_no_italic(\"normal here, \"), \"italic after\" ))) #> #> [1] italic before, normal here, italic after # avoiding color for substring style_italic(col_red(paste( \"red before\", col_none(\"not red between\"), \"red after\" ))) #> #> [1] red before not red between red after"},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":null,"dir":"Reference","previous_headings":"","what":"Align an ANSI colored string — ansi_align","title":"Align an ANSI colored string — ansi_align","text":"Align ANSI colored string","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Align an ANSI colored string — ansi_align","text":"","code":"ansi_align( text, width = console_width(), align = c(\"left\", \"center\", \"right\"), type = \"width\" )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align an ANSI colored string — ansi_align","text":"text character vector align. width Width field align . align Whether align \"left\", \"center\" \"right\". type Passed ansi_nchar() nchar()","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align an ANSI colored string — ansi_align","text":"aligned character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Align an ANSI colored string — ansi_align","text":"","code":"str <- c( col_red(\"This is red\"), style_bold(\"This is bold\") ) astr <- ansi_align(str, width = 30) boxx(astr) #> ┌────────────────────────────────────┐ #> │ │ #> │ This is red │ #> │ This is bold │ #> │ │ #> └────────────────────────────────────┘ str <- c( col_red(\"This is red\"), style_bold(\"This is bold\") ) astr <- ansi_align(str, align = \"center\", width = 30) boxx(astr) #> ┌────────────────────────────────────┐ #> │ │ #> │ This is red │ #> │ This is bold │ #> │ │ #> └────────────────────────────────────┘ str <- c( col_red(\"This is red\"), style_bold(\"This is bold\") ) astr <- ansi_align(str, align = \"right\", width = 30) boxx(astr) #> ┌────────────────────────────────────┐ #> │ │ #> │ This is red │ #> │ This is bold │ #> │ │ #> └────────────────────────────────────┘"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse a vector into a string scalar — ansi_collapse","title":"Collapse a vector into a string scalar — ansi_collapse","text":"Features: custom separator (sep), custom separator length-two input (sep2), custom last separator (last), adds ellipsis truncated strings, uses Unicode ellipsis character UTF-8 console, can collapse \"ends\", style = \"-ends\", can consider limit display width result, characters, handles ANSI control sequences correctly measuring display width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse a vector into a string scalar — ansi_collapse","text":"","code":"ansi_collapse( x, sep = \", \", sep2 = sub(\"^,\", \"\", last), last = \", and \", trunc = Inf, width = Inf, ellipsis = symbol$ellipsis, style = c(\"both-ends\", \"head\") )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse a vector into a string scalar — ansi_collapse","text":"x Character vector, object .character() method collapse. sep Separator. character string. sep2 Separator special case x contains two elements. character string. Defaults value last without serial comma. last Last separator, truncation. E.g. use \", \" serial comma. character string. trunc Maximum number elements show. style = \"head\" least trunc = 1 used. style = \"-ends\" least trunc = 5 used, even smaller number specified. width Limit display width result, characters. hard limit, output never exceed . argument implemented \"-ends\" style, always uses Inf, warning finite width value set. ellipsis Character string use place truncation. default, Unicode ellipsis character used console UTF-8, three dots otherwise. style Truncation style: -ends: default, shows beginning end vector, skips elements middle needed. head: shows beginning vector, skips elements end, needed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse a vector into a string scalar — ansi_collapse","text":"Character scalar. NA_character_ elements x NA.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse a vector into a string scalar — ansi_collapse","text":"","code":"ansi_collapse(letters) #> [1] \"a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, and z\" # truncate ansi_collapse(letters, trunc = 5) #> [1] \"a, b, c, …, y, and z\" # head style ansi_collapse(letters, trunc = 5, style = \"head\") #> [1] \"a, b, c, d, e, …\""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":null,"dir":"Reference","previous_headings":"","what":"Format a character vector in multiple columns — ansi_columns","title":"Format a character vector in multiple columns — ansi_columns","text":"function helps multi-column output ANSI styles strings. works well together boxx(), see example .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format a character vector in multiple columns — ansi_columns","text":"","code":"ansi_columns( text, width = console_width(), sep = \" \", fill = c(\"rows\", \"cols\"), max_cols = 4, align = c(\"left\", \"center\", \"right\"), type = \"width\", ellipsis = symbol$ellipsis )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format a character vector in multiple columns — ansi_columns","text":"text Character vector format. element formatted cell table. width Width screen. sep Separator columns. may ANSI styles. fill Whether fill columns row-wise column-wise. max_cols Maximum number columns use. use , even space . align Alignment within columns. type Passed ansi_nchar() ansi_align(). probably want default, \"width\". ellipsis string append truncated strings. Supply empty string want marker.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format a character vector in multiple columns — ansi_columns","text":"ANSI string vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format a character vector in multiple columns — ansi_columns","text":"string fit specified width, truncated using ansi_strtrim().","code":"fmt <- ansi_columns( paste(col_red(\"foo\"), 1:10), width = 50, fill = \"rows\", max_cols=10, align = \"center\", sep = \" \" ) boxx(fmt, padding = c(0,1,0,1), header = col_cyan(\"Columns\")) #> ┌ Columns ───────────────────────────────────────────┐ #> │ foo 1 foo 2 foo 3 foo 4 foo 5 │ #> │ foo 6 foo 7 foo 8 foo 9 foo 10 │ #> └────────────────────────────────────────────────────┘"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":null,"dir":"Reference","previous_headings":"","what":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"First ANSI sequences stripped ansi_strip(), ","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"","code":"ansi_grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE, ...) ansi_grepl(pattern, x, ...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"pattern Character scalar, regular expression fixed string (fixed = TRUE), pattern search . objects coerced using .character(). x Character vector search . objects coerced using .character(). ignore.case, perl, value Passed base::grep(). ... Extra arguments passed base::grep() base::grepl().","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"base::grep() base::grepl(), respectively.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"Note functions work code points (bytes useBytes = TRUE), graphemes. Unlike base::grep() base::grepl() functions special case factors. pattern x converted UTF-8.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"","code":"red_needle <- col_red(\"needle\") haystack <- c(\"foo\", \"needle\", \"foo\") green_haystack <- col_green(haystack) ansi_grepl(red_needle, haystack) #> [1] FALSE TRUE FALSE ansi_grepl(red_needle, green_haystack) #> [1] FALSE TRUE FALSE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a string has some ANSI styling — ansi_has_any","title":"Check if a string has some ANSI styling — ansi_has_any","text":"Check string ANSI styling","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a string has some ANSI styling — ansi_has_any","text":"","code":"ansi_has_any(string, sgr = TRUE, csi = TRUE, link = TRUE)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a string has some ANSI styling — ansi_has_any","text":"string string check. can also character vector. sgr Whether look SGR (styling) control sequences. csi Whether look non-SGR control sequences. link Whether look ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a string has some ANSI styling — ansi_has_any","text":"Logical vector, TRUE strings ANSI styling.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a string has some ANSI styling — ansi_has_any","text":"","code":"## The second one has style if ANSI colors are supported ansi_has_any(\"foobar\") #> [1] FALSE ansi_has_any(col_red(\"foobar\")) #> [1] TRUE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":null,"dir":"Reference","previous_headings":"","what":"Hide/show cursor in a terminal — ansi_hide_cursor","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"works terminal emulators. environments, nothing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"","code":"ansi_hide_cursor(stream = \"auto\") ansi_show_cursor(stream = \"auto\") ansi_with_hidden_cursor(expr, stream = \"auto\")"},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"stream stream inspect manipulate, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr(). expr R expression evaluate.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"ansi_hide_cursor() hides cursor. ansi_show_cursor() shows cursor. ansi_with_hidden_cursor() temporarily hides cursor evaluating expression.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert ANSI styled text to HTML — ansi_html","title":"Convert ANSI styled text to HTML — ansi_html","text":"Convert ANSI styled text HTML","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert ANSI styled text to HTML — ansi_html","text":"","code":"ansi_html(x, escape_reserved = TRUE, csi = c(\"drop\", \"keep\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert ANSI styled text to HTML — ansi_html","text":"x Input character vector. escape_reserved Whether escape characters reserved HTML (&, < >). csi non-SGR ANSI sequences, either \"keep\", \"drop\" .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert ANSI styled text to HTML — ansi_html","text":"Character vector HTML.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert ANSI styled text to HTML — ansi_html","text":"","code":"## Syntax highlight the source code of an R function with ANSI tags, ## and export it to a HTML file. code <- withr::with_options( list(ansi.num_colors = 256), code_highlight(format(ansi_html)) ) hcode <- paste(ansi_html(code), collapse = \"\\n\") css <- paste(format(ansi_html_style()), collapse= \"\\n\") page <- htmltools::tagList( htmltools::tags$head(htmltools::tags$style(css)), htmltools::tags$pre(htmltools::HTML(hcode)) ) if (interactive()) htmltools::html_print(page)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":null,"dir":"Reference","previous_headings":"","what":"CSS styles for the output of ansi_html() — ansi_html_style","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"CSS styles output ansi_html()","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"","code":"ansi_html_style( colors = TRUE, palette = c(\"vscode\", \"dichro\", \"vga\", \"winxp\", \"win10\", \"macos\", \"putty\", \"mirc\", \"xterm\", \"ubuntu\", \"eclipse\", \"iterm\", \"iterm-pastel\", \"iterm-smoooooth\", \"iterm-snazzy\", \"iterm-solarized\", \"iterm-tango\") )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"colors Whether include colors. FALSE include colors, TRUE 8 include eight colors (plus bright variants), 256 include 256 colors. palette Character scalar, palette use first eight colors plus bright variants. Terminals define colors differently, cli includes couple examples. Sources palettes: https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit iTerm2 builtin palettes https://github.com/sindresorhus/iterm2-snazzy","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"Named list CSS declaration blocks, names CSS selectors. format() print() methods, can use write output CSS HTML file.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"","code":"ansi_html_style(colors = FALSE) #> .ansi-bold { font-weight: bold; } #> .ansi-italic { font-style: italic; } #> .ansi-underline { text-decoration: underline; } #> .ansi-blink { text-decoration: blink; } #> .ansi-hide { visibility: hidden; } #> .ansi-crossedout { text-decoration: line-through; } #> .ansi-link:hover { text-decoration: underline; } ansi_html_style(colors = 8, palette = \"iterm-snazzy\") #> .ansi-bold { font-weight: bold; } #> .ansi-italic { font-style: italic; } #> .ansi-underline { text-decoration: underline; } #> .ansi-blink { text-decoration: blink; } #> .ansi-hide { visibility: hidden; } #> .ansi-crossedout { text-decoration: line-through; } #> .ansi-link:hover { text-decoration: underline; } #> .ansi-color-0 { color: #000000 } #> .ansi-color-1 { color: #ff5c57 } #> .ansi-color-2 { color: #5af78e } #> .ansi-color-3 { color: #f3f99d } #> .ansi-color-4 { color: #57c7ff } #> .ansi-color-5 { color: #ff6ac1 } #> .ansi-color-6 { color: #9aedfe } #> .ansi-color-7 { color: #f1f1f0 } #> .ansi-color-8 { color: #686868 } #> .ansi-color-9 { color: #ff5c57 } #> .ansi-color-10 { color: #5af78e } #> .ansi-color-11 { color: #f3f99d } #> .ansi-color-12 { color: #57c7ff } #> .ansi-color-13 { color: #ff6ac1 } #> .ansi-color-14 { color: #9aedfe } #> .ansi-color-15 { color: #f1f1f0 } #> .ansi-bg-color-0 { background-color: #000000 } #> .ansi-bg-color-1 { background-color: #ff5c57 } #> .ansi-bg-color-2 { background-color: #5af78e } #> .ansi-bg-color-3 { background-color: #f3f99d } #> .ansi-bg-color-4 { background-color: #57c7ff } #> .ansi-bg-color-5 { background-color: #ff6ac1 } #> .ansi-bg-color-6 { background-color: #9aedfe } #> .ansi-bg-color-7 { background-color: #f1f1f0 } #> .ansi-bg-color-8 { background-color: #686868 } #> .ansi-bg-color-9 { background-color: #ff5c57 } #> .ansi-bg-color-10 { background-color: #5af78e } #> .ansi-bg-color-11 { background-color: #f3f99d } #> .ansi-bg-color-12 { background-color: #57c7ff } #> .ansi-bg-color-13 { background-color: #ff6ac1 } #> .ansi-bg-color-14 { background-color: #9aedfe } #> .ansi-bg-color-15 { background-color: #f1f1f0 }"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":null,"dir":"Reference","previous_headings":"","what":"Count number of characters in an ANSI colored string — ansi_nchar","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"color-aware counterpart utf8_nchar(). default counts Unicode grapheme clusters, instead code points.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"","code":"ansi_nchar(x, type = c(\"chars\", \"bytes\", \"width\", \"graphemes\", \"codepoints\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"x Character vector, potentially ANSI styled, vector coerced character. converted UTF-8. type Whether count graphemes (characters), code points, bytes, calculate display width string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"Numeric vector, length strings character vector.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"","code":"str <- paste( col_red(\"red\"), \"default\", col_green(\"green\") ) cat(str, \"\\n\") #> red default green nchar(str) #> [1] 37 ansi_nchar(str) #> [1] 17 nchar(ansi_strip(str)) #> [1] 17"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":null,"dir":"Reference","previous_headings":"","what":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"Like base::nzchar(), ANSI strings","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"","code":"ansi_nzchar(x, ...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"x Charcater vector. objects coarced using base::.character(). ... Passed base::nzchar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"","code":"ansi_nzchar(\"\") #> [1] FALSE ansi_nzchar(col_red(\"\")) #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":null,"dir":"Reference","previous_headings":"","what":"ANSI colors palettes — truecolor","title":"ANSI colors palettes — truecolor","text":"platform supports least 256 colors, can configure colors cli uses eight base eight bright colors. (.e. colors col_black(), col_red(), col_br_black(), col_br_red(), etc.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ANSI colors palettes — truecolor","text":"","code":"truecolor ansi_palettes ansi_palette_show(palette = NULL, colors = num_ansi_colors(), rows = 4)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ANSI colors palettes — truecolor","text":"truecolor integer scalar. ansi_palettes data frame one row palette, one column base ANSI color. attr(ansi_palettes, \"info\") contains list information palette.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ANSI colors palettes — truecolor","text":"palette palette show, format cli.palette option, can name built-palette, list 16 colors. colors Number ANSI colors use show palette. platform sufficient support, output might lower color resolution. Without color support color . rows number colored rows print.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ANSI colors palettes — truecolor","text":"ansi_palette_show returns character vector, rows printed screen, invisibly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ANSI colors palettes — truecolor","text":"truecolor integer constant number 24 bit ANSI colors. customize default palette, set cli.palette option name built-palette (see ansi_palettes()), list 16 colors. Colors can specified RGB colors strings: #rrggbb R color names (see output grDevices::colors()). example, can put R profile: currently possible configure background colors separately, always foreground colors. platform 256 colors, colors specified palette interpolated. true color platforms RGB values used -. ansi_palettes data frame built-palettes, row one palette. ansi_palette_show() shows colors ANSI palette screen.","code":"options(cli.palette = \"vscode\")"},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ANSI colors palettes — truecolor","text":"","code":"ansi_palettes #> black red green yellow blue magenta cyan #> dichro #000000 #882255 #117733 #ddcc77 #332288 #aa4499 #88ccee #> vga #000000 #aa0000 #00aa00 #aa5500 #0000aa #aa00aa #00aaaa #> winxp #000000 #800000 #008000 #808000 #000080 #800080 #008080 #> vscode #000000 #cd3131 #0dbc79 #e5e510 #2472c8 #bc3fbc #11a8cd #> win10 #0c0c0c #c50f1f #13a10e #c19c00 #0037da #881798 #3a96dd #> macos #000000 #c23621 #25bc24 #adad27 #492ee1 #d338d3 #33bbc8 #> putty #000000 #bb0000 #00bb00 #bbbb00 #0000bb #bb00bb #00bbbb #> mirc #000000 #7f0000 #009300 #fc7f00 #00007f #9c009c #009393 #> xterm #000000 #cd0000 #00cd00 #cdcd00 #0000ee #cd00cd #00cdcd #> ubuntu #010101 #de382b #39b54a #ffc706 #006fb8 #762671 #2cb5e9 #> eclipse #000000 #cd0000 #00cd00 #cdcd00 #0000ee #cd00cd #00cdcd #> iterm #000000 #c91b00 #00c200 #c7c400 #0225c7 #ca30c7 #00c5c7 #> iterm-pastel #626262 #ff8373 #b4fb73 #fffdc3 #a5d5fe #ff90fe #d1d1fe #> iterm-smoooooth #14191e #b43c2a #00c200 #c7c400 #2744c7 #c040be #00c5c7 #> iterm-snazzy #000000 #ff5c57 #5af78e #f3f99d #57c7ff #ff6ac1 #9aedfe #> iterm-solarized #073642 #dc322f #859900 #b58900 #268bd2 #d33682 #2aa198 #> iterm-tango #000000 #d81e00 #5ea702 #cfae00 #427ab3 #89658e #00a7aa #> white br_black br_red br_green br_yellow br_blue #> dichro #e5e5e5 #000000 #cc6677 #999933 #ddcc77 #44aa99 #> vga #aaaaaa #555555 #ff5555 #55ff55 #ffff55 #5555ff #> winxp #c0c0c0 #808080 #ff0000 #00ff00 #ffff00 #0000ff #> vscode #e5e5e5 #666666 #f14c4c #23d18b #f5f543 #3b8eea #> win10 #cccccc #767676 #e74856 #16c60c #f9f1a5 #3b78ff #> macos #cbcccd #818383 #fc391f #31e722 #eaec23 #5833ff #> putty #bbbbbb #555555 #ff5555 #55ff55 #ffff55 #5555ff #> mirc #d2d2d2 #7f7f7f #ff0000 #00fc00 #ffff00 #0000fc #> xterm #e5e5e5 #7f7f7f #ff0000 #00ff00 #ffff00 #5c5cff #> ubuntu #cccccc #808080 #ff0000 #00ff00 #ffff00 #0000ff #> eclipse #e5e5e5 #000000 #ff0000 #00ff00 #ffff00 #5c5cff #> iterm #c7c7c7 #686868 #ff6e67 #5ffa68 #fffc67 #6871ff #> iterm-pastel #f1f1f1 #8f8f8f #ffc4be #d6fcba #fffed5 #c2e3ff #> iterm-smoooooth #c7c7c7 #686868 #dd7975 #58e790 #ece100 #a7abf2 #> iterm-snazzy #f1f1f0 #686868 #ff5c57 #5af78e #f3f99d #57c7ff #> iterm-solarized #eee8d5 #002b36 #cb4b16 #586e75 #657b83 #839496 #> iterm-tango #dbded8 #686a66 #f54235 #99e343 #fdeb61 #84b0d8 #> br_magenta br_cyan br_white #> dichro #aa4499 #88ccee #ffffff #> vga #ff55ff #55ffff #ffffff #> winxp #ff00ff #00ffff #ffffff #> vscode #d670d6 #29b8db #e5e5e5 #> win10 #b4009e #61d6d6 #f2f2f2 #> macos #f935f8 #14f0f0 #e9ebeb #> putty #ff55ff #55ffff #ffffff #> mirc #ff00ff #00ffff #ffffff #> xterm #ff00ff #00ffff #ffffff #> ubuntu #ff00ff #00ffff #ffffff #> eclipse #ff00ff #00ffff #ffffff #> iterm #ff77ff #60fdff #ffffff #> iterm-pastel #ffb2fe #e6e7fe #ffffff #> iterm-smoooooth #e17ee1 #60fdff #ffffff #> iterm-snazzy #ff6ac1 #9aedfe #f1f1f0 #> iterm-solarized #6c71c4 #93a1a1 #fdf6e3 #> iterm-tango #bc94b7 #37e6e8 #f1f1f0 ansi_palette_show(\"dichro\", colors = truecolor) #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/reference/ansi_regex.html","id":null,"dir":"Reference","previous_headings":"","what":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","title":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","text":"forget use perl = TRUE using grepl() friends.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_regex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","text":"","code":"ansi_regex()"},{"path":"https://cli.r-lib.org/dev/reference/ansi_regex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","text":"String scalar, regular expression.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":null,"dir":"Reference","previous_headings":"","what":"Simplify ANSI styling tags — ansi_simplify","title":"Simplify ANSI styling tags — ansi_simplify","text":"creates equivalent, possibly shorter ANSI styled string, removing duplicate empty tags.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simplify ANSI styling tags — ansi_simplify","text":"","code":"ansi_simplify(x, csi = c(\"keep\", \"drop\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simplify ANSI styling tags — ansi_simplify","text":"x Input string csi non-SGR ANSI sequences, either \"keep\", \"drop\" .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simplify ANSI styling tags — ansi_simplify","text":"Simplified cli_ansi_string vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Labels a character vector as containing ANSI control codes. — ansi_string","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"function sets class argument, activating ANSI-string-specific methods printing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"","code":"ansi_string(x)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"x character vector something can coerced one.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"cli_ansi_string object, subclass character, length contents x.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove ANSI escape sequences from a string — ansi_strip","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"input may class cli_ansi_string class, also dropped result.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"","code":"ansi_strip(string, sgr = TRUE, csi = TRUE, link = TRUE)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"string input string. sgr Whether remove SGR (styling) control sequences. csi Whether remove non-SGR control sequences. link Whether remove ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"cleaned string. Note ansi_strip() always drops cli_ansi_string class, even sgr sciareFALSE`.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"","code":"ansi_strip(col_red(\"foobar\")) == \"foobar\" #> [1] TRUE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":null,"dir":"Reference","previous_headings":"","what":"Split an ANSI colored string — ansi_strsplit","title":"Split an ANSI colored string — ansi_strsplit","text":"color-aware counterpart base::strsplit(). works almost exactly like original, keeps colors substrings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split an ANSI colored string — ansi_strsplit","text":"","code":"ansi_strsplit(x, split, ...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split an ANSI colored string — ansi_strsplit","text":"x Character vector, potentially ANSI styled, vector coerced character. split Character vector length 1 (object can coerced ) containing regular expression(s) (unless fixed = TRUE) use splitting. empty matches occur, particular split zero characters, x split single characters. ... Extra arguments passed base::strsplit().","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split an ANSI colored string — ansi_strsplit","text":"list length x, -th element contains vector splits x[]. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split an ANSI colored string — ansi_strsplit","text":"","code":"str <- paste0( col_red(\"I am red---\"), col_green(\"and I am green-\"), style_underline(\"I underlined\") ) cat(str, \"\\n\") #> I am red---and I am green-I underlined # split at dashes, keep color cat(ansi_strsplit(str, \"[-]+\")[[1]], sep = \"\\n\") #> I am red #> and I am green #> I underlined strsplit(ansi_strip(str), \"[-]+\") #> [[1]] #> [1] \"I am red\" \"and I am green\" \"I underlined\" #> # split to characters, keep color cat(ansi_strsplit(str, \"\")[[1]], \"\\n\", sep = \" \") #> I a m r e d - - - a n d I a m g r e e n - I u n d e r l i n e d strsplit(ansi_strip(str), \"\") #> [[1]] #> [1] \"I\" \" \" \"a\" \"m\" \" \" \"r\" \"e\" \"d\" \"-\" \"-\" \"-\" \"a\" \"n\" \"d\" \" \" \"I\" \" \" #> [18] \"a\" \"m\" \" \" \"g\" \"r\" \"e\" \"e\" \"n\" \"-\" \"I\" \" \" \"u\" \"n\" \"d\" \"e\" \"r\" \"l\" #> [35] \"i\" \"n\" \"e\" \"d\" #>"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":null,"dir":"Reference","previous_headings":"","what":"Truncate an ANSI string — ansi_strtrim","title":"Truncate an ANSI string — ansi_strtrim","text":"function similar base::strtrim(), works correctly ANSI styled strings. also adds ... (corresponding Unicode character Unicode characters allowed) end truncated strings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Truncate an ANSI string — ansi_strtrim","text":"","code":"ansi_strtrim(x, width = console_width(), ellipsis = symbol$ellipsis)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Truncate an ANSI string — ansi_strtrim","text":"x Character vector ANSI strings. width width truncate . ellipsis string append truncated strings. Supply empty string want marker.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Truncate an ANSI string — ansi_strtrim","text":"Note: ansi_strtrim() support NA values currently.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Truncate an ANSI string — ansi_strtrim","text":"","code":"text <- cli::col_red(cli:::lorem_ipsum()) ansi_strtrim(c(text, \"foobar\"), 40) #> #> [1] Culpa laboris laborum occaecat occaecat… #> [2] foobar"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap an ANSI styled string to a certain width — ansi_strwrap","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"function similar base::strwrap(), works ANSI styled strings, leaves styling intact.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"","code":"ansi_strwrap( x, width = console_width(), indent = 0, exdent = 0, simplify = TRUE )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"x ANSI string. width Width wrap . indent Indentation first line paragraph. exdent Indentation subsequent lines paragraph. simplify Whether return wrapped strings single character vector, wrap element x independently return list.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"simplify FALSE, list character vectors, ANSI string. Otherwise single ANSI string vector.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"","code":"text <- cli:::lorem_ipsum() # Highlight some words, that start with 's' rexp <- gregexpr(\"\\\\b([sS][a-zA-Z]+)\\\\b\", text) regmatches(text, rexp) <- lapply(regmatches(text, rexp), col_red) cat(text) #> Mollit adipisicing laborum Lorem non eu velit sint deserunt amet Lorem qui culpa. Laboris dolore cupidatat laborum incididunt. Cupidatat duis in amet sit. Incididunt labore aute esse est ipsum cillum commodo qui minim ut veniam laborum nostrud nostrud. Reprehenderit irure nostrud duis esse quis nisi aliquip ipsum minim duis fugiat ea. Dolore consectetur non cupidatat officia Lorem elit. Ad aliqua aute pariatur anim ex culpa Lorem. Mollit magna sint pariatur non quis do duis non sint elit ullamco exercitation consectetur aliqua. Nostrud laborum deserunt adipisicing tempor amet qui duis. Mollit non aliquip ea sunt quis tempor dolore esse. wrp <- ansi_strwrap(text, width = 40) cat(wrp, sep = \"\\n\") #> Mollit adipisicing laborum Lorem non eu #> velit sint deserunt amet Lorem qui #> culpa. Laboris dolore cupidatat laborum #> incididunt. Cupidatat duis in amet sit. #> Incididunt labore aute esse est ipsum #> cillum commodo qui minim ut veniam #> laborum nostrud nostrud. Reprehenderit #> irure nostrud duis esse quis nisi #> aliquip ipsum minim duis fugiat ea. #> Dolore consectetur non cupidatat #> officia Lorem elit. Ad aliqua aute #> pariatur anim ex culpa Lorem. Mollit #> magna sint pariatur non quis do duis #> non sint elit ullamco exercitation #> consectetur aliqua. Nostrud laborum #> deserunt adipisicing tempor amet qui #> duis. Mollit non aliquip ea sunt quis #> tempor dolore esse."},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":null,"dir":"Reference","previous_headings":"","what":"Substring(s) of an ANSI colored string — ansi_substr","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"color-aware counterpart base::substr(). works exactly like original, keeps colors substrings. ANSI escape sequences ignored calculating positions within string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"","code":"ansi_substr(x, start, stop)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"x Character vector, potentially ANSI styled, vector coerced character. start Starting index indices, recycled match length x. stop Ending index indices, recycled match length x.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"Character vector length x, containing requested substrings. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"","code":"str <- paste( col_red(\"red\"), \"default\", col_green(\"green\") ) cat(str, \"\\n\") #> red default green cat(ansi_substr(str, 1, 5), \"\\n\") #> red d cat(ansi_substr(str, 1, 15), \"\\n\") #> red default gre cat(ansi_substr(str, 3, 7), \"\\n\") #> d def substr(ansi_strip(str), 1, 5) #> [1] \"red d\" substr(ansi_strip(str), 1, 15) #> [1] \"red default gre\" substr(ansi_strip(str), 3, 7) #> [1] \"d def\" str2 <- paste( \"another\", col_red(\"multi-\", style_underline(\"style\")), \"text\" ) cat(str2, \"\\n\") #> another multi-style text cat(ansi_substr(c(str, str2), c(3,5), c(7, 18)), sep = \"\\n\") #> d def #> her multi-styl substr(ansi_strip(c(str, str2)), c(3,5), c(7, 18)) #> [1] \"d def\" \"her multi-styl\""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":null,"dir":"Reference","previous_headings":"","what":"Substring(s) of an ANSI colored string — ansi_substring","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"color-aware counterpart base::substring(). works exactly like original, keeps colors substrings. ANSI escape sequences ignored calculating positions within string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"","code":"ansi_substring(text, first, last = 1000000L)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"text Character vector, potentially ANSI styled, vector coerced character. recycled longest first last. first Starting index indices, recycled match length x. last Ending index indices, recycled match length x.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"Character vector length x, containing requested substrings. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"","code":"str <- paste( col_red(\"red\"), \"default\", col_green(\"green\") ) cat(str, \"\\n\") #> red default green cat(ansi_substring(str, 1, 5), \"\\n\") #> red d cat(ansi_substring(str, 1, 15), \"\\n\") #> red default gre cat(ansi_substring(str, 3, 7), \"\\n\") #> d def substring(ansi_strip(str), 1, 5) #> [1] \"red d\" substring(ansi_strip(str), 1, 15) #> [1] \"red default gre\" substring(ansi_strip(str), 3, 7) #> [1] \"d def\" str2 <- paste( \"another\", col_red(\"multi-\", style_underline(\"style\")), \"text\" ) cat(str2, \"\\n\") #> another multi-style text cat(ansi_substring(str2, c(3,5), c(7, 18)), sep = \"\\n\") #> other #> her multi-styl substring(ansi_strip(str2), c(3,5), c(7, 18)) #> [1] \"other\" \"her multi-styl\""},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":null,"dir":"Reference","previous_headings":"","what":"ANSI character translation and case folding — ansi_toupper","title":"ANSI character translation and case folding — ansi_toupper","text":"functions similar toupper(), tolower() chartr(), keep ANSI colors string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ANSI character translation and case folding — ansi_toupper","text":"","code":"ansi_toupper(x) ansi_tolower(x) ansi_chartr(old, new, x)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ANSI character translation and case folding — ansi_toupper","text":"x Input string. May ANSI colors styles. old character string specifying characters translated. character vector length 2 supplied, first element used warning. new character string specifying translations. character vector length 2 supplied, first element used warning.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ANSI character translation and case folding — ansi_toupper","text":"Character vector length x, containing translated strings. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ANSI character translation and case folding — ansi_toupper","text":"","code":"ansi_toupper(col_red(\"Uppercase\")) #> #> [1] UPPERCASE ansi_tolower(col_red(\"LowerCase\")) #> #> [1] lowercase x <- paste0(col_green(\"MiXeD\"), col_red(\" cAsE 123\")) ansi_chartr(\"iXs\", \"why\", x) #> #> [1] MwheD cAyE 123"},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"function similar base::trimws() works ANSI strings, keeps color styling.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"","code":"ansi_trimws(x, which = c(\"both\", \"left\", \"right\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"x ANSI string vector. Whether remove leading trailing whitespace .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"ANSI string, whitespace removed.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"","code":"trimws(paste0(\" \", col_red(\"I am red\"), \" \")) #> [1] \"\\033[31mI am red\\033[39m\" ansi_trimws(paste0(\" \", col_red(\"I am red\"), \" \")) #> #> [1] I am red trimws(col_red(\" I am red \")) #> #> [1] I am red ansi_trimws(col_red(\" I am red \")) #> #> [1] I am red"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a banner-like box in the console — list_border_styles","title":"Draw a banner-like box in the console — list_border_styles","text":"Draw banner-like box console","code":""},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"list_border_styles() boxx( label, header = \"\", footer = \"\", border_style = \"single\", padding = 1, margin = 0, float = c(\"left\", \"center\", \"right\"), col = NULL, background_col = NULL, border_col = col, align = c(\"left\", \"center\", \"right\"), width = console_width() )"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a banner-like box in the console — list_border_styles","text":"label Label show, character vector. element new line. can color using col_*, bg_* style_* functions, see ANSI styles examples . header Text show top border box. long, cut. footer Text show bottom border box. long, cut. border_style String specifies border style. list_border_styles lists current styles. padding Padding within box. Either integer vector four numbers (bottom, left, top, right), single number x, interpreted c(x, 3*x, x, 3*x). margin Margin around box. Either integer vector four numbers (bottom, left, top, right), single number x, interpreted c(x, 3*x, x, 3*x). float Whether display box \"left\", \"center\", \"right\" screen. col Color text, default border color. Either style function (see ANSI styles) color name passed make_ansi_style(). background_col Background color inside box. Either style function (see ANSI styles), color name used make_ansi_style() create background style (.e. bg = TRUE used). border_col Color border. Either style function (see ANSI styles) color name passed make_ansi_style(). align Alignment label within box: \"left\", \"center\", \"right\". width Width screen, defaults console_width().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"defaults","dir":"Reference","previous_headings":"","what":"Defaults","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\") #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"change-border-style","dir":"Reference","previous_headings":"","what":"Change border style","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", border_style = \"double\") #> ╔══════════════════╗ #> ║ ║ #> ║ Hello there! ║ #> ║ ║ #> ╚══════════════════╝"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"multiple-lines","dir":"Reference","previous_headings":"","what":"Multiple lines","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(c(\"Hello\", \"there!\"), padding = 1) #> ┌────────────┐ #> │ │ #> │ Hello │ #> │ there! │ #> │ │ #> └────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"padding","dir":"Reference","previous_headings":"","what":"Padding","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1) boxx(\"Hello there!\", padding = c(1, 5, 1, 5)) #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"floating","dir":"Reference","previous_headings":"","what":"Floating","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1, float = \"center\") boxx(\"Hello there!\", padding = 1, float = \"right\") #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"text-color","dir":"Reference","previous_headings":"","what":"Text color","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(col_cyan(\"Hello there!\"), padding = 1, float = \"center\") #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"background-color","dir":"Reference","previous_headings":"","what":"Background color","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1, background_col = \"brown\") boxx(\"Hello there!\", padding = 1, background_col = bg_red) #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"border-color","dir":"Reference","previous_headings":"","what":"Border color","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1, border_col = \"green\") boxx(\"Hello there!\", padding = 1, border_col = col_red) #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"label-alignment","dir":"Reference","previous_headings":"","what":"Label alignment","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(c(\"Hi\", \"there\", \"you!\"), padding = 1, align = \"left\") boxx(c(\"Hi\", \"there\", \"you!\"), padding = 1, align = \"center\") boxx(c(\"Hi\", \"there\", \"you!\"), padding = 1, align = \"right\") #> ┌───────────┐ #> │ │ #> │ Hi │ #> │ there │ #> │ you! │ #> │ │ #> └───────────┘ #> ┌───────────┐ #> │ │ #> │ Hi │ #> │ there │ #> │ you! │ #> │ │ #> └───────────┘ #> ┌───────────┐ #> │ │ #> │ Hi │ #> │ there │ #> │ you! │ #> │ │ #> └───────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"a-very-customized-box","dir":"Reference","previous_headings":"","what":"A very customized box","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"star <- symbol$star label <- c(paste(star, \"Hello\", star), \" there!\") boxx( col_white(label), border_style=\"round\", padding = 1, float = \"center\", border_col = \"tomato3\", background_col=\"darkolivegreen\" ) #> ╭───────────────╮ #> │ │ #> │ ★ Hello ★ │ #> │ there! │ #> │ │ #> ╰───────────────╯"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"about-fonts-and-terminal-settings","dir":"Reference","previous_headings":"","what":"About fonts and terminal settings","title":"Draw a banner-like box in the console — list_border_styles","text":"boxes might might look great terminal, depending box style use font terminal uses. found Menlo font looks nice terminals also Emacs. RStudio currently line height greater one console output, makes boxes ugly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":null,"dir":"Reference","previous_headings":"","what":"The built-in CLI theme — builtin_theme","title":"The built-in CLI theme — builtin_theme","text":"theme always active, bottom theme stack. See themes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The built-in CLI theme — builtin_theme","text":"","code":"builtin_theme(dark = getOption(\"cli.theme_dark\", \"auto\"))"},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The built-in CLI theme — builtin_theme","text":"dark Whether use dark theme. cli.theme_dark option can used request dark theme explicitly. set, set \"auto\", cli tries detect dark theme, works recent RStudio versions iTerm macOS.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The built-in CLI theme — builtin_theme","text":"named list, CLI theme.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"showcase","dir":"Reference","previous_headings":"","what":"Showcase","title":"The built-in CLI theme — builtin_theme","text":"","code":"cli_h1(\"Heading 1\") cli_h2(\"Heading 2\") cli_h3(\"Heading 3\") cli_par() cli_alert_danger(\"Danger alert\") cli_alert_warning(\"Warning alert\") cli_alert_info(\"Info alert\") cli_alert_success(\"Success alert\") cli_alert(\"Alert for starting a process or computation\", class = \"alert-start\") cli_end() cli_text(\"Packages and versions: {.pkg cli} {.version 1.0.0}.\") cli_text(\"Time intervals: {.timestamp 3.4s}\") cli_text(\"{.emph Emphasis} and {.strong strong emphasis}\") cli_text(\"This is a piece of code: {.code sum(x) / length(x)}\") cli_text(\"Function names: {.fn cli::simple_theme}\") cli_text(\"Files: {.file /usr/bin/env}\") cli_text(\"URLs: {.url https://r-project.org}\") cli_h2(\"Longer code chunk\") cli_par(class = \"code R\") cli_verbatim( '# window functions are useful for grouped mutates', 'mtcars %>%', ' group_by(cyl) %>%', ' mutate(rank = min_rank(desc(mpg)))') #> ── Heading 1 ───────────────────────────────────────────────────────── #> #> ── Heading 2 ── #> #> ── Heading 3 #> ✖ Danger alert #> ! Warning alert #> ℹ Info alert #> ✔ Success alert #> → Alert for starting a process or computation #> #> Packages and versions: cli 1.0.0. #> Time intervals: [3.4s] #> Emphasis and strong emphasis #> This is a piece of code: `sum(x) / length(x)` #> Function names: `cli::simple_theme()` #> Files: /usr/bin/env #> URLs: #> #> ── Longer code chunk ── #> #> # window functions are useful for grouped mutates #> mtcars %>% #> group_by(cyl) %>% #> mutate(rank = min_rank(desc(mpg)))"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":null,"dir":"Reference","previous_headings":"","what":"cat() helpers — cat_line","title":"cat() helpers — cat_line","text":"helpers provide useful wrappers around cat(): importantly set sep = \"\", cat_line() automatically adds newline.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cat() helpers — cat_line","text":"","code":"cat_line(..., col = NULL, background_col = NULL, file = stdout()) cat_bullet( ..., col = NULL, background_col = NULL, bullet = \"bullet\", bullet_col = NULL, file = stdout() ) cat_boxx(..., file = stdout()) cat_rule(..., file = stdout()) cat_print(x, file = \"\")"},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"cat() helpers — cat_line","text":"... cat_line() cat_bullet(), pasted together collapse = \"\\n\". cat_rule() cat_boxx() passed rule() boxx() respectively. col, background_col, bullet_col Colors text, background, bullets respectively. file Output destination. Defaults standard output. bullet Name bullet character. Indexes symbol x object print.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"cat() helpers — cat_line","text":"","code":"cat_line(\"This is \", \"a \", \"line of text.\", col = \"red\") #> This is a line of text. cat_bullet(letters[1:5]) #> • a #> • b #> • c #> • d #> • e cat_bullet(letters[1:5], bullet = \"tick\", bullet_col = \"green\") #> ✔ a #> ✔ b #> ✔ c #> ✔ d #> ✔ e cat_rule() #> ──────────────────────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":null,"dir":"Reference","previous_headings":"","what":"cli environment variables and options — cli-config","title":"cli environment variables and options — cli-config","text":"cli environment variables options","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"user-facing-configuration","dir":"Reference","previous_headings":"","what":"User facing configuration","title":"cli environment variables and options — cli-config","text":"environment variables options uses may set, modify behavior cli.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-hyperlink-mode","dir":"Reference","previous_headings":"","what":"R_CLI_HYPERLINK_MODE","title":"cli environment variables and options — cli-config","text":"Set posix force generating POSIX compatible ANSI hyperlinks. set, RStudio compatible links generated. temporary crutch RStudio handles POSIX hyperlinks correctly, removed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"no-color","dir":"Reference","previous_headings":"","what":"NO_COLOR","title":"cli environment variables and options — cli-config","text":"Set nonempty value turn ANSI colors. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"ess-background-mode","dir":"Reference","previous_headings":"","what":"ESS_BACKGROUND_MODE","title":"cli environment variables and options — cli-config","text":"Set environment variable light dark indicate dark mode Emacs. https://github.com/emacs-ess/ESS/pull/1178 merged, ESS set automatically.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-dynamic","dir":"Reference","previous_headings":"","what":"R_CLI_DYNAMIC","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See is_dynamic_tty().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-num-colors","dir":"Reference","previous_headings":"","what":"R_CLI_NUM_COLORS","title":"cli environment variables and options — cli-config","text":"Set positive integer assume given number colors. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-hyperlinks","dir":"Reference","previous_headings":"","what":"R_CLI_HYPERLINKS","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See style_hyperlink().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-ansi","dir":"Reference","previous_headings":"","what":"cli.ansi","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True assume terminal supports ANSI control sequences. Set anything else assume non-ANSI terminal. See is_ansi_tty().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-condition-unicode-bullets","dir":"Reference","previous_headings":"","what":"cli.condition_unicode_bullets","title":"cli environment variables and options — cli-config","text":"TRUE FALSE force turn Unicode symbols printing conditions. E.g. format_error(), format_warning(), format_message() also cli_abort(), cli_warn() cli_inform().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-condition-width","dir":"Reference","previous_headings":"","what":"cli.condition_width","title":"cli environment variables and options — cli-config","text":"Integer scalar (Inf) set console width cli formatting errors, warnings messages format_error(), format_warning() format_message(). formatting conditions option takes precedence cli.width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-default-handler","dir":"Reference","previous_headings":"","what":"cli.default_handler","title":"cli environment variables and options — cli-config","text":"General handler function cli conditions. See https://cli.r-lib.org/articles/semantic-cli.html#cli-messages-1","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-default-num-colors","dir":"Reference","previous_headings":"","what":"cli.default_num_colors","title":"cli environment variables and options — cli-config","text":"Default number ANSI colors. value used number colors already set cli.num_colors option, R_CLI_NUM_COLORS environment variable, crayon.enabled crayon.colors options, NO_COLOR environment variable, knitr..progress option, sink() call stream. can also use option color support detected correctly, want adjust number colors. E.g. crayon.enabled TRUE, crayon.colors , Emacs Windows, terminals. See num_ansi_colors(). See also cli.num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-dynamic","dir":"Reference","previous_headings":"","what":"cli.dynamic","title":"cli environment variables and options — cli-config","text":"Set TRUE assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See is_dynamic_tty().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-hide-cursor","dir":"Reference","previous_headings":"","what":"cli.hide_cursor","title":"cli environment variables and options — cli-config","text":"Whether cli status bar try hide cursor terminals. Set FALSE hidden cursor causes issues.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-hyperlink","dir":"Reference","previous_headings":"","what":"cli.hyperlink","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See style_hyperlink().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-ignore-unknown-rstudio-theme","dir":"Reference","previous_headings":"","what":"cli.ignore_unknown_rstudio_theme","title":"cli environment variables and options — cli-config","text":"Set TRUE omit warning unknown RStudio theme code_highlight().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-num-colors","dir":"Reference","previous_headings":"","what":"cli.num_colors","title":"cli environment variables and options — cli-config","text":"Number ANSI colors. See num_ansi_colors(). See also cli.default_num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-message-class","dir":"Reference","previous_headings":"","what":"cli.message_class","title":"cli environment variables and options — cli-config","text":"Character vector classes add cli's conditions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-bar-style","dir":"Reference","previous_headings":"","what":"cli.progress_bar_style","title":"cli environment variables and options — cli-config","text":"Progress bar style. See cli_progress_styles().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-bar-style-ascii","dir":"Reference","previous_headings":"","what":"cli.progress_bar_style_ascii","title":"cli environment variables and options — cli-config","text":"Progress bar style ASCII consoles. See cli_progress_styles().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-bar-style-unicode","dir":"Reference","previous_headings":"","what":"cli.progress_bar_style_unicode","title":"cli environment variables and options — cli-config","text":"Progress bar style Unicode (UTF-8) consoles; See cli_progress_styles().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-clear","dir":"Reference","previous_headings":"","what":"cli.progress_clear","title":"cli environment variables and options — cli-config","text":"Whether clear terminated progress bar screen dynamic terminals. See cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-demo-live","dir":"Reference","previous_headings":"","what":"cli.progress_demo_live","title":"cli environment variables and options — cli-config","text":"Whether cli_progress_demo() show live demo, just record progress bar frames.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-download","dir":"Reference","previous_headings":"","what":"cli.progress_format_download","title":"cli environment variables and options — cli-config","text":"Default format string download progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-download-nototal","dir":"Reference","previous_headings":"","what":"cli.progress_format_download_nototal","title":"cli environment variables and options — cli-config","text":"Default format string download progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-iterator","dir":"Reference","previous_headings":"","what":"cli.progress_format_iterator","title":"cli environment variables and options — cli-config","text":"Default format string iterator progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-iterator-nototal","dir":"Reference","previous_headings":"","what":"cli.progress_format_iterator_nototal","title":"cli environment variables and options — cli-config","text":"Default format string iterator progress bars unknown total number progress units.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-tasks","dir":"Reference","previous_headings":"","what":"cli.progress_format_tasks","title":"cli environment variables and options — cli-config","text":"Default format string tasks progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-tasks-nototal","dir":"Reference","previous_headings":"","what":"cli.progress_format_tasks_nototal","title":"cli environment variables and options — cli-config","text":"Default format string tasks progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-handlers","dir":"Reference","previous_headings":"","what":"cli.progress_handlers","title":"cli environment variables and options — cli-config","text":"Progress handlers try. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-handlers-force","dir":"Reference","previous_headings":"","what":"cli.progress_handlers_force","title":"cli environment variables and options — cli-config","text":"Progress handlers always used, even another handler already selected. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-handlers-only","dir":"Reference","previous_headings":"","what":"cli.progress_handlers_only","title":"cli environment variables and options — cli-config","text":"Progress handlers force, ignoring handlers set cli.progress_handlers cli.progress_handlers_force. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-say-args","dir":"Reference","previous_headings":"","what":"cli.progress_say_args","title":"cli environment variables and options — cli-config","text":"Command line arguments say progress handlers. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-say-command","dir":"Reference","previous_headings":"","what":"cli.progress_say_command","title":"cli environment variables and options — cli-config","text":"External command use say progress handler. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-say-frequency","dir":"Reference","previous_headings":"","what":"cli.progress_say_frequency","title":"cli environment variables and options — cli-config","text":"Minimum delay say calls say progress handler. say ignores frequent updates, keep speech comprehensible. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-show-after","dir":"Reference","previous_headings":"","what":"cli.progress_show_after","title":"cli environment variables and options — cli-config","text":"Delay showing progress bar, seconds. Progress bars finish delay shown . cli also shows progress bars 50% go half delay passed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-spinner","dir":"Reference","previous_headings":"","what":"cli.spinner","title":"cli environment variables and options — cli-config","text":"Default spinner use, see get_spinner().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-spinner-ascii","dir":"Reference","previous_headings":"","what":"cli.spinner_ascii","title":"cli environment variables and options — cli-config","text":"Default spinner use ASCII terminals, see get_spinner().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-spinner-unicode","dir":"Reference","previous_headings":"","what":"cli.spinner_unicode","title":"cli environment variables and options — cli-config","text":"Default spinner use Unicode terminals, see get_spinner().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-theme","dir":"Reference","previous_headings":"","what":"cli.theme","title":"cli environment variables and options — cli-config","text":"Default cli theme, addition built-theme. option intended package developers. See themes start_app().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-theme-dark","dir":"Reference","previous_headings":"","what":"cli.theme_dark","title":"cli environment variables and options — cli-config","text":"Whether cli assume dark theme builtin theme. See builtin_theme().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-unicode","dir":"Reference","previous_headings":"","what":"cli.unicode","title":"cli environment variables and options — cli-config","text":"Whether assume Unicode terminal. set, auto-detected. See is_utf8_output().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-user-theme","dir":"Reference","previous_headings":"","what":"cli.user_theme","title":"cli environment variables and options — cli-config","text":"cli user theme. option intended end users. See themes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-warn-inline-newlines","dir":"Reference","previous_headings":"","what":"cli.warn_inline_newlines","title":"cli environment variables and options — cli-config","text":"Whether emit warning cli replaces newline characters spaces within {.class } inline style. Defaults FALSE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-width","dir":"Reference","previous_headings":"","what":"cli.width","title":"cli environment variables and options — cli-config","text":"Terminal width assume. set, auto-detected. See console_width().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rlib-interactive","dir":"Reference","previous_headings":"","what":"rlib_interactive","title":"cli environment variables and options — cli-config","text":"Whether assume interactive R session. set, auto-detected.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"width","dir":"Reference","previous_headings":"","what":"width","title":"cli environment variables and options — cli-config","text":"Terminal width. used platforms, cli.width set.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"internal-configuration","dir":"Reference","previous_headings":"","what":"Internal configuration","title":"cli environment variables and options — cli-config","text":"environment variables options cli developers, users rely may change cli releases.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"asciicast","dir":"Reference","previous_headings":"","what":"ASCIICAST","title":"cli environment variables and options — cli-config","text":"Used detect asciicast sub-process RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"ansicon","dir":"Reference","previous_headings":"","what":"ANSICON","title":"cli environment variables and options — cli-config","text":"Used detect ANSICON detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"ci","dir":"Reference","previous_headings":"","what":"CI","title":"cli environment variables and options — cli-config","text":"Used detect code running CI. yes, avoid ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-debug-bad-end","dir":"Reference","previous_headings":"","what":"CLI_DEBUG_BAD_END","title":"cli environment variables and options — cli-config","text":"Whether warn cli_end() calls container close.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-no-builtin-theme","dir":"Reference","previous_headings":"","what":"CLI_NO_BUILTIN_THEME","title":"cli environment variables and options — cli-config","text":"Set true omit builtin theme.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-speed-time","dir":"Reference","previous_headings":"","what":"CLI_SPEED_TIME","title":"cli environment variables and options — cli-config","text":"Can used speed cli's timer. factor, e.g. setting 2 makes cli's time go twice fast.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-tick-time","dir":"Reference","previous_headings":"","what":"CLI_TICK_TIME","title":"cli environment variables and options — cli-config","text":"often cli timer alert, milliseconds.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cmder-root","dir":"Reference","previous_headings":"","what":"CMDER_ROOT","title":"cli environment variables and options — cli-config","text":"Used detect cmder detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"colorterm","dir":"Reference","previous_headings":"","what":"COLORTERM","title":"cli environment variables and options — cli-config","text":"Used detecting ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"conemuansi","dir":"Reference","previous_headings":"","what":"ConEmuANSI","title":"cli environment variables and options — cli-config","text":"Used detect ConEmu detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"emacs","dir":"Reference","previous_headings":"","what":"EMACS","title":"cli environment variables and options — cli-config","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"inside-emacs","dir":"Reference","previous_headings":"","what":"INSIDE_EMACS","title":"cli environment variables and options — cli-config","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"not-cran","dir":"Reference","previous_headings":"","what":"NOT_CRAN","title":"cli environment variables and options — cli-config","text":"Set true run tests / examples / checks, run CRAN.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"-r-check-package-name-","dir":"Reference","previous_headings":"","what":"_R_CHECK_PACKAGE_NAME_","title":"cli environment variables and options — cli-config","text":"Used detect R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-browser","dir":"Reference","previous_headings":"","what":"R_BROWSER","title":"cli environment variables and options — cli-config","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-gui-app-version","dir":"Reference","previous_headings":"","what":"R_GUI_APP_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect R.app macOS, decide console ANSI control sequences.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-package-dir","dir":"Reference","previous_headings":"","what":"R_PACKAGE_DIR","title":"cli environment variables and options — cli-config","text":"Used detect code running R CMD INSTALL.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-pdfviewer","dir":"Reference","previous_headings":"","what":"R_PDFVIEWER","title":"cli environment variables and options — cli-config","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-progress-no-examples","dir":"Reference","previous_headings":"","what":"R_PROGRESS_NO_EXAMPLES","title":"cli environment variables and options — cli-config","text":"Set true avoid running examples, outside R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio","dir":"Reference","previous_headings":"","what":"RSTUDIO","title":"cli environment variables and options — cli-config","text":"Used detect RStudio, various functions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-console-color","dir":"Reference","previous_headings":"","what":"RSTUDIO_CONSOLE_COLOR","title":"cli environment variables and options — cli-config","text":"Used detect number colors RStudio. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-console-width","dir":"Reference","previous_headings":"","what":"RSTUDIO_CONSOLE_WIDTH","title":"cli environment variables and options — cli-config","text":"Used auto-detect console width RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-term","dir":"Reference","previous_headings":"","what":"RSTUDIO_TERM","title":"cli environment variables and options — cli-config","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"teamcity-version","dir":"Reference","previous_headings":"","what":"TEAMCITY_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect TeamCity CI, turn ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"term","dir":"Reference","previous_headings":"","what":"TERM","title":"cli environment variables and options — cli-config","text":"Used detect console ANSI control sequences, terminal.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"term-program","dir":"Reference","previous_headings":"","what":"TERM_PROGRAM","title":"cli environment variables and options — cli-config","text":"Used detect iTerm dark theme detection ANSI hyperlink support detection.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"term-program-version","dir":"Reference","previous_headings":"","what":"TERM_PROGRAM_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect suitable iTerm version ANSI hyperlink support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"testthat","dir":"Reference","previous_headings":"","what":"TESTTHAT","title":"cli environment variables and options — cli-config","text":"Used detect running testthat tests.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"vte-version","dir":"Reference","previous_headings":"","what":"VTE_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect suitable VTE version ANSI hyperlinks.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-pb","dir":"Reference","previous_headings":"","what":"cli__pb","title":"cli environment variables and options — cli-config","text":"option set progress bar updated, interpolating format string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-record","dir":"Reference","previous_headings":"","what":"cli.record","title":"cli environment variables and options — cli-config","text":"Internal option mark state cli recording messages.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"crayon-colors","dir":"Reference","previous_headings":"","what":"crayon.colors","title":"cli environment variables and options — cli-config","text":"Deprecated option number ANSI colors, still supported cli, new options set. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"crayon-enabled","dir":"Reference","previous_headings":"","what":"crayon.enabled","title":"cli environment variables and options — cli-config","text":"Deprecated option turn ANSI colors /. still supported cli new options set. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"crayon-hyperlink","dir":"Reference","previous_headings":"","what":"crayon.hyperlink","title":"cli environment variables and options — cli-config","text":"Whether assume ANSI hyperlink support. See ansi_has_hyperlink_support().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"knitr-in-progress","dir":"Reference","previous_headings":"","what":"knitr.in.progress","title":"cli environment variables and options — cli-config","text":"Used detect knitr detecting interactive sessions ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-notebook-executing","dir":"Reference","previous_headings":"","what":"rstudio.notebook.executing","title":"cli environment variables and options — cli-config","text":"Used detect knitr detecting interactive sessions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-package.html","id":null,"dir":"Reference","previous_headings":"","what":"cli: Helpers for Developing Command Line Interfaces — cli-package","title":"cli: Helpers for Developing Command Line Interfaces — cli-package","text":"suite tools build attractive command line interfaces ('CLIs'), semantic elements: headings, lists, alerts, paragraphs, etc. Supports custom themes via 'CSS'-like language. also contains number lower level 'CLI' elements: rules, boxes, trees, 'Unicode' symbols 'ASCII' alternatives. support ANSI colors text styles well.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"cli: Helpers for Developing Command Line Interfaces — cli-package","text":"Maintainer: Gábor Csárdi csardi.gabor@gmail.com contributors: Hadley Wickham [contributor] Kirill Müller [contributor] Salim Brüggemann salim-b@pm.(ORCID) [contributor] Posit Software, PBC [copyright holder, funder]","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose multiple cli functions — cli","title":"Compose multiple cli functions — cli","text":"cli() record cli_* calls expr, emit together single message. useful want built larger piece output multiple cli_* calls.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose multiple cli functions — cli","text":"","code":"cli(expr)"},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose multiple cli functions — cli","text":"expr Expression contains cli_* calls. output collected sent single message.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compose multiple cli functions — cli","text":"Nothing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compose multiple cli functions — cli","text":"Use function build complex piece CLI make sense show pieces.","code":"cli({ cli_h1(\"Title\") cli_h2(\"Subtitle\") cli_ul(c(\"this\", \"that\", \"end\")) }) #> #> ── Title ───────────────────────────────────────────────────────────── #> #> ── Subtitle ── #> #> • this #> • that #> • end"},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":null,"dir":"Reference","previous_headings":"","what":"Signal an error, warning or message with a cli formatted message — cli_abort","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"functions let create error, warning diagnostic messages cli formatting, including inline styling, pluralization glue substitutions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"","code":"cli_abort( message, ..., call = .envir, .envir = parent.frame(), .frame = .envir ) cli_warn(message, ..., .envir = parent.frame()) cli_inform(message, ..., .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"message formatted via call cli_bullets(). ... Passed rlang::abort(), rlang::warn() rlang::inform(). call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages. .envir Environment evaluate glue expressions . .frame throwing context. Used default .trace_bottom, determine internal package mention internal errors .internal TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"","code":"n <- \"boo\" cli_abort(c( \"{.var n} must be a numeric vector\", \"x\" = \"You've supplied a {.cls {class(n)}} vector.\" )) #> Error: #> ! `n` must be a numeric vector #> ✖ You've supplied a vector. #> Run `rlang::last_error()` to see where the error occurred. len <- 26 idx <- 100 cli_abort(c( \"Must index an existing element:\", \"i\" = \"There {?is/are} {len} element{?s}.\", \"x\" = \"You've tried to subset element {idx}.\" )) #> Error: #> ! Must index an existing element: #> ℹ There are 26 elements. #> ✖ You've tried to subset element 100. #> Run `rlang::last_error()` to see where the error occurred."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI alerts — cli_alert","title":"CLI alerts — cli_alert","text":"Alerts typically short status messages.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI alerts — cli_alert","text":"","code":"cli_alert(text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame()) cli_alert_success( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() ) cli_alert_danger( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() ) cli_alert_warning( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() ) cli_alert_info( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI alerts — cli_alert","text":"text Text alert. id Id alert element. Can used themes. class Class alert element. Can used themes. wrap Whether auto-wrap text alert. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"success","dir":"Reference","previous_headings":"","what":"Success","title":"CLI alerts — cli_alert","text":"","code":"nbld <- 11 tbld <- prettyunits::pretty_sec(5.6) cli_alert_success(\"Built {.emph {nbld}} status report{?s} in {tbld}.\") #> ✔ Built 11 status reports in 5.6s."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"info","dir":"Reference","previous_headings":"","what":"Info","title":"CLI alerts — cli_alert","text":"","code":"cfl <- \"~/.cache/files/latest.cache\" cli_alert_info(\"Updating cache file {.path {cfl}}.\") #> ℹ Updating cache file ~/.cache/files/latest.cache."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"warning","dir":"Reference","previous_headings":"","what":"Warning","title":"CLI alerts — cli_alert","text":"","code":"cfl <- \"~/.cache/files/latest.cache\" cli_alert_warning(\"Failed to update cache file {.path {cfl}}.\") #> ! Failed to update cache file ~/.cache/files/latest.cache."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"danger","dir":"Reference","previous_headings":"","what":"Danger","title":"CLI alerts — cli_alert","text":"","code":"cfl <- \"~/.config/report.yaml\" cli_alert_danger(\"Cannot validate config file at {.path {cfl}}.\") #> ✖ Cannot validate config file at ~/.config/report.yaml."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"text-wrapping","dir":"Reference","previous_headings":"","what":"Text wrapping","title":"CLI alerts — cli_alert","text":"Alerts printed without wrapping, unless set wrap = TRUE:","code":"cli_alert_info(\"Data columns: {.val {names(mtcars)}}.\") cli_alert_info(\"Data columns: {.val {names(mtcars)}}.\", wrap = TRUE) #> ℹ Data columns: \"mpg\", \"cyl\", \"disp\", \"hp\", \"drat\", \"wt\", \"qsec\", \"vs\", \"am\", \"g #> ear\", and \"carb\". #> ℹ Data columns: \"mpg\", \"cyl\", \"disp\", \"hp\", \"drat\", \"wt\", \"qsec\", #> \"vs\", \"am\", \"gear\", and \"carb\"."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI block quote — cli_blockquote","title":"CLI block quote — cli_blockquote","text":"section quoted another source. typically indented.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI block quote — cli_blockquote","text":"","code":"cli_blockquote( quote, citation = NULL, id = NULL, class = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI block quote — cli_blockquote","text":"quote Text quotation. citation Source quotation, typically link name person. id Element id, string. NULL, new id generated returned. class Class name, sting. Can used themes. .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CLI block quote — cli_blockquote","text":"","code":"evil <- paste( \"The real problem is that programmers have spent far too much time\", \"worrying about efficiency in the wrong places and at the wrong\", \"times; premature optimization is the root of all evil (or at least\", \"most of it) in programming.\") cli_blockquote(evil, citation = \"Donald Ervin Knuth\") #> #> “The real problem is that programmers have spent far #> too much time worrying about efficiency in the wrong #> places and at the wrong times; premature optimization #> is the root of all evil (or at least most of it) in #> programming.” #> — Donald Ervin Knuth #>"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":null,"dir":"Reference","previous_headings":"","what":"List of items — cli_bullets","title":"List of items — cli_bullets","text":"often useful print list items, tasks function package performs, list notes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List of items — cli_bullets","text":"","code":"cli_bullets(text, id = NULL, class = NULL, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List of items — cli_bullets","text":"text Character vector items. See details names interpreted. id Optional id div.bullets element, can used themes. class Optional additional class(es) div.bullets element. .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"List of items — cli_bullets","text":"Items may formatted differently, e.g. can prefix symbol. Formatting specified names text, can themed. cli creates div element class bullets whole bullet list. item another div element class bullet-, name entry text. Entries text without name create div element class bullet-empty, name single space character, class bullet-space. built-theme defines following item types: name: Item without prefix. : Indented item. *: Item bullet. >: Item arrow pointer. v: Item green \"tick\" symbol, like cli_alert_success(). x: Item ref cross, like cli_alert_danger(). !: Item yellow exclamation mark, like cli_alert_warning(). : Info item, like cli_alert_info(). can define new item type simply defining theming corresponding bullet- classes.","code":"cli_bullets(c( \"noindent\", \" \" = \"indent\", \"*\" = \"bullet\", \">\" = \"arrow\", \"v\" = \"success\", \"x\" = \"danger\", \"!\" = \"warning\", \"i\" = \"info\" )) #> noindent #> indent #> • bullet #> → arrow #> ✔ success #> ✖ danger #> ! warning #> ℹ info"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":null,"dir":"Reference","previous_headings":"","what":"List of verbatim items — cli_bullets_raw","title":"List of verbatim items — cli_bullets_raw","text":"cli_format_bullets_raw() similar cli_bullets(), perform inline styling glue substitutions input.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List of verbatim items — cli_bullets_raw","text":"","code":"cli_bullets_raw(text, id = NULL, class = NULL) format_bullets_raw(text, id = NULL, class = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List of verbatim items — cli_bullets_raw","text":"text Character vector items. See details names interpreted. id Optional id div.bullets element, can used themes. class Optional additional class(es) div.bullets element.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"List of verbatim items — cli_bullets_raw","text":"format_bullets_raw() returns output instead printing .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":null,"dir":"Reference","previous_headings":"","what":"A block of code — cli_code","title":"A block of code — cli_code","text":"helper function creates div class code calls cli_verbatim() output code lines. builtin theme formats containers specially. particular, adds syntax highlighting valid R code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A block of code — cli_code","text":"","code":"cli_code( lines = NULL, ..., language = \"R\", .auto_close = TRUE, .envir = environment() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A block of code — cli_code","text":"lines Character vector, line line code, newline characters also create new lines. Note glue substitution performed code. ... character vectors, appended lines. language Programming language. also added class, addition code. .auto_close Passed cli_div() creating container code. default code container closed emitting lines ... via cli_verbatim(). can keep container open .auto_close /.envir, calling cli_verbatim() add () code. Note code formatted syntax highlighted separately cli_verbatim() call. .envir Passed cli_div() creating container code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A block of code — cli_code","text":"id container contains code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A block of code — cli_code","text":"","code":"myfun <- function() { message(\"Just an example function\") graphics::pairs(iris, col = 1:4) } cli_code(format(myfun)) #> function () #> { #> message(\"Just an example function\") #> graphics::pairs(iris, col = 1:4) #> }"},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":null,"dir":"Reference","previous_headings":"","what":"Debug cli internals — cli_debug_doc","title":"Debug cli internals — cli_debug_doc","text":"Return current state cli app. includes currently open tags, ids, classes computed styles.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Debug cli internals — cli_debug_doc","text":"","code":"cli_debug_doc(app = default_app() %||% start_app())"},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Debug cli internals — cli_debug_doc","text":"app cli app debug. Defaults current app. app, creates one calling start_app().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Debug cli internals — cli_debug_doc","text":"Data frame columns: tag, id, class (space separated), theme (id theme element added), styles (computed styles element).","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Debug cli internals — cli_debug_doc","text":"returned data frame print method, want create plain data frame , index empty bracket: cli_debug_doc()[]. see currently active themes, use app$themes, e.g. default app: default_app()$themes.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Debug cli internals — cli_debug_doc","text":"","code":"if (FALSE) { # \\dontrun{ cli_debug_doc() olid <- cli_ol() cli_li() cli_debug_doc() cli_debug_doc()[] cli_end(olid) cli_debug_doc() } # }"},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":null,"dir":"Reference","previous_headings":"","what":"Generic CLI container — cli_div","title":"Generic CLI container — cli_div","text":"See containers. cli_div container special, may add new themes, valid within container.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generic CLI container — cli_div","text":"","code":"cli_div( id = NULL, class = NULL, theme = NULL, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generic CLI container — cli_div","text":"id Element id, string. NULL, new id generated returned. class Class name, sting. Can used themes. theme custom theme container. See themes. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generic CLI container — cli_div","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"custom-themes","dir":"Reference","previous_headings":"","what":"Custom themes","title":"Generic CLI container — cli_div","text":"","code":"d <- cli_div(theme = list(h1 = list(color = \"cyan\", \"font-weight\" = \"bold\"))) cli_h1(\"Custom title\") cli_end(d) #> #> Custom title"},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"auto-closing","dir":"Reference","previous_headings":"","what":"Auto-closing","title":"Generic CLI container — cli_div","text":"default cli_div() closed automatically calling frame exits.","code":"div <- function() { cli_div(class = \"tmp\", theme = list(.tmp = list(color = \"yellow\"))) cli_text(\"This is yellow\") } div() cli_text(\"This is not yellow any more\") #> This is yellow #> This is not yellow any more"},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":null,"dir":"Reference","previous_headings":"","what":"Definition list — cli_dl","title":"Definition list — cli_dl","text":"definition list container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Definition list — cli_dl","text":"","code":"cli_dl( items = NULL, labels = names(items), id = NULL, class = NULL, .close = TRUE, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Definition list — cli_dl","text":"items Named character vector, NULL. NULL, used list items. labels Item labels. Defaults names items. id Id list container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class list container. Can used themes. .close Whether close list container items specified. FALSE new items can added list. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Definition list — cli_dl","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"all-items-at-once","dir":"Reference","previous_headings":"","what":"All items at once","title":"Definition list — cli_dl","text":"","code":"fun <- function() { cli_dl(c(foo = \"one\", bar = \"two\", baz = \"three\")) } fun() #> foo: one #> bar: two #> baz: three"},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"items-one-by-one","dir":"Reference","previous_headings":"","what":"Items one by one","title":"Definition list — cli_dl","text":"","code":"fun <- function() { cli_dl() cli_li(c(foo = \"{.emph one}\")) cli_li(c(bar = \"two\")) cli_li(c(baz = \"three\")) } fun() #> foo: one #> bar: two #> baz: three"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":null,"dir":"Reference","previous_headings":"","what":"Close a CLI container — cli_end","title":"Close a CLI container — cli_end","text":"Containers aut0-close default, sometimes need explicitly close . Closing container also closes nested containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Close a CLI container — cli_end","text":"","code":"cli_end(id = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Close a CLI container — cli_end","text":"id Id container close. missing, current container closed, .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"explicit-closing","dir":"Reference","previous_headings":"","what":"Explicit closing","title":"Close a CLI container — cli_end","text":"","code":"cnt <- cli_par() cli_text(\"First paragraph.\") cli_end(cnt) cnt <- cli_par() cli_text(\"Second paragraph.\") cli_end(cnt) #> First paragraph. #> #> Second paragraph. #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"closing-a-stack-of-containers","dir":"Reference","previous_headings":"","what":"Closing a stack of containers","title":"Close a CLI container — cli_end","text":"","code":"list <- cli_ul() cli_li(\"Item one:\") cli_li(\"Item two:\") cli_par() cli_text(\"Still item two.\") cli_end(list) cli_text(\"Not in the list any more\") #> • Item one: #> • Item two: #> Still item two. #> #> Not in the list any more"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"omitting-id","dir":"Reference","previous_headings":"","what":"Omitting id","title":"Close a CLI container — cli_end","text":"id omitted, container opened last closed.","code":"cli_par() cli_text(\"First paragraph\") cli_end() cli_par() cli_text(\"Second paragraph\") cli_end() #> First paragraph #> #> Second paragraph #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"debugging-containers","dir":"Reference","previous_headings":"","what":"Debugging containers","title":"Close a CLI container — cli_end","text":"can use internal cli:::cli_debug_doc() function see currently open containers.","code":"fun <- function() { cli_div(id = \"mydiv\") cli_par(class = \"myclass\") cli:::cli_debug_doc() } fun() #> #> #>
      +theme #> "},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":null,"dir":"Reference","previous_headings":"","what":"Capture the output of cli functions instead of printing it — cli_fmt","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"Capture output cli functions instead printing ","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"","code":"cli_fmt(expr, collapse = FALSE, strip_newline = FALSE)"},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"expr Expression evaluate, containing cli_*() calls, typically. collapse Whether collapse output single character scalar, return character vector one element line. strip_newline Whether strip trailing newline.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"","code":"cli_fmt({ cli_alert_info(\"Loading data file\") cli_alert_success(\"Loaded data file\") }) #> [1] \"\\033[36mℹ\\033[39m Loading data file\" #> [2] \"\\033[32m✔\\033[39m Loaded data file\""},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Format a value for printing — cli_format","title":"Format a value for printing — cli_format","text":"function can used directly, via {.val ...} inline style. {.val {expr}} calls cli_format() automatically value expr, styling collapsing .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format a value for printing — cli_format","text":"","code":"cli_format(x, style = NULL, ...) # Default S3 method cli_format(x, style = NULL, ...) # S3 method for class 'character' cli_format(x, style = NULL, ...) # S3 method for class 'numeric' cli_format(x, style = NULL, ...)"},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format a value for printing — cli_format","text":"x object format. style List formatting options, see individual methods style options support. ... Additional arguments methods.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"default-style","dir":"Reference","previous_headings":"","what":"Default style","title":"Format a value for printing — cli_format","text":"","code":"months <- month.name[1:3] cli_text(\"{.val {months}}\") #> \"January\", \"February\", and \"March\" nums <- 1:5 / 7 cli_text(\"{.val {nums}}\") #> 0.142857142857143, 0.285714285714286, 0.428571428571429, #> 0.571428571428571, and 0.714285714285714"},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"styling-with-themes","dir":"Reference","previous_headings":"","what":"Styling with themes","title":"Format a value for printing — cli_format","text":"possible define new S3 methods cli_format used automatically {.val ...} expressions.","code":"nums <- 1:5 / 7 divid <- cli_div(theme = list(.val = list(digits = 3))) cli_text(\"{.val {nums}}\") cli_end(divid) #> 0.143, 0.286, 0.429, 0.571, and 0.714 cli_format.month <- function(x, style = NULL, ...) { x <- encodeString(substr(x, 1, 3), quote = \"\\\"\") NextMethod(\"cli_format\") } registerS3method(\"cli_format\", \"month\", cli_format.month) months <- structure(month.name[1:3], class = \"month\") cli_text(\"{.val {months}}\") #> \"Jan\", \"Feb\", and \"Mar\""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a format method for an object using cli tools — cli_format_method","title":"Create a format method for an object using cli tools — cli_format_method","text":"method can typically used format() S3 methods. print() method class can easily defined terms format() method. See examples .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a format method for an object using cli tools — cli_format_method","text":"","code":"cli_format_method(expr, theme = getOption(\"cli.theme\"))"},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a format method for an object using cli tools — cli_format_method","text":"expr Expression calls cli_* methods, base::cat() base::print() format object's printout. theme Theme use formatting.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a format method for an object using cli tools — cli_format_method","text":"Character vector, one element line printout.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a format method for an object using cli tools — cli_format_method","text":"","code":"# Let's create format and print methods for a new S3 class that # represents the an installed R package: `r_package` # An `r_package` will contain the DESCRIPTION metadata of the package # and also its installation path. new_r_package <- function(pkg) { tryCatch( desc <- packageDescription(pkg), warning = function(e) stop(\"Cannot find R package `\", pkg, \"`\") ) file <- dirname(attr(desc, \"file\")) if (basename(file) != pkg) file <- dirname(file) structure( list(desc = unclass(desc), lib = dirname(file)), class = \"r_package\" ) } format.r_package <- function(x, ...) { cli_format_method({ cli_h1(\"{.pkg {x$desc$Package}} {cli::symbol$line} {x$desc$Title}\") cli_text(\"{x$desc$Description}\") cli_ul(c( \"Version: {x$desc$Version}\", if (!is.null(x$desc$Maintainer)) \"Maintainer: {x$desc$Maintainer}\", \"License: {x$desc$License}\" )) if (!is.na(x$desc$URL)) cli_text(\"See more at {.url {x$desc$URL}}\") }) } # Now the print method is easy: print.r_package <- function(x, ...) { cat(format(x, ...), sep = \"\\n\") } # Try it out new_r_package(\"cli\") #> $desc #> $desc$Package #> [1] \"cli\" #> #> $desc$Title #> [1] \"Helpers for Developing Command Line Interfaces\" #> #> $desc$Version #> [1] \"3.6.3.9000\" #> #> $desc$`Authors@R` #> [1] \"c(\\n person(\\\"Gábor\\\", \\\"Csárdi\\\", , \\\"csardi.gabor@gmail.com\\\", role = c(\\\"aut\\\", \\\"cre\\\")),\\n person(\\\"Hadley\\\", \\\"Wickham\\\", role = \\\"ctb\\\"),\\n person(\\\"Kirill\\\", \\\"Müller\\\", role = \\\"ctb\\\"),\\n person(\\\"Salim\\\", \\\"Brüggemann\\\", , \\\"salim-b@pm.me\\\", role = \\\"ctb\\\",\\n comment = c(ORCID = \\\"0000-0002-5329-5987\\\")),\\n person(\\\"Posit Software, PBC\\\", role = c(\\\"cph\\\", \\\"fnd\\\"))\\n )\" #> #> $desc$Description #> [1] \"A suite of tools to build attractive command line interfaces\\n ('CLIs'), from semantic elements: headings, lists, alerts, paragraphs,\\n etc. Supports custom themes via a 'CSS'-like language. It also\\n contains a number of lower level 'CLI' elements: rules, boxes, trees,\\n and 'Unicode' symbols with 'ASCII' alternatives. It support ANSI\\n colors and text styles as well.\" #> #> $desc$License #> [1] \"MIT + file LICENSE\" #> #> $desc$URL #> [1] \"https://cli.r-lib.org, https://github.com/r-lib/cli\" #> #> $desc$BugReports #> [1] \"https://github.com/r-lib/cli/issues\" #> #> $desc$Depends #> [1] \"R (>= 3.4)\" #> #> $desc$Imports #> [1] \"utils\" #> #> $desc$Suggests #> [1] \"callr, covr, crayon, digest, glue (>= 1.6.0), grDevices,\\nhtmltools, htmlwidgets, knitr, methods, mockery, processx, ps\\n(>= 1.3.4.9000), rlang (>= 1.0.2.9003), rmarkdown, rprojroot,\\nrstudioapi, testthat, tibble, whoami, withr\" #> #> $desc$`Config/Needs/website` #> [1] \"r-lib/asciicast, bench, brio, cpp11, decor, desc,\\nfansi, prettyunits, sessioninfo, tidyverse/tidytemplate,\\nusethis, vctrs\" #> #> $desc$`Config/testthat/edition` #> [1] \"3\" #> #> $desc$Encoding #> [1] \"UTF-8\" #> #> $desc$RoxygenNote #> [1] \"7.3.2\" #> #> $desc$RemotePkgRef #> [1] \"local::.\" #> #> $desc$RemoteType #> [1] \"local\" #> #> $desc$NeedsCompilation #> [1] \"yes\" #> #> $desc$Packaged #> [1] \"2024-09-19 16:57:44 UTC; runner\" #> #> $desc$Author #> [1] \"Gábor Csárdi [aut, cre],\\n Hadley Wickham [ctb],\\n Kirill Müller [ctb],\\n Salim Brüggemann [ctb] (),\\n Posit Software, PBC [cph, fnd]\" #> #> $desc$Maintainer #> [1] \"Gábor Csárdi \" #> #> $desc$Built #> [1] \"R 4.4.1; x86_64-pc-linux-gnu; 2024-09-19 16:57:45 UTC; unix\" #> #> attr(,\"file\") #> [1] \"/home/runner/work/_temp/Library/cli/Meta/package.rds\" #> #> $lib #> [1] \"/home/runner/work/_temp/Library\" #> #> attr(,\"class\") #> [1] \"r_package\" # The formatting of the output depends on the current theme: opt <- options(cli.theme = simple_theme()) print(new_r_package(\"cli\")) #> #> ── cli ─ Helpers for Developing Command Line Interfaces ────────────────── #> A suite of tools to build attractive command line interfaces ('CLIs'), #> from semantic elements: headings, lists, alerts, paragraphs, etc. #> Supports custom themes via a 'CSS'-like language. It also contains a #> number of lower level 'CLI' elements: rules, boxes, trees, and 'Unicode' #> symbols with 'ASCII' alternatives. It support ANSI colors and text styles #> as well. #> • Version: 3.6.3.9000 #> • Maintainer: Gábor Csárdi #> • License: MIT + file LICENSE #> See more at options(opt) # <- restore theme"},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI headings — cli_h1","title":"CLI headings — cli_h1","text":"cli three levels headings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI headings — cli_h1","text":"","code":"cli_h1(text, id = NULL, class = NULL, .envir = parent.frame()) cli_h2(text, id = NULL, class = NULL, .envir = parent.frame()) cli_h3(text, id = NULL, class = NULL, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI headings — cli_h1","text":"text Text heading. can contain inline markup. id Id heading element, string. can used themes. class Class heading element, string. can used themes. .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CLI headings — cli_h1","text":"headings look default builtin theme.","code":"cli_h1(\"Header {.emph 1}\") cli_h2(\"Header {.emph 2}\") cli_h3(\"Header {.emph 3}\") #> #> ── Header 1 ────────────────────────────────────────────────────────── #> #> ── Header 2 ── #> #> ── Header 3"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI list item(s) — cli_li","title":"CLI list item(s) — cli_li","text":"list item container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI list item(s) — cli_li","text":"","code":"cli_li( items = NULL, labels = names(items), id = NULL, class = NULL, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI list item(s) — cli_li","text":"items Character vector items, NULL. labels definition lists item labels. id Id new container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class item container. Can used themes. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CLI list item(s) — cli_li","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"nested-lists","dir":"Reference","previous_headings":"","what":"Nested lists","title":"CLI list item(s) — cli_li","text":"","code":"fun <- function() { ul <- cli_ul() cli_li(\"one:\") cli_ol(letters[1:3]) cli_li(\"two:\") cli_li(\"three\") cli_end(ul) } fun() #> • one: #> 1. a #> 2. b #> 3. c #> • two: #> • three"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_list_themes.html","id":null,"dir":"Reference","previous_headings":"","what":"List the currently active themes — cli_list_themes","title":"List the currently active themes — cli_list_themes","text":"active app, calls start_app().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_list_themes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List the currently active themes — cli_list_themes","text":"","code":"cli_list_themes()"},{"path":"https://cli.r-lib.org/dev/reference/cli_list_themes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List the currently active themes — cli_list_themes","text":"list data frames active themes. data frame row style applies selected CLI tree nodes. data frame columns: selector: original CSS-like selector string. See themes. parsed: parsed selector, used cli matching nodes. style: original style. cnt: id container style currently applied , NA style used.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":null,"dir":"Reference","previous_headings":"","what":"Ordered CLI list — cli_ol","title":"Ordered CLI list — cli_ol","text":"ordered list container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ordered CLI list — cli_ol","text":"","code":"cli_ol( items = NULL, id = NULL, class = NULL, .close = TRUE, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ordered CLI list — cli_ol","text":"items NULL, character vector. element vector one list item, list container closed default (see .close argument). id Id list container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class list container. Can used themes. .close Whether close list container items specified. FALSE new items can added list. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ordered CLI list — cli_ol","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"adding-all-items-at-once","dir":"Reference","previous_headings":"","what":"Adding all items at once","title":"Ordered CLI list — cli_ol","text":"","code":"fun <- function() { cli_ol(c(\"one\", \"two\", \"three\")) } fun() #> 1. one #> 2. two #> 3. three"},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"adding-items-one-by-one","dir":"Reference","previous_headings":"","what":"Adding items one by one","title":"Ordered CLI list — cli_ol","text":"","code":"## Adding items one by one fun <- function() { cli_ol() cli_li(\"{.emph one}\") cli_li(\"{.emph two}\") cli_li(\"{.emph three}\") cli_end() } fun() #> 1. one #> 2. two #> 3. three"},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"nested-lists","dir":"Reference","previous_headings":"","what":"Nested lists","title":"Ordered CLI list — cli_ol","text":"","code":"fun <- function() { cli_div(theme = list(ol = list(\"margin-left\" = 2))) cli_ul() cli_li(\"one\") cli_ol(c(\"foo\", \"bar\", \"foobar\")) cli_li(\"two\") cli_end() cli_end() } fun() #> • one #> 1. foo #> 2. bar #> 3. foobar #> • two"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":null,"dir":"Reference","previous_headings":"","what":"The connection option that cli would use — cli_output_connection","title":"The connection option that cli would use — cli_output_connection","text":"Note refers current R process. output produced another process, relevant.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The connection option that cli would use — cli_output_connection","text":"","code":"cli_output_connection()"},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The connection option that cli would use — cli_output_connection","text":"Connection object.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The connection option that cli would use — cli_output_connection","text":"interactive sessions standard output chosen, otherwise standard error used. avoid painting output messages red R GUIs.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI paragraph — cli_par","title":"CLI paragraph — cli_par","text":"builtin theme leaves empty line paragraphs. See also containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI paragraph — cli_par","text":"","code":"cli_par(id = NULL, class = NULL, .auto_close = TRUE, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI paragraph — cli_par","text":"id Element id, string. NULL, new id generated returned. class Class name, sting. Can used themes. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CLI paragraph — cli_par","text":"id new container element, invisibly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CLI paragraph — cli_par","text":"","code":"clifun <- function() { cli_par() cli_text(cli:::lorem_ipsum()) } clifun() clifun() #> Sunt anim ullamco Lorem qui mollit anim est in deserunt adipisicing. #> Enim deserunt laborum ad qui qui. Anim esse non anim magna Lorem #> consequat dolore labore cupidatat magna et. Esse nulla eiusmod Lorem #> exercitation cupidatat velit enim exercitation excepteur non officia #> incididunt. Id laborum dolore commodo Lorem esse ea sint proident. #> #> Fugiat mollit in Lorem velit qui exercitation ipsum consectetur ad #> nisi ut eu do ullamco. Mollit officia reprehenderit culpa Lorem est #> reprehenderit excepteur enim magna incididunt ea. Irure nisi ad #> exercitation deserunt enim anim excepteur quis minim laboris veniam #> nulla pariatur. Enim irure aute nulla irure qui non. Minim velit #> proident sunt sint. Proident sit occaecat ex aute. #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":null,"dir":"Reference","previous_headings":"","what":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"cli_process_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. Typically call cli_process_start() start process, cli_process_done() done. error happens cli_process_done() called, cli automatically shows message unsuccessful termination.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"","code":"cli_process_start( msg, msg_done = paste(msg, \"... done\"), msg_failed = paste(msg, \"... failed\"), on_exit = c(\"auto\", \"failed\", \"done\"), msg_class = \"alert-info\", done_class = \"alert-success\", failed_class = \"alert-danger\", .auto_close = TRUE, .envir = parent.frame() ) cli_process_done( id = NULL, msg_done = NULL, .envir = parent.frame(), done_class = \"alert-success\" ) cli_process_failed( id = NULL, msg = NULL, msg_failed = NULL, .envir = parent.frame(), failed_class = \"alert-danger\" )"},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"msg message show indicate start process computation. collapsed single string, first line kept cut console_width(). msg_done message use successful termination. msg_failed message use unsuccessful termination. on_exit Whether process fail terminate successfully calling function (environment .envir) exits. msg_class style class add message. Use empty string suppress styling. done_class style class add successful termination message. Use empty string suppress styling.failed_class style class add unsuccessful termination message. Use empty string suppress styling..auto_close Whether clear status bar calling function finishes (.envir removed stack, specified). .envir Environment evaluate glue expressions . also used auto-clear status bar .auto_close TRUE. id Id status bar container clear. id id current status bar (overwritten another status bar container), status bar cleared. NULL (default) status bar always cleared.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"Id status bar container.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"handle errors process computation, can opposite: call cli_process_start() on_exit = \"done\", error handler call cli_process_failed(). cli automatically call cli_process_done() successful termination, calling function finishes. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"","code":"## Failure by default fun <- function() { cli_process_start(\"Calculating\") if (interactive()) Sys.sleep(1) if (runif(1) < 0.5) stop(\"Failed\") cli_process_done() } tryCatch(fun(), error = function(err) err) #> ℹ Calculating #> ✖ Calculating ... failed #> #> ## Success by default fun2 <- function() { cli_process_start(\"Calculating\", on_exit = \"done\") tryCatch({ if (interactive()) Sys.sleep(1) if (runif(1) < 0.5) stop(\"Failed\") }, error = function(err) cli_process_failed()) } fun2() #> ℹ Calculating #> ✔ Calculating ... done #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a progress bar to a mapping function or for loop — cli_progress_along","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"Note function currently experimental! Use cli_progress_along() mapping function loop, add progress bar. uses cli_progress_bar() internally.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"","code":"cli_progress_along( x, name = NULL, total = length(x), ..., .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"x Sequence add progress bar . name Name progress bar, label, passed cli_progress_bar(). total Passed cli_progress_bar(). ... Passed cli_progress_bar(). .envir Passed cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"index vector 1 length(x) triggers progress updates iterate .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"for-loop","dir":"Reference","previous_headings":"","what":"for loop","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"loop cli_progress_along() looks like : complete example:","code":"for (i in cli_progress_along(seq)) { ... } clifun <- function() { for (i in cli_progress_along(1:100, \"Downloading\")) { Sys.sleep(4/100) } } clifun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"lapply-and-other-mapping-functions","dir":"Reference","previous_headings":"","what":"lapply() and other mapping functions","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"look like : complete example:","code":"lapply(cli_progress_along(X), function(i) ...) res <- lapply(cli_progress_along(1:100, \"Downloading\"), function(i) { Sys.sleep(4/100) })"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"custom-format-string","dir":"Reference","previous_headings":"","what":"Custom format string","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"","code":"clifun <- function() { for (i in cli_progress_along(1:100, format = \"Downloading data file {cli::pb_current}\")) { Sys.sleep(4/100) } } clifun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"breaking-out-of-loops","dir":"Reference","previous_headings":"","what":"Breaking out of loops","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"Note use break loop, probably want terminate progress bar explicitly breaking loop, right loop:","code":"for (i in cli_progress_along(seq)) { ... if (cond) cli_progress_done() && break ... }"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":null,"dir":"Reference","previous_headings":"","what":"cli progress bars — cli_progress_bar","title":"cli progress bars — cli_progress_bar","text":"reference manual three functions create, update terminate progress bars. tutorial see cli progress bars. cli_progress_bar() creates new progress bar. cli_progress_update() updates state progress bar, potentially display well. cli_progress_done() terminates progress bar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli progress bars — cli_progress_bar","text":"","code":"cli_progress_bar( name = NULL, status = NULL, type = c(\"iterator\", \"tasks\", \"download\", \"custom\"), total = NA, format = NULL, format_done = NULL, format_failed = NULL, clear = getOption(\"cli.progress_clear\", TRUE), current = TRUE, auto_terminate = type != \"download\", extra = NULL, .auto_close = TRUE, .envir = parent.frame() ) cli_progress_update( inc = NULL, set = NULL, total = NULL, status = NULL, extra = NULL, id = NULL, force = FALSE, .envir = parent.frame() ) cli_progress_done(id = NULL, .envir = parent.frame(), result = \"done\")"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"cli progress bars — cli_progress_bar","text":"name typically used label, short, 20 characters. status New status string progress bar, NULL. type Type progress bar. used select default display format specified. Currently supported types: iterator: e.g. loop mapping function, tasks: (typically small) number tasks, download: download one file, custom: custom type, format must NULL type. total Total number progress units, NA unknown. cli_progress_update() can update total number units. handy know size download beginning, also cases. format set NULL, format (plus format_done format_failed) updated change total NA number. .e. default format strings updated, custom ones . format Format string. specified custom progress bars, otherwise optional, default display selected based progress bat type whether number total units known. Format strings may contain glue substitution, support pluralization cli styling. See progress-variables special variables can use custom format. format_done Format string successful termination. default format. format_failed Format string unsuccessful termination. default format. clear Whether remove progress bar screen terminated. Defaults cli.progress_clear option, TRUE unset. current Whether use progress bar current progress bar calling function. See 'current progress bar' . auto_terminate Whether terminate progress bar number current units reaches number total units. extra Extra data add progress bar. can used custom format strings example. named list. cli_progress_update() can update extra data. Often can get away referring local variables format string, need use argument. Explicitly including constants variables extra can result cleaner code. rare cases need refer progress bar multiple functions, can extra. .auto_close Whether terminate progress bar calling function (one execution environment .envir exits. (Auto termination work progress bars created global environment, e.g. script.) .envir environment use auto-termination glue substitution. also used find set current progress bar. inc Increment progress units. ignored set NULL. set Set current number progress units value. Ignored NULL. id Progress bar update terminate. NULL, current progress bar calling function (.envir specified) updated terminated. force Whether force display update, even update due. result String select successful unsuccessful termination. used progress bar cleared screen. can one \"done\", \"failed\", \"clear\", \"auto\".","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli progress bars — cli_progress_bar","text":"cli_progress_bar() returns id new progress bar. id string constant. cli_progress_update() returns id progress bar, invisibly. cli_progress_done() returns TRUE, invisibly, always.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"basic-usage","dir":"Reference","previous_headings":"","what":"Basic usage","title":"cli progress bars — cli_progress_bar","text":"cli_progress_bar() creates progress bar, cli_progress_update() updates existing progress bar, cli_progress_done() terminates . good practice always set name argument, make progress bar informative.","code":"clean <- function() { cli_progress_bar(\"Cleaning data\", total = 100) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } cli_progress_done() } clean()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"progress-bar-types","dir":"Reference","previous_headings":"","what":"Progress bar types","title":"cli progress bars — cli_progress_bar","text":"three builtin types progress bars, custom type.","code":"tasks <- function() { cli_progress_bar(\"Tasks\", total = 3, type = \"tasks\") for (i in 1:3) { Sys.sleep(1) cli_progress_update() } cli_progress_done() } tasks()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"unknown-total","dir":"Reference","previous_headings":"","what":"Unknown total","title":"cli progress bars — cli_progress_bar","text":"total known, cli shows different progress bar. Note can also set total cli_progress_update(), known progress bar created, learn later.","code":"nototal <- function() { cli_progress_bar(\"Parameter tuning\") for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } cli_progress_done() } nototal()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"clearing-the-progress-bar","dir":"Reference","previous_headings":"","what":"Clearing the progress bar","title":"cli progress bars — cli_progress_bar","text":"default cli removes terminated progress bars screen, terminal supports . want change , use clear argument cli_progress_bar(), cli.progress_clear global option (see cli-config) change . (cli documentation usually set cli.progress_clear FALSE, users can see finished progress bars look.) example first progress bar cleared, second .","code":"fun <- function() { cli_progress_bar(\"Data cleaning\", total = 100, clear = TRUE) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } cli_progress_bar(\"Parameter tuning\", total = 100, clear = FALSE) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } } fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"initial-delay","dir":"Reference","previous_headings":"","what":"Initial delay","title":"cli progress bars — cli_progress_bar","text":"Updating progress bar screen costly, cli tries avoid quick loops. default progress bar shown two seconds, half less 50% iterations complete. can change two second default cli.progress_show_after global option (see cli-config). (cli documentation usually set cli.progress_show_after 0 (zero seconds), progress bars shown immediately.) example show progress bar one second, 50% iterations remain one second.","code":"fun <- function() { cli_alert(\"Starting now, at {Sys.time()}\") cli_progress_bar( total = 100, format = \"{cli::pb_bar} {pb_percent} @ {Sys.time()}\" ) for (i in 1:100) { Sys.sleep(4/100) cli_progress_update() } } options(cli.progress_show_after = 2) fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"the-current-progress-bar","dir":"Reference","previous_headings":"","what":"The current progress bar","title":"cli progress bars — cli_progress_bar","text":"default cli sets new progress bar current progress bar calling function. current progress bar default one cli progress bar operations. E.g. progress bar id supplied cli_progress_update(), current progress bar updated. Every function can single current progress bar, new one created, previous one () automatically terminated. current progress bar also terminated function created exits. Thanks rules, often need explicitly deal progress bar ids, need explicitly call cli_progress_done():","code":"fun <- function() { cli_progress_bar(\"First step \", total = 100) for (i in 1:100) { Sys.sleep(2/100) cli_progress_update() } cli_progress_bar(\"Second step\", total = 100) for (i in 1:100) { Sys.sleep(2/100) cli_progress_update() } } fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"cli-output-while-the-progress-bar-is-active","dir":"Reference","previous_headings":"","what":"cli output while the progress bar is active","title":"cli progress bars — cli_progress_bar","text":"cli allows emitting regular cli output (alerts, headers, lists, etc.) progress bar active. terminals support , cli remove progress bar temporarily, emit output, restores progress bar. See also cli_progress_output(), sends text current progress handler. E.g. Shiny app send output Shiny progress bar, opposed cli_alert() etc. cli functions print text console.","code":"fun <- function() { cli_alert_info(\"Before the progress bar\") cli_progress_bar(\"Calculating\", total = 100) for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_alert_info(\"Already half way!\") for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_alert_info(\"All done\") } fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"custom-formats","dir":"Reference","previous_headings":"","what":"Custom formats","title":"cli progress bars — cli_progress_bar","text":"addition builtin types, can also specify custom format string. case progress variables probably useful avoid calculating progress bar quantities like elapsed time, ETA manually. can also use variables calling function:","code":"fun <- function(urls) { cli_progress_bar( format = paste0( \"{pb_spin} Downloading {.path {basename(url)}} \", \"[{pb_current}/{pb_total}] ETA:{pb_eta}\" ), format_done = paste0( \"{col_green(symbol$tick)} Downloaded {pb_total} files \", \"in {pb_elapsed}.\" ),, total = length(urls) ) for (url in urls) { cli_progress_update() Sys.sleep(5/10) } } fun(paste0(\"https://acme.com/data-\", 1:10, \".zip\"))"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":null,"dir":"Reference","previous_headings":"","what":"cli progress handlers — cli_progress_builtin_handlers","title":"cli progress handlers — cli_progress_builtin_handlers","text":"progress handler(s) use can selected global options.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli progress handlers — cli_progress_builtin_handlers","text":"","code":"cli_progress_builtin_handlers()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli progress handlers — cli_progress_builtin_handlers","text":"cli_progress_builtin_handlers() returns names currently supported progress handlers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"cli progress handlers — cli_progress_builtin_handlers","text":"three options specify handlers selected, time need use one . can set options character vector, names built-cli handlers want use: cli.progress_handlers_only set, handlers used, without considering others without checking able handle progress bar. option mainly intended testing purposes. handlers named cli.progress_handlers checked able handle progress bar, ones , first one selected. usually option end use want set. handlers named cli.progress_handlers_force always appended ones selected via cli.progress_handlers. option useful add additional handler, e.g. logger writes file.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"cli","dir":"Reference","previous_headings":"","what":"cli","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use cli's internal status bar, last line screen, show progress bar. handler always able handle progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"logger","dir":"Reference","previous_headings":"","what":"logger","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Log progress updates screen, one line update time stamps. handler always able handle progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"progressr","dir":"Reference","previous_headings":"","what":"progressr","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use progressr package create progress bars. handler always able handle progress bars. (progressr package needs installed.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"rstudio","dir":"Reference","previous_headings":"","what":"rstudio","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use RStudio's job panel show progress bars. handler available RStudio console, recent versions RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"say","dir":"Reference","previous_headings":"","what":"say","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use macOS say command announce progress events speech (type man say terminal info). Set cli.progress_say_frequency option set minimum delay say invocations, default three seconds. handler available macOS, say command path. external command arguments can configured options: cli_progress_say_args: command line arguments, e.g. can use select voice macOS, cli_progress_say_command: external command run, cli_progress_say_frequency: wait least many seconds calling external command.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"shiny","dir":"Reference","previous_headings":"","what":"shiny","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use shiny's progress bars. handler available shiny app running.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":null,"dir":"Reference","previous_headings":"","what":"cli progress bar demo — cli_progress_demo","title":"cli progress bar demo — cli_progress_demo","text":"Useful experimenting format strings documentation. creates progress bar, iterates terminates saves progress updates.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli progress bar demo — cli_progress_demo","text":"","code":"cli_progress_demo( name = NULL, status = NULL, type = c(\"iterator\", \"tasks\", \"download\", \"custom\"), total = NA, .envir = parent.frame(), ..., at = if (is_interactive()) NULL else 50, show_after = 0, live = NULL, delay = 0, start = as.difftime(5, units = \"secs\") )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"cli progress bar demo — cli_progress_demo","text":"name Passed cli_progress_bar(). status Passed cli_progress_bar(). type Passed cli_progress_bar(). total Passed cli_progress_bar(). .envir Passed cli_progress_bar(). ... Passed cli_progress_bar(). number progress units show capture progress bar . NULL, sequence states generated show progress beginning end. show_after Delay show progress bar. Overrides cli.progress_show_after option. live Whether show progress bat screen, just return recorded updates. Defaults value cli.progress_demo_live options. unset, TRUE interactive sessions. delay Delay progress bar updates. start Time subtract start time, simulate progress bar takes longer run.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli progress bar demo — cli_progress_demo","text":"List class cli_progress_demo, print format method pretty printing. lines entry contains output lines, corresponding one update.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":null,"dir":"Reference","previous_headings":"","what":"Simplified cli progress messages — cli_progress_message","title":"Simplified cli progress messages — cli_progress_message","text":"simplified progress bar, single (dynamic) message, without progress units.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simplified cli progress messages — cli_progress_message","text":"","code":"cli_progress_message( msg, current = TRUE, .auto_close = TRUE, .envir = parent.frame(), ... )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simplified cli progress messages — cli_progress_message","text":"msg Message show. may contain glue substitution cli styling. can updated via cli_progress_update(), usual. current Passed cli_progress_bar(). .auto_close Passed cli_progress_bar(). .envir Passed cli_progress_bar(). ... Passed cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simplified cli progress messages — cli_progress_message","text":"id new progress bar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simplified cli progress messages — cli_progress_message","text":"cli_progress_message() always shows message, even update due. progress message terminated, removed screen default. Note message can dynamic: update cli_progress_update(), cli uses current values string substitutions.","code":"fun <- function() { cli_progress_message(\"Task one is running...\") Sys.sleep(2) cli_progress_message(\"Task two is running...\") Sys.sleep(2) step <- 1L cli_progress_message(\"Task three is underway: step {step}\") for (step in 1:5) { Sys.sleep(0.5) cli_progress_update() } } fun()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Add text output to a progress bar — cli_progress_output","title":"Add text output to a progress bar — cli_progress_output","text":"text calculated via cli_text(), cli features can used , including progress variables.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add text output to a progress bar — cli_progress_output","text":"","code":"cli_progress_output(text, id = NULL, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add text output to a progress bar — cli_progress_output","text":"text Text output. formatted via cli_text(). id Progress bar id. default current progress bar. .envir Environment use glue interpolation text.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add text output to a progress bar — cli_progress_output","text":"TRUE, always.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add text output to a progress bar — cli_progress_output","text":"text passed progress handler(s), may may able print .","code":"fun <- function() { cli_alert_info(\"Before the progress bar\") cli_progress_bar(\"Calculating\", total = 100) for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_progress_output(\"Already half way!\") for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_alert_info(\"All done\") } fun()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":null,"dir":"Reference","previous_headings":"","what":"Simplified cli progress messages, with styling — cli_progress_step","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"simplified progress bar, single (dynamic) message, without progress units.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"","code":"cli_progress_step( msg, msg_done = msg, msg_failed = msg, spinner = FALSE, class = if (!spinner) \".alert-info\", current = TRUE, .auto_close = TRUE, .envir = parent.frame(), ... )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"msg Message show. may contain glue substitution cli styling. can updated via cli_progress_update(), usual. style cli info alert (see cli_alert_info()). msg_done Message show successful termination. default msg styled cli success alert (see cli_alert_success()). msg_failed Message show unsuccessful termination. default msg styled cli danger alert (see cli_alert_danger()). spinner Whether show spinner beginning line. make spinner spin, need call cli_progress_update() regularly. class cli class add message. default class steps spinner. current Passed cli_progress_bar(). .auto_close Passed cli_progress_bar(). .envir Passed cli_progress_bar(). ... Passed cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"cli_progress_step() always shows progress message, even update due.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"basic-use","dir":"Reference","previous_headings":"","what":"Basic use","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"","code":"f <- function() { cli_progress_step(\"Downloading data\") Sys.sleep(2) cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\") Sys.sleep(3) } f()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"spinner","dir":"Reference","previous_headings":"","what":"Spinner","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"can add spinner steps spinner = TRUE, note work call cli_progress_update() regularly.","code":"f <- function() { cli_progress_step(\"Downloading data\", spinner = TRUE) for (i in 1:100) { Sys.sleep(2/100); cli_progress_update() } cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\", spinner = TRUE) for (i in 1:100) { Sys.sleep(3/100); cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"dynamic-messages","dir":"Reference","previous_headings":"","what":"Dynamic messages","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"can make step messages dynamic, using glue templates. Since cli_progress_step() show message immediately, need initialize msg first.","code":"f <- function() { msg <- \"\" cli_progress_step(\"Downloading data{msg}\", spinner = TRUE) for (i in 1:100) { Sys.sleep(2/100) msg <- glue::glue(\", got file {i}/100\") cli_progress_update() } cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\", spinner = TRUE) for (i in 1:100) { Sys.sleep(3/100); cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"termination-messages","dir":"Reference","previous_headings":"","what":"Termination messages","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"can specify different message successful /unsuccessful termination:","code":"f <- function() { size <- 0L cli_progress_step( \"Downloading data.\", msg_done = \"Downloaded {prettyunits::pretty_bytes(size)}.\", spinner = TRUE ) for (i in 1:100) { Sys.sleep(3/100) size <- size + 8192 cli_progress_update() } } f()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":null,"dir":"Reference","previous_headings":"","what":"List of built-in cli progress styles — cli_progress_styles","title":"List of built-in cli progress styles — cli_progress_styles","text":"following options used select style: cli_progress_bar_style cli_progress_bar_style_ascii cli_progress_bar_style_unicode","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List of built-in cli progress styles — cli_progress_styles","text":"","code":"cli_progress_styles()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List of built-in cli progress styles — cli_progress_styles","text":"named list sublists containing elements complete, incomplete potentially current.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"List of built-in cli progress styles — cli_progress_styles","text":"Unicode terminals (is_utf8_output() TRUE), cli_progress_bar_style_unicode cli_progress_bar_style options used. ASCII terminals (is_utf8_output() FALSE), cli_pgoress_bar_style_ascii cli_progress_bar_style options used.","code":"for (style in names(cli_progress_styles())) { options(cli.progress_bar_style = style) label <- ansi_align(paste0(\"Style '\", style, \"'\"), 20) print(cli_progress_demo(label, live = FALSE, at = 66, total = 100)) } options(cli.progress_var_style = NULL) #> Style 'classic' ##################### 66% | ETA: 3s #> Style 'squares' ■■■■■■■■■■■■■■■■■■■■■ 66% | ETA: 3s #> Style 'dot' ────────────────────●────────── 66% | ETA: 3s #> Style 'fillsquares' ■■■■■■■■■■■■■■■■■■■■■□□□□□□□□□□ 66% | ETA: 3s #> Style 'bar' ███████████████████████████████ 66% | ETA: 3s"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI horizontal rule — cli_rule","title":"CLI horizontal rule — cli_rule","text":"can used separate parts output.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI horizontal rule — cli_rule","text":"","code":"cli_rule( left = \"\", center = \"\", right = \"\", id = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI horizontal rule — cli_rule","text":"left Label show left. interferes center label, one can present. center Label show center. interferes left right labels. right Label show right. interferes center label, one can present. id Element id, string. NULL, new id generated returned. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"inline-styling-and-interpolation","dir":"Reference","previous_headings":"","what":"Inline styling and interpolation","title":"CLI horizontal rule — cli_rule","text":"","code":"pkg <- \"mypackage\" cli_rule(left = \"{.pkg {pkg}} results\") #> ── mypackage results ─────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"theming","dir":"Reference","previous_headings":"","what":"Theming","title":"CLI horizontal rule — cli_rule","text":"line style rule can changed via line-type property. Possible values : \"single\": (1), single line, \"double\": (2), double line, \"bar1\", \"bar2\", \"bar3\", etc., \"bar8\" uses varying height bars. Colors background colors can similarly changed via theme.","code":"d <- cli_div(theme = list(rule = list( color = \"cyan\", \"line-type\" = \"double\"))) cli_rule(\"Summary\", right = \"{.pkg mypackage}\") cli_end(d) #> ══ Summary ══════════════════════════════════════════════ mypackage ══"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":null,"dir":"Reference","previous_headings":"","what":"cli situation report — cli_sitrep","title":"cli situation report — cli_sitrep","text":"Contains currently: cli_unicode_option: whether cli.unicode option set value. See is_utf8_output(). symbol_charset: selected character set symbol, UTF-8, Windows, ASCII. console_utf8: whether console supports UTF-8. See base::l10n_info(). latex_active: whether inside knitr, creating LaTeX document. num_colors: number ANSI colors. See num_ansi_colors(). console_with: detected console width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli situation report — cli_sitrep","text":"","code":"cli_sitrep()"},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli situation report — cli_sitrep","text":"Named list entries listed . cli_sitrep class, print() format() method.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"cli situation report — cli_sitrep","text":"","code":"cli_sitrep() #> - cli_unicode_option : NULL #> - symbol_charset : UTF-8 #> - console_utf8 : TRUE #> - latex_active : FALSE #> - num_colors : 256 #> - console_width : 74"},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":null,"dir":"Reference","previous_headings":"","what":"Update the status bar (superseded) — cli_status","title":"Update the status bar (superseded) — cli_status","text":"cli_status_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. status bar last line terminal. cli apps can use show status information, progress bars, etc. status bar kept intact semantic cli output.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update the status bar (superseded) — cli_status","text":"","code":"cli_status( msg, msg_done = paste(msg, \"... done\"), msg_failed = paste(msg, \"... failed\"), .keep = FALSE, .auto_close = TRUE, .envir = parent.frame(), .auto_result = c(\"clear\", \"done\", \"failed\", \"auto\") )"},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update the status bar (superseded) — cli_status","text":"msg text show, character vector. collapsed single string, first line kept cut console_width(). message often associated start calculation. msg_done message use message cleared, calculation finishes successfully. .auto_close TRUE .auto_result \"done\", printed automatically calling function (.envir) finishes. msg_failed message use message cleared, calculation finishes unsuccessfully. .auto_close TRUE .auto_result \"failed\", printed automatically calling function (.envir) finishes. .keep status bar cleared. TRUE content status bar kept, regular cli output (screen scrolled needed). FALSE, status bar deleted. .auto_close Whether clear status bar calling function finishes (.envir removed stack, specified). .envir Environment evaluate glue expressions . also used auto-clear status bar .auto_close TRUE. .auto_result auto-closing status bar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update the status bar (superseded) — cli_status","text":"id new status bar container element, invisibly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update the status bar (superseded) — cli_status","text":"Use cli_status_clear() clear status bar. Often status messages associated processes. E.g. app starts downloading large file, sets status bar accordingly. download done (failed), app typically updates status bar . cli automates much , via msg_done, msg_failed, .auto_result arguments. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_status_clear.html","id":null,"dir":"Reference","previous_headings":"","what":"Clear the status bar (superseded) — cli_status_clear","title":"Clear the status bar (superseded) — cli_status_clear","text":"cli_status_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. Clear status bar","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status_clear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clear the status bar (superseded) — cli_status_clear","text":"","code":"cli_status_clear( id = NULL, result = c(\"clear\", \"done\", \"failed\"), msg_done = NULL, msg_failed = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_status_clear.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clear the status bar (superseded) — cli_status_clear","text":"id Id status bar container clear. id id current status bar (overwritten another status bar container), status bar cleared. NULL (default) status bar always cleared. result Whether show message success failure just clear status bar. msg_done NULL, message use successful process termination. overrides message given status bar created. msg_failed NULL, message use failed process termination. overrides message give status bar created. .envir Environment evaluate glue expressions . also used auto-clear status bar .auto_close TRUE.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update the status bar (superseded) — cli_status_update","title":"Update the status bar (superseded) — cli_status_update","text":"cli_status_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. Update status bar","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update the status bar (superseded) — cli_status_update","text":"","code":"cli_status_update( id = NULL, msg = NULL, msg_done = NULL, msg_failed = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update the status bar (superseded) — cli_status_update","text":"id Id status bar update. Defaults current status bar container. msg Text update status bar . NULL want change . msg_done Updated \"done\" message. NULL want change . msg_failed Updated \"failed\" message. NULL want change . .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update the status bar (superseded) — cli_status_update","text":"Id status bar container.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI text — cli_text","title":"CLI text — cli_text","text":"Write text screen. function appropriate longer paragraphs. See cli_alert() shorter status messages.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI text — cli_text","text":"","code":"cli_text(..., .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI text — cli_text","text":"... text show, character vectors. concatenated single string. Newlines preserved. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"text-wrapping","dir":"Reference","previous_headings":"","what":"Text wrapping","title":"CLI text — cli_text","text":"Text wrapped console width, see console_width().","code":"cli_text(cli:::lorem_ipsum()) #> Lorem ad ipsum veniam esse nisi deserunt duis. Qui incididunt elit #> elit mollit sint nulla consectetur aute commodo do elit laboris minim #> et. Laboris ipsum mollit voluptate et non do incididunt eiusmod. Anim #> consectetur mollit laborum occaecat eiusmod excepteur. Ullamco non #> tempor esse anim tempor magna non."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"new-lines","dir":"Reference","previous_headings":"","what":"New lines","title":"CLI text — cli_text","text":"cli_text() call always appends newline character end.","code":"cli_text(\"First line.\") cli_text(\"Second line.\") #> First line. #> Second line."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"styling","dir":"Reference","previous_headings":"","what":"Styling","title":"CLI text — cli_text","text":"can use inline markup, usual.","code":"cli_text(\"The {.fn cli_text} function in the {.pkg cli} package.\") #> The `cli_text()` function in the cli package."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"interpolation","dir":"Reference","previous_headings":"","what":"Interpolation","title":"CLI text — cli_text","text":"String interpolation via glue works usual. Interpolated vectors collapsed.","code":"pos <- c(5, 14, 25, 26) cli_text(\"We have {length(pos)} missing measurements: {pos}.\") #> We have 4 missing measurements: 5, 14, 25, and 26."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"styling-and-interpolation","dir":"Reference","previous_headings":"","what":"Styling and interpolation","title":"CLI text — cli_text","text":"Use double braces combine styling string interpolation.","code":"fun <- \"cli-text\" pkg <- \"cli\" cli_text(\"The {.fn {fun}} function in the {.pkg {pkg}} package.\") #> The `cli-text()` function in the cli package."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"multiple-arguments","dir":"Reference","previous_headings":"","what":"Multiple arguments","title":"CLI text — cli_text","text":"Arguments concatenated.","code":"cli_text(c(\"This \", \"will \", \"all \"), \"be \", \"one \", \"sentence.\") #> This will all be one sentence."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"containers","dir":"Reference","previous_headings":"","what":"Containers","title":"CLI text — cli_text","text":"can use cli_text() within cli containers.","code":"ul <- cli_ul() cli_li(\"First item.\") cli_text(\"Still the {.emph first} item\") cli_li(\"Second item.\") cli_text(\"Still the {.emph second} item\") cli_end(ul) #> • First item. #> Still the first item #> • Second item. #> Still the second item"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":null,"dir":"Reference","previous_headings":"","what":"Unordered CLI list — cli_ul","title":"Unordered CLI list — cli_ul","text":"unordered list container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unordered CLI list — cli_ul","text":"","code":"cli_ul( items = NULL, id = NULL, class = NULL, .close = TRUE, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unordered CLI list — cli_ul","text":"items NULL, character vector. element vector one list item, list container closed default (see .close argument). id Id list container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class list container. Can used themes. .close Whether close list container items specified. FALSE new items can added list. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unordered CLI list — cli_ul","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"adding-all-items-at-once","dir":"Reference","previous_headings":"","what":"Adding all items at once","title":"Unordered CLI list — cli_ul","text":"","code":"fun <- function() { cli_ul(c(\"one\", \"two\", \"three\")) } fun() #> • one #> • two #> • three"},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"adding-items-one-by-one","dir":"Reference","previous_headings":"","what":"Adding items one by one","title":"Unordered CLI list — cli_ul","text":"","code":"fun <- function() { cli_ul() cli_li(\"{.emph one}\") cli_li(\"{.emph two}\") cli_li(\"{.emph three}\") cli_end() } fun() #> • one #> • two #> • three"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Add custom cli style to a vector — cli_vec","title":"Add custom cli style to a vector — cli_vec","text":"Add custom cli style vector","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add custom cli style to a vector — cli_vec","text":"","code":"cli_vec(x, style = list())"},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add custom cli style to a vector — cli_vec","text":"x Vector collapsed cli. style Style apply vector. used theme span element created vector. can set vec-sep vec-last modify separator last separator.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add custom cli style to a vector — cli_vec","text":"can use function change default parameters collapsing vector string, see example . style added attribute, operations remove attributes remove style well.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"custom-collapsing-separator","dir":"Reference","previous_headings":"","what":"Custom collapsing separator","title":"Add custom cli style to a vector — cli_vec","text":"","code":"v <- cli_vec( c(\"foo\", \"bar\", \"foobar\"), style = list(\"vec-sep\" = \" & \", \"vec-last\" = \" & \") ) cli_text(\"My list: {v}.\") #> My list: foo & bar & foobar."},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"custom-truncation","dir":"Reference","previous_headings":"","what":"Custom truncation","title":"Add custom cli style to a vector — cli_vec","text":"","code":"x <- cli_vec(names(mtcars), list(\"vec-trunc\" = 3)) cli_text(\"Column names: {x}.\") #> Column names: mpg, cyl, disp, …, gear, and carb."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI verbatim text — cli_verbatim","title":"CLI verbatim text — cli_verbatim","text":"wrapped, printed . Long lines overflow. glue substitution performed verbatim text.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI verbatim text — cli_verbatim","text":"","code":"cli_verbatim(..., .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI verbatim text — cli_verbatim","text":"... text show, character vectors. element printed new line. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"line-breaks","dir":"Reference","previous_headings":"","what":"Line breaks","title":"CLI verbatim text — cli_verbatim","text":"","code":"cli_verbatim(\"This has\\nthree\\nlines,\") #> This has #> three #> lines,"},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"special-characters","dir":"Reference","previous_headings":"","what":"Special characters","title":"CLI verbatim text — cli_verbatim","text":"glue substitution happens .","code":"cli_verbatim(\"No string {interpolation} or {.emph styling} here\") #> No string {interpolation} or {.emph styling} here"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":null,"dir":"Reference","previous_headings":"","what":"Syntax highlight R code — code_highlight","title":"Syntax highlight R code — code_highlight","text":"Syntax highlight R code","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Syntax highlight R code — code_highlight","text":"","code":"code_highlight(code, code_theme = NULL, envir = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Syntax highlight R code — code_highlight","text":"code Character vector, element one line code. code_theme Theme see code_theme_list(). envir Environment look function calls hyperlinks. NULL, global search path used.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Syntax highlight R code — code_highlight","text":"Character vector, highlighted code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Syntax highlight R code — code_highlight","text":"See code_theme_list() default syntax highlighting theme change . code parse, returned unchanged cli_parse_failure condition thrown. Note error, condition ignored, unless explicitly caught.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Syntax highlight R code — code_highlight","text":"","code":"code_highlight(deparse(ls)) #> [1] \"\\033[38;5;142mfunction\\033[39m \\033[38;5;178m(\\033[39mname, pos = \\033[38;5;178m-\\033[39m\\033[38;5;169m1L\\033[39m, envir = \\033[1mas.environment\\033[22m\\033[33m(\\033[39mpos\\033[33m)\\033[39m, all.names = \\033[38;5;169mFALSE\\033[39m, \" #> [2] \" pattern, sorted = \\033[38;5;169mTRUE\\033[39m\\033[38;5;178m)\\033[39m \" #> [3] \"\\033[38;5;178m{\\033[39m\" #> [4] \" \\033[38;5;142mif\\033[39m \\033[33m(\\033[39m\\033[38;5;178m!\\033[39m\\033[1mmissing\\033[22m\\033[34m(\\033[39mname\\033[34m)\\033[39m\\033[33m)\\033[39m \\033[33m{\\033[39m\" #> [5] \" pos \\033[38;5;178m<-\\033[39m \\033[1mtryCatch\\033[22m\\033[34m(\\033[39mname, error = \\033[38;5;142mfunction\\033[39m\\033[36m(\\033[39me\\033[36m)\\033[39m e\\033[34m)\\033[39m\" #> [6] \" \\033[38;5;142mif\\033[39m \\033[34m(\\033[39m\\033[1minherits\\033[22m\\033[36m(\\033[39mpos, \\033[38;5;37m\\\"error\\\"\\033[39m\\033[36m)\\033[39m\\033[34m)\\033[39m \\033[34m{\\033[39m\" #> [7] \" name \\033[38;5;178m<-\\033[39m \\033[1msubstitute\\033[22m\\033[36m(\\033[39mname\\033[36m)\\033[39m\" #> [8] \" \\033[38;5;142mif\\033[39m \\033[36m(\\033[39m\\033[38;5;178m!\\033[39m\\033[1mis.character\\033[22m\\033[38;5;178m(\\033[39mname\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m \" #> [9] \" name \\033[38;5;178m<-\\033[39m \\033[1mdeparse\\033[22m\\033[36m(\\033[39mname\\033[36m)\\033[39m\" #> [10] \" \\033[1mwarning\\033[22m\\033[36m(\\033[39m\\033[1mgettextf\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"%s converted to character string\\\"\\033[39m, \" #> [11] \" \\033[1msQuote\\033[22m\\033[33m(\\033[39mname\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m, domain = \\033[38;5;169mNA\\033[39m\\033[36m)\\033[39m\" #> [12] \" pos \\033[38;5;178m<-\\033[39m name\" #> [13] \" \\033[34m}\\033[39m\" #> [14] \" \\033[33m}\\033[39m\" #> [15] \" all.names \\033[38;5;178m<-\\033[39m \\033[1m.Internal\\033[22m\\033[33m(\\033[39m\\033[1mls\\033[22m\\033[34m(\\033[39menvir, all.names, sorted\\033[34m)\\033[39m\\033[33m)\\033[39m\" #> [16] \" \\033[38;5;142mif\\033[39m \\033[33m(\\033[39m\\033[38;5;178m!\\033[39m\\033[1mmissing\\033[22m\\033[34m(\\033[39mpattern\\033[34m)\\033[39m\\033[33m)\\033[39m \\033[33m{\\033[39m\" #> [17] \" \\033[38;5;142mif\\033[39m \\033[34m(\\033[39m\\033[36m(\\033[39mll \\033[38;5;178m<-\\033[39m \\033[1mlength\\033[22m\\033[38;5;178m(\\033[39m\\033[1mgrep\\033[22m\\033[33m(\\033[39m\\033[38;5;37m\\\"[\\\"\\033[39m, pattern, fixed = \\033[38;5;169mTRUE\\033[39m\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m \\033[38;5;178m&&\\033[39m \" #> [18] \" ll != \\033[1mlength\\033[22m\\033[36m(\\033[39m\\033[1mgrep\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"]\\\"\\033[39m, pattern, fixed = \\033[38;5;169mTRUE\\033[39m\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m\\033[34m)\\033[39m \\033[34m{\\033[39m\" #> [19] \" \\033[38;5;142mif\\033[39m \\033[36m(\\033[39mpattern \\033[38;5;178m==\\033[39m \\033[38;5;37m\\\"[\\\"\\033[39m\\033[36m)\\033[39m \\033[36m{\\033[39m\" #> [20] \" pattern \\033[38;5;178m<-\\033[39m \\033[38;5;37m\\\"\\\\\\\\[\\\"\\033[39m\" #> [21] \" \\033[1mwarning\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"replaced regular expression pattern '[' by '\\\\\\\\\\\\\\\\['\\\"\\033[39m\\033[38;5;178m)\\033[39m\" #> [22] \" \\033[36m}\\033[39m\" #> [23] \" \\033[38;5;142melse\\033[39m \\033[38;5;142mif\\033[39m \\033[36m(\\033[39m\\033[1mlength\\033[22m\\033[38;5;178m(\\033[39m\\033[1mgrep\\033[22m\\033[33m(\\033[39m\\033[38;5;37m\\\"[^\\\\\\\\\\\\\\\\]\\\\\\\\[<-\\\"\\033[39m, pattern\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m \\033[36m{\\033[39m\" #> [24] \" pattern \\033[38;5;178m<-\\033[39m \\033[1msub\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"\\\\\\\\[<-\\\"\\033[39m, \\033[38;5;37m\\\"\\\\\\\\\\\\\\\\\\\\\\\\[<-\\\"\\033[39m, pattern\\033[38;5;178m)\\033[39m\" #> [25] \" \\033[1mwarning\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"replaced '[<-' by '\\\\\\\\\\\\\\\\[<-' in regular expression pattern\\\"\\033[39m\\033[38;5;178m)\\033[39m\" #> [26] \" \\033[36m}\\033[39m\" #> [27] \" \\033[34m}\\033[39m\" #> [28] \" \\033[1mgrep\\033[22m\\033[34m(\\033[39mpattern, all.names, value = \\033[38;5;169mTRUE\\033[39m\\033[34m)\\033[39m\" #> [29] \" \\033[33m}\\033[39m\" #> [30] \" \\033[38;5;142melse\\033[39m all.names\" #> [31] \"\\033[38;5;178m}\\033[39m\" cat(code_highlight(deparse(ls)), sep = \"\\n\") #> function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE, #> pattern, sorted = TRUE) #> { #> if (!missing(name)) { #> pos <- tryCatch(name, error = function(e) e) #> if (inherits(pos, \"error\")) { #> name <- substitute(name) #> if (!is.character(name)) #> name <- deparse(name) #> warning(gettextf(\"%s converted to character string\", #> sQuote(name)), domain = NA) #> pos <- name #> } #> } #> all.names <- .Internal(ls(envir, all.names, sorted)) #> if (!missing(pattern)) { #> if ((ll <- length(grep(\"[\", pattern, fixed = TRUE))) && #> ll != length(grep(\"]\", pattern, fixed = TRUE))) { #> if (pattern == \"[\") { #> pattern <- \"\\\\[\" #> warning(\"replaced regular expression pattern '[' by '\\\\\\\\['\") #> } #> else if (length(grep(\"[^\\\\\\\\]\\\\[<-\", pattern))) { #> pattern <- sub(\"\\\\[<-\", \"\\\\\\\\\\\\[<-\", pattern) #> warning(\"replaced '[<-' by '\\\\\\\\[<-' in regular expression pattern\") #> } #> } #> grep(pattern, all.names, value = TRUE) #> } #> else all.names #> }"},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Syntax highlighting themes — code_theme_list","title":"Syntax highlighting themes — code_theme_list","text":"code_theme_list() lists built-code themes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Syntax highlighting themes — code_theme_list","text":"","code":"code_theme_list()"},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Syntax highlighting themes — code_theme_list","text":"Character vector built-code theme names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"code-themes","dir":"Reference","previous_headings":"","what":"Code themes","title":"Syntax highlighting themes — code_theme_list","text":"theme list character vectors, except bracket, see . character vector must contain RGB colors (e.g. \"#a9a9a9\"), cli styles, e.g. \"bold\". Entries list: reserved: reserved words number: numeric literals null: NULL constant operator: operators, including assignment call: function calls string: character literals comment: comments bracket: brackets: (){}[] list character vectors, create \"rainbow\" brackets. recycled deeply nested lists.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"the-default-code-theme","dir":"Reference","previous_headings":"","what":"The default code theme","title":"Syntax highlighting themes — code_theme_list","text":"RStudio, matches current theme IDE. can use three options customize code theme: cli.code_theme set, used. Otherwise R running RStudio cli.code_theme_rstudio set, used. Otherwise T running RStudio cli.code_theme_terminal set, used. can set options name built-theme, list specifies custom theme. See code_theme_list() list built-themes.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Syntax highlighting themes — code_theme_list","text":"","code":"code_theme_list() #> [1] \"Ambiance\" \"Chaos\" #> [3] \"Chrome\" \"Clouds\" #> [5] \"Clouds Midnight\" \"Cobalt\" #> [7] \"Crimson Editor\" \"Dawn\" #> [9] \"Dracula\" \"Dreamweaver\" #> [11] \"Eclipse\" \"Idle Fingers\" #> [13] \"Katzenmilch\" \"Kr Theme\" #> [15] \"Material\" \"Merbivore\" #> [17] \"Merbivore Soft\" \"Mono Industrial\" #> [19] \"Monokai\" \"Pastel On Dark\" #> [21] \"Solarized Dark\" \"Solarized Light\" #> [23] \"Textmate (default)\" \"Tomorrow\" #> [25] \"Tomorrow Night\" \"Tomorrow Night Blue\" #> [27] \"Tomorrow Night Bright\" \"Tomorrow Night 80s\" #> [29] \"Twilight\" \"Vibrant Ink\" #> [31] \"Xcode\" code_highlight(deparse(get), code_theme = \"Solarized Dark\") #> [1] \"\\033[38;5;142mfunction\\033[39m \\033[38;5;178m(\\033[39mx, pos = \\033[38;5;178m-\\033[39m\\033[38;5;169m1L\\033[39m, envir = \\033[1mas.environment\\033[22m\\033[33m(\\033[39mpos\\033[33m)\\033[39m, mode = \\033[38;5;37m\\\"any\\\"\\033[39m, \" #> [2] \" inherits = \\033[38;5;169mTRUE\\033[39m\\033[38;5;178m)\\033[39m \" #> [3] \"\\033[1m.Internal\\033[22m\\033[38;5;178m(\\033[39m\\033[1mget\\033[22m\\033[33m(\\033[39mx, envir, mode, inherits\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m\""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine two or more ANSI styles — combine_ansi_styles","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"Combine two styles style functions new style function can called strings style .","code":""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"","code":"combine_ansi_styles(...)"},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"... styles combine. character strings, make_ansi_style() function used create style first. applied right left.","code":""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"combined style function.","code":""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"usually make sense combine two foreground colors (two background colors), first one applied used. make sense combine different kind styles, e.g. background color, foreground color, bold font.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"","code":"## Use style names alert <- combine_ansi_styles(\"bold\", \"red4\") cat(alert(\"Warning!\"), \"\\n\") #> Warning! ## Or style functions alert <- combine_ansi_styles(style_bold, col_red, bg_cyan) cat(alert(\"Warning!\"), \"\\n\") #> Warning! ## Combine a composite style alert <- combine_ansi_styles( \"bold\", combine_ansi_styles(\"red\", bg_cyan)) cat(alert(\"Warning!\"), \"\\n\") #> Warning!"},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine the width of the console — console_width","title":"Determine the width of the console — console_width","text":"uses cli.width option, set. Otherwise tries determine size terminal console window.","code":""},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine the width of the console — console_width","text":"","code":"console_width()"},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine the width of the console — console_width","text":"Integer scalar, console , number characters.","code":""},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine the width of the console — console_width","text":"exact rules: cli.width option set positive integer, used. cli.width option set, positive integer, error thrown. try determine size terminal console window: RStudio, RStudio terminal, try use tty_size() function query terminal size. might fail R running terminal, failures ignored. RStudio build pane, RSTUDIO_CONSOLE_WIDTH environment variable used. build pane resized, environment variable accurate , output might get garbled. using RSTUDIO_CONSOLE_WIDTH environment variable RStudio console. determine size terminal console window, use width option. width option set, return 80L.","code":""},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine the width of the console — console_width","text":"","code":"console_width() #> [1] 74"},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":null,"dir":"Reference","previous_headings":"","what":"About cli containers — containers","title":"About cli containers — containers","text":"Container elements may contain elements. Currently following commands create container elements: cli_div(), cli_par(), list elements: cli_ul(), cli_ol(), cli_dl(), list items containers well: cli_li().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":"themes","dir":"Reference","previous_headings":"","what":"Themes","title":"About cli containers — containers","text":"container can add new theme, removed container exits.","code":"d <- cli_div(theme = list(h1 = list(color = \"blue\", \"font-weight\" = \"bold\"))) cli_h1(\"Custom title\") cli_end(d) #> #> Custom title"},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":"auto-closing","dir":"Reference","previous_headings":"","what":"Auto-closing","title":"About cli containers — containers","text":"Container elements closed cli_end(). convenience, default closed automatically function created terminated (either regularly error). default behavior can changed .auto_close argument.","code":"div <- function() { cli_div(class = \"tmp\", theme = list(.tmp = list(color = \"yellow\"))) cli_text(\"This is yellow\") } div() cli_text(\"This is not yellow any more\") #> This is yellow #> This is not yellow any more"},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":"debugging","dir":"Reference","previous_headings":"","what":"Debugging","title":"About cli containers — containers","text":"can use internal cli:::cli_debug_doc() function see currently open containers.","code":"fun <- function() { cli_div(id = \"mydiv\") cli_par(class = \"myclass\") cli:::cli_debug_doc() } fun() #> #> #> #>
      +theme #> "},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":null,"dir":"Reference","previous_headings":"","what":"Show a demo of some (by default all) spinners — demo_spinners","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"spinner shown 2-3 seconds.","code":""},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"","code":"demo_spinners(which = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"Character vector, spinners demo.","code":""},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"","code":"demo_spinners(\"clock\")"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare two character vectors elementwise — diff_chr","title":"Compare two character vectors elementwise — diff_chr","text":"printed output similar calling diff -u command line.","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare two character vectors elementwise — diff_chr","text":"","code":"diff_chr(old, new, max_dist = Inf)"},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare two character vectors elementwise — diff_chr","text":"old First character vector. new Second character vector. max_dist Maximum distance consider, Inf limit. LCS edit distance larger , function throws error class \"cli_diff_max_dist\". (specify Inf real limit .Machine$integer.max reach function run long time.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare two character vectors elementwise — diff_chr","text":"list cli_diff_chr object, format() print() method. can also access members: old new original inputs, lcs data frame LCS edit transform old new. lcs data frame following columns: operation: one \"match\", \"delete\" \"insert\". offset: offset old matches deletions, offset new insertions. length: length operation, .e. number matching, deleted inserted elements. old_offset: offset old operation. new_offset: offset new operation.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare two character vectors elementwise — diff_chr","text":"","code":"letters2 <- c(\"P\", \"R\", \"E\", letters, \"P\", \"O\", \"S\", \"T\") letters2[11:16] <- c(\"M\", \"I\", \"D\", \"D\", \"L\", \"E\") diff_chr(letters, letters2) #> @@ -1,3 +1,6 @@ #> +P #> +R #> +E #> a #> b #> c #> @@ -5,12 +8,12 @@ #> e #> f #> g #> -h #> -i #> -j #> -k #> -l #> -m #> +M #> +I #> +D #> +D #> +L #> +E #> n #> o #> p #> @@ -24,3 +27,7 @@ #> x #> y #> z #> +P #> +O #> +S #> +T"},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare two character strings, character by character — diff_str","title":"Compare two character strings, character by character — diff_str","text":"Characters defined UTF-8 graphemes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare two character strings, character by character — diff_str","text":"","code":"diff_str(old, new, max_dist = Inf)"},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare two character strings, character by character — diff_str","text":"old First string, must NA. new Second string, must NA. max_dist Maximum distance consider, Inf limit. LCS edit distance larger , function throws error class \"cli_diff_max_dist\". (specify Inf real limit .Machine$integer.max reach function run long time.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare two character strings, character by character — diff_str","text":"list cli_diff_str object also cli_diff_chr object, see diff_str details structure.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare two character strings, character by character — diff_str","text":"","code":"str1 <- \"abcdefghijklmnopqrstuvwxyz\" str2 <- \"PREabcdefgMIDDLEnopqrstuvwxyzPOST\" diff_str(str1, str2) #> PREabcdefghijklmMIDDLEnopqrstuvwxyzPOST"},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":null,"dir":"Reference","previous_headings":"","what":"Frequently Asked Questions — faq","title":"Frequently Asked Questions — faq","text":"Frequently Asked Questions","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"my-platform-supports-ansi-colors-why-does-cli-not-use-them-","dir":"Reference","previous_headings":"","what":"My platform supports ANSI colors, why does cli not use them?","title":"Frequently Asked Questions — faq","text":"probably mistake ANSI support detection algorithm. Please open issue https://github.com/r-lib/cli/issues forget tell us details platform terminal GUI.","code":""},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"how-do-i-turn-off-ansi-colors-and-styles-","dir":"Reference","previous_headings":"","what":"How do I turn off ANSI colors and styles?","title":"Frequently Asked Questions — faq","text":"Set NO_COLOR environment variable non-empty value. can .Renviron file (use usethis::edit_r_environ()). want testthat tests, consider using 3rd edition testthat, turn ANSI styling automatically inside test_that().","code":""},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"cli-does-not-show-the-output-before-file-choose-","dir":"Reference","previous_headings":"","what":"cli does not show the output before file.choose()","title":"Frequently Asked Questions — faq","text":"Try calling flush.console() flush console, file.choose(). flushing work RStudio, probably RStudio bug: https://github.com/rstudio/rstudio/issues/8040 See details https://github.com/r-lib/cli/issues/151","code":""},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"why-are-heading-separators-wider-than-my-screen-in-rstudio-","dir":"Reference","previous_headings":"","what":"Why are heading separators wider than my screen in RStudio?","title":"Frequently Asked Questions — faq","text":"display width Unicode characters ambiguous Unicode standard. software treats narrow (one column screen), wide (two columns). terminal emulators (example iTerm2), can configure preferred behavior. Unfortunately box drawing characters cli uses also ambiguous width. RStudio behavior depends font. particular, Consolas, Courier Inconsolata treats wide characters, cli output look great . good, modern fonts look good include Menlo, Fira Code Source Code Pro. want change font, can also turn Unicode output, setting cli.unicode option: related issue: https://github.com/r-lib/cli/issues/320","code":"options(cli.unicode = FALSE)"},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"is-there-a-suggested-font-to-use-with-cli-","dir":"Reference","previous_headings":"","what":"Is there a suggested font to use with cli?","title":"Frequently Asked Questions — faq","text":"modern terminals, cli output usually looks good. see wide heading separators RStudio, see previous question: heading separators wider screen RStudio?. output garbled, cli probably misdetected Unicode support terminal font. can try choosing different font. experience output looks good Menlo, Fira Code Source Code Pro. Alternatively can turn Unicode output: think fault, please also file issue https://github.com/r-lib/cli/issues","code":"options(cli.unicode = FALSE)"},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":null,"dir":"Reference","previous_headings":"","what":"Format an error, warning or diagnostic message — format_error","title":"Format an error, warning or diagnostic message — format_error","text":"can throw message stop() rlang::abort().","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format an error, warning or diagnostic message — format_error","text":"","code":"format_error(message, .envir = parent.frame()) format_warning(message, .envir = parent.frame()) format_message(message, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format an error, warning or diagnostic message — format_error","text":"message formatted via call cli_bullets(). .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format an error, warning or diagnostic message — format_error","text":"messages can use inline styling, pluralization glue substitutions.","code":"n <- \"boo\" stop(format_error(c( \"{.var n} must be a numeric vector\", \"x\" = \"You've supplied a {.cls {class(n)}} vector.\" ))) #> Error: `n` must be a numeric vector #> ✖ You've supplied a vector. len <- 26 idx <- 100 stop(format_error(c( \"Must index an existing element:\", \"i\" = \"There {?is/are} {len} element{?s}.\", \"x\" = \"You've tried to subset element {idx}.\" ))) #> Error: Must index an existing element: #> ℹ There are 26 elements. #> ✖ You've tried to subset element 100."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":null,"dir":"Reference","previous_headings":"","what":"Format and returns a line of text — format_inline","title":"Format and returns a line of text — format_inline","text":"can use function format line cli text, without emitting screen. uses cli_text() internally.","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format and returns a line of text — format_inline","text":"","code":"format_inline( ..., .envir = parent.frame(), collapse = TRUE, keep_whitespace = TRUE )"},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format and returns a line of text — format_inline","text":"... Passed cli_text(). .envir Environment evaluate expressions . collapse Whether collapse result multiple lines, e.g. \\f characters. keep_whitespace Whether keep whitepace (spaces, newlines form feeds) input.","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format and returns a line of text — format_inline","text":"Character scalar, formatted string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format and returns a line of text — format_inline","text":"format_inline() performs width-wrapping.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format and returns a line of text — format_inline","text":"","code":"format_inline(\"A message for {.emph later}, thanks {.fn format_inline}.\") #> [1] \"A message for \\033[3mlater\\033[23m, thanks `format_inline()`.\""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":null,"dir":"Reference","previous_headings":"","what":"Character vector to put a spinner on the screen — get_spinner","title":"Character vector to put a spinner on the screen — get_spinner","text":"cli contains many different spinners, choose one according taste.","code":""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Character vector to put a spinner on the screen — get_spinner","text":"","code":"get_spinner(which = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Character vector to put a spinner on the screen — get_spinner","text":"name chosen spinner. NULL, default used, can customized via cli.spinner_unicode, cli.spinner_ascii cli.spinner options. (latter applies Unicode ASCII displays. options can set name built-spinner, list entry called frames, character vector frames.","code":""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Character vector to put a spinner on the screen — get_spinner","text":"list entries: name, interval: suggested update interval milliseconds frames: character vector spinner's frames.","code":""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Character vector to put a spinner on the screen — get_spinner","text":"","code":"options(cli.spinner = \"hearts\") fun <- function() { cli_progress_bar(\"Spinning\") for (i in 1:100) { Sys.sleep(4/100) cli_progress_update() } } fun() options(cli.spinner = NULL)"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"Check current platform/terminal supports reading single keys.","code":""},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"","code":"has_keypress_support()"},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"Whether support waiting individual keypressses.","code":""},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"Supported platforms: Terminals Windows Unix. RStudio terminal. supported: RStudio (RStudio terminal). R.app macOS. Rgui Windows. Emacs ESS. Others.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"","code":"has_keypress_support() #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":null,"dir":"Reference","previous_headings":"","what":"Adjective-animal hash — hash_animal","title":"Adjective-animal hash — hash_animal","text":"Adjective-animal hash","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adjective-animal hash — hash_animal","text":"","code":"hash_animal(x, n_adj = 2) hash_raw_animal(x, n_adj = 2) hash_obj_animal(x, n_adj = 2, serialize_version = 2)"},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adjective-animal hash — hash_animal","text":"x Character vector. NA entries NA hash. n_adj Number adjectives use. must 0 3. serialize_version Workspace format version use, see base::serialize().","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adjective-animal hash — hash_animal","text":"data frame columns hash: hash value, string. words: list column adjectives animal name character vector. hash_raw_animal() hash_obj_animal() return list entries: hash: hash value, string, `words: adjectives animal name character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Adjective-animal hash — hash_animal","text":"uses first 13 hexadecimal characters (32) MD5 hash input, converts adjective-animal form create human readable hash. hash_raw_animal() calculates adjective-animal hash bytes raw vector. hash_obj_animal() calculates adjective-animal hash R object. object serialized binary vector first.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"number-of-possible-hash-values","dir":"Reference","previous_headings":"","what":"Number of possible hash values","title":"Adjective-animal hash — hash_animal","text":"hash_animal() uses 1748 animal names 8946 different adjectives. number different hashes can get different values n_adj:","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Adjective-animal hash — hash_animal","text":"list adjectives animals comes ids package, turn https://github.com/-type/adjective-adjective-animal, https://gfycat.com (now gone).","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Adjective-animal hash — hash_animal","text":"","code":"hash_animal(c(\"foo\", \"bar\")) #> hash words #> 1 sacrilegious diet lion sacrileg.... #> 2 uncitizenly agricultural amethystgemclam uncitize.... # if you increase `n_adj`, the shorter hash is a suffix of the longer: hash_animal(\"cli package\", 0)$hash #> [1] \"pullet\" hash_animal(\"cli package\", 1)$hash #> [1] \"pastyfaced pullet\" hash_animal(\"cli package\", 2)$hash #> [1] \"pregnant pastyfaced pullet\" hash_animal(\"cli package\", 3)$hash #> [1] \"unwelcome pregnant pastyfaced pullet\""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":null,"dir":"Reference","previous_headings":"","what":"Emoji hash — hash_emoji","title":"Emoji hash — hash_emoji","text":"Emoji hash","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Emoji hash — hash_emoji","text":"","code":"hash_emoji(x, size = 3) hash_raw_emoji(x, size = 3) hash_obj_emoji(x, size = 3, serialize_version = 2)"},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Emoji hash — hash_emoji","text":"x Character vector. NA entries NA hash. size Number emojis use hash. Currently 1 4. serialize_version Workspace format version use, see base::serialize().","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Emoji hash — hash_emoji","text":"hash_emoji() returns data frame columns hash: emoji hash, string requested size. emojis: list column emoji characters character vectors. Note emoji might multiple code points. text: text representation hash, comma separated. names: list column text representations emojis, character vectors. hash_raw_emoji() hash_obj_emoji() return list entries: hash: emoji hash, string requested size, emojis: individual emoji characters character vector, text: text representation hash, comma separated, names: names emojis, character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Emoji hash — hash_emoji","text":"uses first 13 hexadecimal characters (32) MD5 hash input, converts emoji representation. uses manually selected subset emojis, tend displayed correctly. hash_raw_emoji() calculates emoji hash bytes raw vector. hash_obj_emoji() calculates emoji hash R object. object serialized binary vector first.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"number-of-possible-hash-values","dir":"Reference","previous_headings":"","what":"Number of possible hash values","title":"Emoji hash — hash_emoji","text":"cli uses 2280 possible emojis. number different hashes can get different values size:","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Emoji hash — hash_emoji","text":"","code":"hash_emoji(c(\"foo\", NA, \"bar\", \"\"))$text #> [1] \"sun behind cloud, raised back of hand: dark skin tone, children crossing\" #> [2] NA #> [3] \"man pilot: medium-light skin tone, flag: Afghanistan, keycap: *\" #> [4] \"teacup without handle, rhinoceros, flushed face\" # if you increase `size`, the shorter hash is a prefix of the longer: hash_emoji(\"foobar\", 1)$text #> [1] \"fishing pole\" hash_emoji(\"foobar\", 2)$text #> [1] \"fishing pole, money with wings\" hash_emoji(\"foobar\", 3)$text #> [1] \"fishing pole, money with wings, eagle\" hash_emoji(\"foobar\", 4)$text #> [1] \"fishing pole, money with wings, eagle, dog face\""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":null,"dir":"Reference","previous_headings":"","what":"MD5 hash — hash_md5","title":"MD5 hash — hash_md5","text":"Calculate MD5 hash element character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MD5 hash — hash_md5","text":"","code":"hash_md5(x) hash_raw_md5(x) hash_obj_md5(x, serialize_version = 2) hash_file_md5(paths)"},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MD5 hash — hash_md5","text":"x Character vector. character vector, .character() used try coerce one. NA entries NA hash. serialize_version Workspace format version use, see base::serialize(). paths Character vector file names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MD5 hash — hash_md5","text":"hash_md5() returns character vector hexadecimal MD5 hashes. hash_raw_md5() returns character scalar. hash_obj_md5() returns character scalar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"MD5 hash — hash_md5","text":"hash_raw_md5() calculates MD5 hash bytes raw vector. hash_obj_md5() calculates MD5 hash R object. object serialized binary vector first. hash_file_md5() calculates MD5 hash one files.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MD5 hash — hash_md5","text":"","code":"hash_md5(c(\"foo\", NA, \"bar\", \"\")) #> [1] \"acbd18db4cc2f85cedef654fccc4a4d8\" NA #> [3] \"37b51d194a7513e45b56f6524f2d51f2\" \"d41d8cd98f00b204e9800998ecf8427e\""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":null,"dir":"Reference","previous_headings":"","what":"SHA-1 hash — hash_sha1","title":"SHA-1 hash — hash_sha1","text":"Calculate SHA-1 hash element character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"SHA-1 hash — hash_sha1","text":"","code":"hash_sha1(x) hash_raw_sha1(x) hash_obj_sha1(x, serialize_version = 2) hash_file_sha1(paths)"},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"SHA-1 hash — hash_sha1","text":"x Character vector. character vector, .character() used try coerce one. NA entries NA hash. serialize_version Workspace format version use, see base::serialize(). paths Character vector file names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"SHA-1 hash — hash_sha1","text":"hash_sha1() returns character vector hexadecimal SHA-1 hashes. hash_raw_sha1() returns character scalar. hash_obj_sha1() returns character scalar. hash_file_sha1() returns character vector SHA-1 hashes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"SHA-1 hash — hash_sha1","text":"hash_raw_sha1() calculates SHA-1 hash bytes raw vector. hash_obj_sha1() calculates SHA-1 hash R object. object serialized binary vector first. hash_file_sha1() calculates SHA-1 hash one files.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"SHA-1 hash — hash_sha1","text":"","code":"hash_sha1(c(\"foo\", NA, \"bar\", \"\")) #> [1] \"0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33\" #> [2] NA #> [3] \"62cdb7020ff920e5aa642c3d4066950dd1f01f4d\" #> [4] \"da39a3ee5e6b4b0d3255bfef95601890afd80709\""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":null,"dir":"Reference","previous_headings":"","what":"SHA-256 hash — hash_sha256","title":"SHA-256 hash — hash_sha256","text":"Calculate SHA-256 hash element character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"SHA-256 hash — hash_sha256","text":"","code":"hash_sha256(x) hash_raw_sha256(x) hash_obj_sha256(x, serialize_version = 2) hash_file_sha256(paths)"},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"SHA-256 hash — hash_sha256","text":"x Character vector. character vector, .character() used try coerce one. NA entries NA hash. serialize_version Workspace format version use, see base::serialize(). paths Character vector file names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"SHA-256 hash — hash_sha256","text":"hash_sha256() returns character vector hexadecimal SHA-256 hashes. hash_raw_sha256() returns character scalar. hash_obj_sha256() returns character scalar. hash_file_sha256() returns character vector SHA-256 hashes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"SHA-256 hash — hash_sha256","text":"hash_raw_sha256() calculates SHA-256 hash bytes raw vector. hash_obj_sha256() calculates SHA-256 hash R object. object serialized binary vector first. hash_file_sha256() calculates SHA-256 hash one files.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"SHA-256 hash — hash_sha256","text":"","code":"hash_sha256(c(\"foo\", NA, \"bar\", \"\")) #> [1] \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\" #> [2] NA #> [3] \"fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9\" #> [4] \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":null,"dir":"Reference","previous_headings":"","what":"About inline markup in the semantic cli — inline-markup","title":"About inline markup in the semantic cli — inline-markup","text":"learn use cli’s semantic markup, start ‘Building semantic CLI’ article https://cli.r-lib.org.","code":""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"command-substitution","dir":"Reference","previous_headings":"","what":"Command substitution","title":"About inline markup in the semantic cli — inline-markup","text":"text emitted cli supports glue interpolation. Expressions enclosed braces evaluated R code. See glue::glue() details. addition regular glue interpolation, cli can also add classes parts text, classes can used themes. example adds class \"important\" word, class \"emph\". Note case string within braces usually valid R expression. want mix classes interpolation, add another pair braces: inline class always create span element internally. themes, can use span.emph CSS selector change inline text emphasized:","code":"cli_text(\"This is {.emph important}.\") #> This is important. adjective <- \"great\" cli_text(\"This is {.emph {adjective}}.\") #> This is great. cli_div(theme = list(span.emph = list(color = \"red\"))) adjective <- \"nice and red\" cli_text(\"This is {.emph {adjective}}.\") #> This is nice and red."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"classes","dir":"Reference","previous_headings":"","what":"Classes","title":"About inline markup in the semantic cli — inline-markup","text":"default theme defines following inline classes: arg function argument. cls S3, S4, R6 class name. code piece code. dt used terms definition list (cli_dl()). dd used descriptions definition list (cli_dl()). email email address. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. emph emphasized text. envvar name environment variable. field generic field, e.g. named list. file file name. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link opens file RStudio default app file type. See links information cli hyperlinks. fn function name. package::function_name form, terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. fun fn. help help page function. terminal supports ANSI hyperlinks help pages (e.g. RStudio), cli creates clickable link. supports link text. See links information cli hyperlinks. href creates hyperlink, potentially link text. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. kbd keyboard key. key kbd. obj_type_friendly formats type R object readable way, used {}, see example . changes string separates last two elements collapsed vectors (see ) \"\" \"\". path path (file default theme). pkg package name. run R expression, potentially clickable terminal supports ANSI hyperlinks runnable code (e.g. RStudio). supports link text. See links information cli hyperlinks. str double quoted string escaped base::encodeString(). strong strong importance. topic help page topic. terminal supports ANSI hyperlinks help pages (e.g. RStudio), cli creates clickable link. supports link text. See links information cli hyperlinks. type formats type R object readable way, used {}, see example . url URL. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. var variable name. val generic \"value\". vignette vignette. terminal supports ANSI hyperlinks help pages (e.g. RStudio), cli creates clickable link. supports link text. See links information cli hyperlinks. can add new classes defining theme, using .","code":"ul <- cli_ul() cli_li(\"{.emph Emphasized} text.\") cli_li(\"{.strong Strong} importance.\") cli_li(\"A piece of code: {.code sum(a) / length(a)}.\") cli_li(\"A package name: {.pkg cli}.\") cli_li(\"A function name: {.fn cli_text}.\") cli_li(\"A keyboard key: press {.kbd ENTER}.\") cli_li(\"A file name: {.file /usr/bin/env}.\") cli_li(\"An email address: {.email bugs.bunny@acme.com}.\") cli_li(\"A URL: {.url https://example.com}.\") cli_li(\"An environment variable: {.envvar R_LIBS}.\") cli_li(\"`mtcars` is {.obj_type_friendly {mtcars}}\") cli_end(ul) #> • Emphasized text. #> • Strong importance. #> • A piece of code: `sum(a) / length(a)`. #> • A package name: cli. #> • A function name: `cli_text()`. #> • A keyboard key: press [ENTER]. #> • A file name: /usr/bin/env. #> • An email address: bugs.bunny@acme.com. #> • A URL: . #> • An environment variable: `R_LIBS`. #> • `mtcars` is a data frame cli_div(theme = list( span.myclass = list(color = \"lightgrey\"), \"span.myclass\" = list(before = \"<<\"), \"span.myclass\" = list(after = \">>\"))) cli_text(\"This is {.myclass in angle brackets}.\") cli_end() #> This is <>."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"highlighting-weird-looking-values","dir":"Reference","previous_headings":"","what":"Highlighting weird-looking values","title":"About inline markup in the semantic cli — inline-markup","text":"Often useful highlight weird file path name, e.g. one starts ends space characters. built-theme .file, .path .email default. can highlight string inline adding .q class . current highlighting algorithm adds single quotes string start end alphanumeric character, underscore, dot forward slash. Highlights background colors leading trailing spaces terminals support ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"collapsing-inline-vectors","dir":"Reference","previous_headings":"","what":"Collapsing inline vectors","title":"About inline markup in the semantic cli — inline-markup","text":"cli performs inline text formatting, automatically collapses glue substitutions, formatting. handy create lists files, packages, etc. Class names collapsed differently default default cli truncates long vectors. truncation limit default twenty elements, can change vec-trunc style.","code":"pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Packages: {pkgs}.\") cli_text(\"Packages: {.pkg {pkgs}}.\") #> Packages: pkg1, pkg2, and pkg3. #> Packages: pkg1, pkg2, and pkg3. x <- Sys.time() cli_text(\"Hey, {.var x} has class {.cls {class(x)}}.\") #> Hey, `x` has class . nms <- cli_vec(names(mtcars), list(\"vec-trunc\" = 5)) cli_text(\"Column names: {nms}.\") #> Column names: mpg, cyl, disp, …, gear, and carb."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"formatting-values","dir":"Reference","previous_headings":"","what":"Formatting values","title":"About inline markup in the semantic cli — inline-markup","text":"val inline class formats values. default (c.f. built-theme), calls cli_format() generic function, current style argument. See cli_format() examples. str formatting strings, uses base::encodeString() double quotes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"escaping-and-","dir":"Reference","previous_headings":"","what":"Escaping { and }","title":"About inline markup in the semantic cli — inline-markup","text":"might happen want pass string cli_* functions, want command substitution string, might contain { } characters. simplest solution refer string template: want explicitly escape { } characters, just double : See also examples .","code":"msg <- \"Error in if (ncol(dat$y)) {: argument is of length zero\" cli_alert_warning(\"{msg}\") #> ! Error in if (ncol(dat$y)) {: argument is of length zero cli_alert_warning(\"A warning with {{ braces }}.\") #> ! A warning with { braces }."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"pluralization","dir":"Reference","previous_headings":"","what":"Pluralization","title":"About inline markup in the semantic cli — inline-markup","text":"cli commands emit text support pluralization. examples: See pluralization details.","code":"ndirs <- 1 nfiles <- 13 pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_alert_info(\"Found {ndirs} director{?y/ies} and {nfiles} file{?s}.\") cli_text(\"Will install {length(pkgs)} package{?s}: {.pkg {pkgs}}\") #> ℹ Found 1 directory and 13 files. #> Will install 3 packages: pkg1, pkg2, and pkg3"},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"wrapping","dir":"Reference","previous_headings":"","what":"Wrapping","title":"About inline markup in the semantic cli — inline-markup","text":"cli containers wrap text width container's width, observing margins requested theme. avoid line break, can use UTF_8 non-breaking space character: \\u00a0. cli break line . force line break, insert form feed character: \\f \\u000c. cli insert line break .","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect if a stream support ANSI escape characters — is_ansi_tty","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"check following hold: stream terminal. platform Unix. R running inside R.app (macOS GUI). R running inside RStudio. R running inside Emacs. terminal \"dumb\". stream either standard output standard error stream.","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"","code":"is_ansi_tty(stream = \"auto\")"},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"stream stream inspect manipulate, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr().","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"TRUE FALSE.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"","code":"is_ansi_tty() #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"terminal, \\\\r moves cursor first position line. also supported R IDEs. \\\\r typically used achieve dynamic, less cluttered user interface, e.g. create progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"","code":"is_dynamic_tty(stream = \"auto\")"},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"stream stream inspect manipulate, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr().","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"output directed file, \\\\r characters typically unwanted. function detects \\\\r can used given stream . detection mechanism follows: cli.dynamic option set TRUE, TRUE returned. cli.dynamic option set anything else, FALSE returned. R_CLI_DYNAMIC environment variable empty set string \"true\", \"TRUE\" \"True\", TRUE returned. R_CLI_DYNAMIC empty set anything else, FALSE returned. stream terminal, TRUE returned. stream standard output error within RStudio, macOS R app, RKWard IDE, TRUE returned. Otherwise FALSE returned.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"","code":"is_dynamic_tty() #> [1] FALSE is_dynamic_tty(stdout()) #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/is_utf8_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Whether cli is emitting UTF-8 characters — is_utf8_output","title":"Whether cli is emitting UTF-8 characters — is_utf8_output","text":"UTF-8 cli characters can turned setting cli.unicode option TRUE. can turned setting FALSE. option set, base::l10n_info() used detect UTF-8 support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_utf8_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whether cli is emitting UTF-8 characters — is_utf8_output","text":"","code":"is_utf8_output()"},{"path":"https://cli.r-lib.org/dev/reference/is_utf8_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whether cli is emitting UTF-8 characters — is_utf8_output","text":"Flag, whether cli uses UTF-8 characters.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a single keypress at the terminal — keypress","title":"Read a single keypress at the terminal — keypress","text":"currently works Linux/Unix OSX terminals, Windows command line. see has_keypress_support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a single keypress at the terminal — keypress","text":"","code":"keypress(block = TRUE)"},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a single keypress at the terminal — keypress","text":"block Whether wait key press, none available now.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a single keypress at the terminal — keypress","text":"key pressed, character scalar. non-blocking reads NA returned keys available.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read a single keypress at the terminal — keypress","text":"following special keys supported: Arrow keys: '', '', 'right', 'left'. Function keys: 'f1' 'f12'. Others: 'home', 'end', 'insert', 'delete', 'pageup', 'pagedown', 'tab', 'enter', 'backspace' ('delete' OSX keyboards), 'escape'. Control one following keys: '', 'b', 'c', 'd', 'e', 'f', 'h', 'k', 'l', 'n', 'p', 't', 'u', 'w'.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a single keypress at the terminal — keypress","text":"","code":"if (FALSE) { x <- keypress() cat(\"You pressed key\", x, \"\\n\") }"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":null,"dir":"Reference","previous_headings":"","what":"cli hyperlinks — links","title":"cli hyperlinks — links","text":"Certain cli styles create clickable links, IDE terminal supports .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"note-hyperlinks-are-currently-experimental","dir":"Reference","previous_headings":"","what":"Note: hyperlinks are currently experimental","title":"cli hyperlinks — links","text":"details styles create hyperlinks prrobably change near future, based user feedback.","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"about-the-links-in-this-manual-page","dir":"Reference","previous_headings":"","what":"About the links in this manual page","title":"cli hyperlinks — links","text":"hyperlinks included manual demonstrative , except https: links. look like hyperlink, can click , nothing. .e. .run link run linked expression click .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"hyperlink-support","dir":"Reference","previous_headings":"","what":"Hyperlink Support","title":"cli hyperlinks — links","text":"today, latest release RStudio (version v2022.07.0+548) supports hyperlink types discussed . Certain terminals, e.g. iTerm macOS, Linux terminals based VTE (GNOME terminal) support .href, .email .file links. can use ansi_has_hyperlink_support() check terminal IDE hyperlink support general, ansi_hyperlink_types() check various types hyperlinks supported. hyperlink support detected properly IDE terminal, please open cli issue https://github.com/r-lib/cli/issues.","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":"delve various types hyperlinks, general comment link texts. link styles support custom link text: .href .help .topic .vignette .run Others, .e. .email, .file, .fun .url support custom link text. generic syntax link text Markdown hyperlinks:","code":"{.style [link text](url)}"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"vectorization","dir":"Reference","previous_headings":"","what":"Vectorization","title":"cli hyperlinks — links","text":"Note possible add link text vector URLs. E.g. create list three URLs, clickable:","code":"urls <- paste0(\"https://httpbin.org/status/\", c(200, 403, 404)) cli::cli_text(\"Some httpbin URLs: {.url {urls}}.\") #> Some httpbin URLs: , #> , and #> ."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"what-if-hyperlinks-are-not-available-","dir":"Reference","previous_headings":"","what":"What if hyperlinks are not available?","title":"cli hyperlinks — links","text":"ANSI hyperlinks available, link text styles outputs link text URL (hopefully) helpful way. See examples .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"urls","dir":"Reference","previous_headings":"","what":"URLs","title":"cli hyperlinks — links","text":"two cli styles link generic URLs. .url allow custom link text, \\href .","code":"cli_text( \"See the cli homepage at {.url https://cli.r-lib.org} for details.\" ) #> See the cli homepage at for details. cli_text( \"See the {.href [cli homepage](https://cli.r-lib.org)} for details.\" ) #> See the cli homepage for details."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"without-hyperlink-support","dir":"Reference","previous_headings":"","what":"Without hyperlink support","title":"cli hyperlinks — links","text":"links look without hyperlink support:","code":"local({ withr::local_options(cli.hyperlink = FALSE) cli_text( \"See the cli homepage at {.url https://cli.r-lib.org} for details.\" ) cli_text( \"See the {.href [cli homepage](https://cli.r-lib.org)} for details.\" ) }) #> See the cli homepage at for details. #> See the cli homepage () for details."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"url-encoding","dir":"Reference","previous_headings":"","what":"URL encoding","title":"cli hyperlinks — links","text":"Note cli encode url, might need call utils::URLencode() , especially, substituted via {}.","code":"weirdurl <- utils::URLencode(\"https://example.com/has some spaces\") cli_text(\"See more at {.url {weirdurl}}.\") #> See more at ."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"files","dir":"Reference","previous_headings":"","what":"Files","title":"cli hyperlinks — links","text":".file style now automatically creates file: hyperlink. file: hyperlinks must contain absolute path, cli tries convert relative paths, paths starting ~ aboslute path.","code":"cli_text(\"... edit your {.file ~/.Rprofile} file.}\") #> ... edit your ~/.Rprofile file.}"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text-1","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":".file use custom link text. custom link text, can use .href file: URL.","code":"prof <- path.expand(\"~/.Rprofile\") cli_text(\"... edit your {.href [R profile](file://{prof})}.\") #> ... edit your R profile."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"line-and-column-numbers","dir":"Reference","previous_headings":"","what":"Line and column numbers","title":"cli hyperlinks — links","text":"may add line number file name, separated :. Handlers typically place cursor line opening file. may also add column number, line number, separated another :.","code":"cli_text(\"... see line 5 in {.file ~/.Rprofile:5}.\") #> ... see line 5 in ~/.Rprofile:5."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"default-handler","dir":"Reference","previous_headings":"","what":"Default handler","title":"cli hyperlinks — links","text":"RStudio file: URLs open within RStudio. click file link outside RStudio, typically operating system consulted application open .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"without-hyperlink-support-1","dir":"Reference","previous_headings":"","what":"Without hyperlink support","title":"cli hyperlinks — links","text":"One issue using .href file files look great hyperlinks available. improved future:","code":"local({ withr::local_options(cli.hyperlink = FALSE) prof <- path.expand(\"~/.Rprofile\") cli_text(\"... edit your {.href [R profile](file://{prof})}.\") }) #> ... edit your R profile ()."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"links-to-the-manual","dir":"Reference","previous_headings":"","what":"Links to the manual","title":"cli hyperlinks — links","text":".fun automatically creates links manual page function, provided function name packagename::functionname form:","code":"cli::cli_text(\"... see {.fun stats::lm} to learn more.\") #> ... see `stats::lm()` to learn more."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text-2","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":"custom link text, use .help instead .fun.","code":"cli::cli_text(\"... see {.help [{.fun lm}](stats::lm)} to learn more.\") #> ... see `lm()` to learn more."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"without-hyperlink-support-2","dir":"Reference","previous_headings":"","what":"Without hyperlink support","title":"cli hyperlinks — links","text":"message without hyperlink support looks like :","code":"local({ withr::local_options(cli.hyperlink = FALSE) cli::cli_text(\"... see {.help [{.fun lm}](stats::lm)} to learn more.\") }) #> ... see `lm()` (`?stats::lm()`) to learn more."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"topics","dir":"Reference","previous_headings":"","what":"Topics","title":"cli hyperlinks — links","text":"link help topic function, use .topic: .topic support link text.","code":"cli::cli_text(\"... the tibble options at {.topic tibble::tibble_options}.\") #> ... the tibble options at tibble::tibble_options."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"vignettes","dir":"Reference","previous_headings":"","what":"Vignettes","title":"cli hyperlinks — links","text":"link vignette, use .vignette:","code":"cli::cli_text(\"... see the {.vignette tibble::types} vignette.\") #> ... see the tibble::types vignette."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"click-to-run-code","dir":"Reference","previous_headings":"","what":"Click to run code","title":"cli hyperlinks — links","text":"RStudio also supports special link type runs R code current R session upon clicking. can create links .run:","code":"cli::cli_text(\"Run {.run testthat::snapshot_review()} to review\") #> Run testthat::snapshot_review() to review"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text-3","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":"Sometimes want show slightly different expression link, one evaluated. E.g. evaluated expression probably needs qualify packages ::, might want show :","code":"cli::cli_text( \"Run {.run [snapshot_review()](testthat::snapshot_review())} to review\" ) #> Run snapshot_review() to review"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"security-considerations","dir":"Reference","previous_headings":"","what":"Security considerations","title":"cli hyperlinks — links","text":"make .run hyperlinks secure, RStudio run code pkg::fun(args) form, args contains (, ) ;, calls core package (base, stats, etc.), calls package loaded, one testthat, devtools, usethis, rlang, pkgload, pkgdown explicitly allowed. RStudio run .run hyperlink, shows code user can copy paste console, consider safe run. Note depending version RStudio, behavior can change.","code":""},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":null,"dir":"Reference","previous_headings":"","what":"List all available spinners — list_spinners","title":"List all available spinners — list_spinners","text":"List available spinners","code":""},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List all available spinners — list_spinners","text":"","code":"list_spinners()"},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List all available spinners — list_spinners","text":"Character vector available spinner names.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List all available spinners — list_spinners","text":"","code":"list_spinners() #> [1] \"dots\" \"dots2\" \"dots3\" #> [4] \"dots4\" \"dots5\" \"dots6\" #> [7] \"dots7\" \"dots8\" \"dots9\" #> [10] \"dots10\" \"dots11\" \"dots12\" #> [13] \"dots13\" \"dots8Bit\" \"sand\" #> [16] \"line\" \"line2\" \"pipe\" #> [19] \"simpleDots\" \"simpleDotsScrolling\" \"star\" #> [22] \"star2\" \"flip\" \"hamburger\" #> [25] \"growVertical\" \"growHorizontal\" \"balloon\" #> [28] \"balloon2\" \"noise\" \"bounce\" #> [31] \"boxBounce\" \"boxBounce2\" \"triangle\" #> [34] \"arc\" \"circle\" \"squareCorners\" #> [37] \"circleQuarters\" \"circleHalves\" \"squish\" #> [40] \"toggle\" \"toggle2\" \"toggle3\" #> [43] \"toggle4\" \"toggle5\" \"toggle6\" #> [46] \"toggle7\" \"toggle8\" \"toggle9\" #> [49] \"toggle10\" \"toggle11\" \"toggle12\" #> [52] \"toggle13\" \"arrow\" \"arrow2\" #> [55] \"arrow3\" \"bouncingBar\" \"bouncingBall\" #> [58] \"smiley\" \"monkey\" \"hearts\" #> [61] \"clock\" \"earth\" \"material\" #> [64] \"moon\" \"runner\" \"pong\" #> [67] \"shark\" \"dqpb\" \"weather\" #> [70] \"christmas\" \"grenade\" \"point\" #> [73] \"layer\" \"betaWave\" \"fingerDance\" #> [76] \"fistBump\" \"soccerHeader\" \"mindblown\" #> [79] \"speaker\" \"orangePulse\" \"bluePulse\" #> [82] \"orangeBluePulse\" \"timeTravel\" \"aesthetic\" #> [85] \"growVeriticalDotsLR\" \"growVeriticalDotsRL\" \"growVeriticalDotsLL\" #> [88] \"growVeriticalDotsRR\" get_spinner(list_spinners()[1]) #> $name #> [1] \"dots\" #> #> $interval #> [1] 80 #> #> $frames #> [1] \"⠋\" \"⠙\" \"⠹\" \"⠸\" \"⠼\" \"⠴\" \"⠦\" \"⠧\" \"⠇\" \"⠏\" #>"},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new ANSI style — make_ansi_style","title":"Create a new ANSI style — make_ansi_style","text":"Create function can used add ANSI styles text.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new ANSI style — make_ansi_style","text":"","code":"make_ansi_style(..., bg = FALSE, grey = FALSE, colors = num_ansi_colors())"},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new ANSI style — make_ansi_style","text":"... style create. See details examples . bg Whether color applies background. grey Whether specifically create grey color. flag included, ANSI 256 finer color scale greys, usual 0:5 scale red, green blue components. used RGB color specifications (either numerically via hexadecimal string), ignored eight color ANSI terminals. colors Number colors, detected automatically default.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new ANSI style — make_ansi_style","text":"function can used color (style) strings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new ANSI style — make_ansi_style","text":"... style argument can following: cli ANSI style function class cli_ansi_style. returned , without looking arguments. R color name, see grDevices::colors(). 6- 8-digit hexadecimal color string, e.g. #ff0000 means red. Transparency (alpha channel) values ignored. one-column matrix three rows red, green blue channels, returned grDevices::col2rgb(). make_ansi_style() detects number colors use automatically (can overridden using colors argument). number colors less 256 (detected given), falls back color ANSI eight color mode closest specified (RGB R) color.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new ANSI style — make_ansi_style","text":"","code":"make_ansi_style(\"orange\") #> #> Example output make_ansi_style(\"#123456\") #> #> Example output make_ansi_style(\"orange\", bg = TRUE) #> #> Example output orange <- make_ansi_style(\"orange\") orange(\"foobar\") #> #> [1] foobar cat(orange(\"foobar\")) #> foobar"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a spinner — make_spinner","title":"Create a spinner — make_spinner","text":"Create spinner","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a spinner — make_spinner","text":"","code":"make_spinner( which = NULL, stream = \"auto\", template = \"{spin}\", static = c(\"dots\", \"print\", \"print_line\", \"silent\") )"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a spinner — make_spinner","text":"name chosen spinner. NULL, default used, can customized via cli.spinner_unicode, cli.spinner_ascii cli.spinner options. (latter applies Unicode ASCII displays. options can set name built-spinner, list entry called frames, character vector frames. stream stream use spinner. Typically standard error, maybe standard output stream. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr(). template template string, contain spinner. spinner substituted {spin}. See example . static terminal support dynamic displays: \"dots\": show dot $spin() call. \"print\": just print frames spinner, one another. \"print_line\": print frames spinner, line. \"silent\" print anything, just template.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a spinner — make_spinner","text":"cli_spinner object, list functions. See methods . cli_spinner methods: $spin(): output next frame spinner. $finish(): terminate spinner. Depending terminal capabilities removes spinner screen. Spinners can reused, can start calling $spin() method . methods return spinner object , invisibly. spinner automatically throttled ideal update frequency.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"default-spinner","dir":"Reference","previous_headings":"","what":"Default spinner","title":"Create a spinner — make_spinner","text":"","code":"sp1 <- make_spinner() fun_with_spinner <- function() { lapply(1:100, function(x) { sp1$spin(); Sys.sleep(0.05) }) sp1$finish() } ansi_with_hidden_cursor(fun_with_spinner())"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"spinner-with-a-template","dir":"Reference","previous_headings":"","what":"Spinner with a template","title":"Create a spinner — make_spinner","text":"","code":"sp2 <- make_spinner(template = \"Computing {spin}\") fun_with_spinner2 <- function() { lapply(1:100, function(x) { sp2$spin(); Sys.sleep(0.05) }) sp2$finish() } ansi_with_hidden_cursor(fun_with_spinner2())"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"custom-spinner","dir":"Reference","previous_headings":"","what":"Custom spinner","title":"Create a spinner — make_spinner","text":"","code":"sp3 <- make_spinner(\"simpleDotsScrolling\", template = \"Downloading {spin}\") fun_with_spinner3 <- function() { lapply(1:100, function(x) { sp3$spin(); Sys.sleep(0.05) }) sp3$finish() } ansi_with_hidden_cursor(fun_with_spinner3())"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/match_selector.html","id":null,"dir":"Reference","previous_headings":"","what":"Match a selector to a container stack — match_selector","title":"Match a selector to a container stack — match_selector","text":"Match selector container stack","code":""},{"path":"https://cli.r-lib.org/dev/reference/match_selector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Match a selector to a container stack — match_selector","text":"","code":"match_selector(sels, cnts)"},{"path":"https://cli.r-lib.org/dev/reference/match_selector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Match a selector to a container stack — match_selector","text":"sels list selector nodes. cnts list container nodes. last selector list must match last container, matching back. use function calculate style newly encountered containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/match_selector_node.html","id":null,"dir":"Reference","previous_headings":"","what":"Match a selector node to a container — match_selector_node","title":"Match a selector node to a container — match_selector_node","text":"Match selector node container","code":""},{"path":"https://cli.r-lib.org/dev/reference/match_selector_node.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Match a selector node to a container — match_selector_node","text":"","code":"match_selector_node(node, cnt)"},{"path":"https://cli.r-lib.org/dev/reference/match_selector_node.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Match a selector node to a container — match_selector_node","text":"node Selector node, parsed parse_selector_node(). cnt Container node, elements tag, id, class. selector node matches container, hold: id selector missing unique. tag selector missing unique. id container missing unique. tag container unique. selector specifies id, matches id container. selector specifies tag, matches tag container. selector specifies class names, container classes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect the number of ANSI colors to use — num_ansi_colors","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"Certain Unix Windows terminals, also certain R GUIs, e.g. RStudio, support styling terminal output using special control sequences (ANSI sequences). num_ansi_colors() detects current R session supports ANSI sequences, many colors supported.","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"","code":"num_ansi_colors(stream = \"auto\") detect_tty_colors()"},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"stream stream used output, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr().","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"Integer, number ANSI colors current R session supports stream.","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"detection mechanism quite involved designed work box systems. work system, please report bug. Setting options environment variables turn ANSI support error prone, inherited environments, e.g. knitr, might ANSI support. want turn ANSI colors, set NO_COLOR environment variable non-empty value. exact detection mechanism follows: cli.num_colors options set, returned. R_CLI_NUM_COLORS environment variable set non-empty value, used. crayon.enabled option set FALSE, 1L returned. (compatibility code uses crayon package.) crayon.enabled option set TRUE crayon.colors option set, value cli.default_num_colors option, unset, 8L returned. crayon.enabled option set TRUE crayon.colors option also set, latter returned. (compatibility code uses crayon package.) NO_COLOR environment variable set, 1L returned. knitr, 1L returned, turn colors .Rmd chunks. stream \"auto\" (default) active sink (either \"output\" \"message\"), return 1L. (theory need check stream actually used, easy way tell .) stream \"auto\", stderr() active sink , 1L returned. (sink active \"output\", R changes stdout() stream, check needed.) cli.default_num_colors option set, use . R running inside RGui Windows, R.app macOS, return 1L. R running inside RStudio, color support, appropriate number colors returned, usually 256L. R running Windows, inside Emacs version recent enough support ANSI colors, value cli.default_num_colors option, unset 8L returned. (Windows, Emacs isatty(stdout()) == FALSE, need check dealing terminals.) stream standard output standard error terminal, 1L returned. Otherwise use cache result terminal color detection (see ). terminal color detection algorithm: COLORTERM environment variable set truecolor 24bit, return 16 million colors. COLORTERM environment variable set anything else, return value cli.num_default_colors option, 8L unset. R running Unix, inside Emacs version recent enough support ANSI colors, value cli.default_num_colors option returned, 8L unset. Windows RStudio terminal, apparently eight colors, cli.default_num_colors option can used override . recent enough Windows 10 terminal, either true color (build 14931) 256 color (build 10586) support. can also use cli.default_num_colors option override . Windows, ConEmu cmder, ANSICON loaded, value cli.default_num_colors, 8L unset, returned. Otherwise Windows, return 1L. Otherwise Unix try run tput colors determine number colors. succeeds, return return value. TERM environment variable xterm tput returned 8L, return 256L, xterm compatible terminals tend support 256 colors (https://github.com/r-lib/crayon/issues/17) can override cli.default_num_colors option. TERM set dumb, return 1L. TERM starts screen, xterm, vt100, return 8L. TERM contains color, ansi, cygwin linux, return 8L. Otherwise return 1L.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"","code":"num_ansi_colors() #> [1] 256"},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse a CSS3-like selector — parse_selector","title":"Parse a CSS3-like selector — parse_selector","text":"rather small subset CSS3 supported:","code":""},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse a CSS3-like selector — parse_selector","text":"","code":"parse_selector(x)"},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse a CSS3-like selector — parse_selector","text":"x CSS3-like selector string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Parse a CSS3-like selector — parse_selector","text":"Selectors: Type selectors, e.g. input selects elements. Class selectors, e.g. .index selects element class \"index\". ID selector. #toc match element ID \"toc\". Combinators: Descendant combinator, .e. space, combinator selects nodes descendants first element. E.g. div span match elements inside
      element.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Pluralization helper functions — no","title":"Pluralization helper functions — no","text":"Pluralization helper functions","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pluralization helper functions — no","text":"","code":"no(expr) qty(expr)"},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pluralization helper functions — no","text":"expr () expression printed \"\" cli expressions, interpreted zero quantity. qty() expression sets pluralization quantity without printing anything. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pluralization helper functions — no","text":"","code":"nfile <- 0; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found no files. #> Found no files. nfile <- 1; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. #> Found 1 file. nfile <- 2; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 2 files. #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":null,"dir":"Reference","previous_headings":"","what":"About cli pluralization — pluralization","title":"About cli pluralization — pluralization","text":"cli pluralization","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"introduction","dir":"Reference","previous_headings":"","what":"Introduction","title":"About cli pluralization — pluralization","text":"cli tools create messages printed correctly singular plural forms. usually requires minimal extra work, increases quality messages greatly. document first show pluralization examples can use guidelines. Hopefully intuitive enough, can used without knowing exact cli pluralization rules. need pluralization without semantic cli functions, see pluralize() function.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"pluralization-markup","dir":"Reference","previous_headings":"","what":"Pluralization markup","title":"About cli pluralization — pluralization","text":"simplest case message contains single {} glue substitution, specifies quantity used select singular plural forms. Pluralization uses markup similar glue, uses {? } delimiters: value nfile used decide whether singular plural form file used. common case English messages.","code":"library(cli) nfile <- 0; cli_text(\"Found {nfile} file{?s}.\") #> Found 0 files. nfile <- 1; cli_text(\"Found {nfile} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {nfile} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"irregular-plurals","dir":"Reference","previous_headings":"","what":"Irregular plurals","title":"About cli pluralization — pluralization","text":"plural form difficult simple s suffix, singular plural forms can given, separated forward slash:","code":"ndir <- 1; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 1 directory. ndir <- 5; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 5 directories."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"use-no-instead-of-zero","dir":"Reference","previous_headings":"","what":"Use \"no\" instead of zero","title":"About cli pluralization — pluralization","text":"readability, better use () helper function include count message. () prints word \"\" count zero, prints numeric count otherwise:","code":"nfile <- 0; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found no files. nfile <- 1; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"use-the-length-of-character-vectors","dir":"Reference","previous_headings":"","what":"Use the length of character vectors","title":"About cli pluralization — pluralization","text":"auto-collapsing feature cli easy include list objects message. cli interprets character vector pluralization quantity, takes length vector: Note length used non-numeric vectors (.numeric(x) return FALSE). want use length numeric vector, convert character via .character(). can combine collapsed vectors \"\", like : pluralization markup contains three alternatives, like , first one used zero, second one, third one larger quantities.","code":"pkgs <- \"pkg1\" cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1 package. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. pkgs <- character() cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove no packages. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"choosing-the-right-quantity","dir":"Reference","previous_headings":"","what":"Choosing the right quantity","title":"About cli pluralization — pluralization","text":"text contains multiple glue {} substitutions, one right pluralization markup used. example: sometimes correct one. can explicitly specify correct quantity using qty() function. sets quantity without printing anything: Note message contains single {} substitution, may appear pluralization markup. message contains multiple {} substitutions pluralization markup, error thrown. Similarly, message contains {} substitutions , pluralization markup, error thrown.","code":"nfiles <- 3; ndirs <- 1 cli_text(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}\") #> Found 3 files and 1 directory nupd <- 3; ntotal <- 10 cli_text(\"{nupd}/{ntotal} {qty(nupd)} file{?s} {?needs/need} updates\") #> 3/10 files need updates"},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"rules","dir":"Reference","previous_headings":"","what":"Rules","title":"About cli pluralization — pluralization","text":"exact rules cli pluralization. two sets rules. first set specifies quantity associated {?} pluralization markup. second set describes {?} parsed interpreted.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"quantities","dir":"Reference","previous_headings":"","what":"Quantities","title":"About cli pluralization — pluralization","text":"{} substitutions define quantities. value {} substitution numeric (.numeric(x) holds), length one define quantity. enforced {} substitution used pluralization. quantity defined value {} , rounded .integer(). value {} numeric, quantity defined length. message {?} markup {} substitution, error thrown. message exactly one {} substitution, value used pluralization quantity {?} markup message. message multiple {} substitutions, {?} markup cli uses quantity {} substitution precedes . message multiple {} substitutions pluralization markup without preceding {} substitution, error thrown.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"pluralization-markup-1","dir":"Reference","previous_headings":"","what":"Pluralization markup","title":"About cli pluralization — pluralization","text":"Pluralization markup starts {? ends }. may contain { } characters, may contain {} substitutions either. Alternative words suffixes separated /. single alternative, nothing used quantity == 1 single alternative used quantity != 1. two alternatives, first one used quantity == 1, second one quantity != 1 (including `quantity == 0). three alternatives, first one used quantity == 0, second one quantity == 1, third one otherwise.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":null,"dir":"Reference","previous_headings":"","what":"String templating with pluralization — pluralize","title":"String templating with pluralization — pluralize","text":"pluralize() similar glue::glue(), two differences: supports cli's pluralization syntax, using {?} markers. collapses substituted vectors comma separated string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"String templating with pluralization — pluralize","text":"","code":"pluralize( ..., .envir = parent.frame(), .transformer = glue::identity_transformer )"},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"String templating with pluralization — pluralize","text":"..., .envir, .transformer arguments passed glue::glue().","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"String templating with pluralization — pluralize","text":"See pluralization examples . need install glue package use function.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"String templating with pluralization — pluralize","text":"","code":"# Regular plurals nfile <- 0; pluralize(\"Found {nfile} file{?s}.\") #> Found 0 files. nfile <- 1; pluralize(\"Found {nfile} file{?s}.\") #> Found 1 file. nfile <- 2; pluralize(\"Found {nfile} file{?s}.\") #> Found 2 files. # Irregular plurals ndir <- 1; pluralize(\"Found {ndir} director{?y/ies}.\") #> Found 1 directory. ndir <- 5; pluralize(\"Found {ndir} director{?y/ies}.\") #> Found 5 directories. # Use 'no' instead of zero nfile <- 0; pluralize(\"Found {no(nfile)} file{?s}.\") #> Found no files. nfile <- 1; pluralize(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. nfile <- 2; pluralize(\"Found {no(nfile)} file{?s}.\") #> Found 2 files. # Use the length of character vectors pkgs <- \"pkg1\" pluralize(\"Will remove the {pkgs} package{?s}.\") #> Will remove the pkg1 package. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") pluralize(\"Will remove the {pkgs} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. pkgs <- character() pluralize(\"Will remove {?no/the/the} {pkgs} package{?s}.\") #> Will remove no packages. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") pluralize(\"Will remove {?no/the/the} {pkgs} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. # Multiple quantities nfiles <- 3; ndirs <- 1 pluralize(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}\") #> Found 3 files and 1 directory # Explicit quantities nupd <- 3; ntotal <- 10 cli_text(\"{nupd}/{ntotal} {qty(nupd)} file{?s} {?needs/need} updates\") #> 3/10 files need updates"},{"path":"https://cli.r-lib.org/dev/reference/pretty_print_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn on pretty-printing functions at the R console — pretty_print_code","title":"Turn on pretty-printing functions at the R console — pretty_print_code","text":"Defines print method functions, current session, supports syntax highlighting.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pretty_print_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn on pretty-printing functions at the R console — pretty_print_code","text":"","code":"pretty_print_code()"},{"path":"https://cli.r-lib.org/dev/reference/pretty_print_code.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Turn on pretty-printing functions at the R console — pretty_print_code","text":"new print method takes priority built-one. Use base::suppressMessages() suppress alert message.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":null,"dir":"Reference","previous_headings":"","what":"The cli progress C API — progress-c","title":"The cli progress C API — progress-c","text":"cli progress C API","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-should-tick","dir":"Reference","previous_headings":"","what":"CLI_SHOULD_TICK","title":"The cli progress C API — progress-c","text":"macro evaluates (int) 1 cli progress bar update due, (int) 0 otherwise. timer initialized compilation unit yet, always 0. initialize timer, call cli_progress_init_timer() create progress bar cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-add-","dir":"Reference","previous_headings":"","what":"cli_progress_add()","title":"The cli progress C API — progress-c","text":"Add number progress units progress bar. also trigger update update due. bar: progress bar object. inc: progress increment.","code":"void cli_progress_add(SEXP bar, double inc);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-bar-","dir":"Reference","previous_headings":"","what":"cli_progress_bar()","title":"The cli progress C API — progress-c","text":"Create new progress bar object. returned progress bar object must PROTECT()-ed. total: Total number progress units. Use NA_REAL known. config: R named list object additional parameters. May NULL (C NULL~) R_NilValue(RNULL`) defaults. config may contain following entries: name: progress bar name. status: (initial) progress bar status. type: progress bar type. total: total number progress units. show_after: show progress bar specified number seconds. overrides global show_after option. format: format string, must specified custom progress bars. format_done: format string successful termination. format_failed: format string unsuccessful termination. clear: whether remove progress bar screen termination. auto_terminate: whether terminate progress bar number current units equals number total progress units.","code":"SEXP cli_progress_bar(double total, SEXP config);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"example","dir":"Reference","previous_headings":"","what":"Example","title":"The cli progress C API — progress-c","text":"","code":"#include SEXP progress_test1() { int i; SEXP bar = PROTECT(cli_progress_bar(1000, NULL)); for (i = 0; i < 1000; i++) { cli_progress_sleep(0, 4 * 1000 * 1000); if (CLI_SHOULD_TICK) cli_progress_set(bar, i); } cli_progress_done(bar); UNPROTECT(1); return Rf_ScalarInteger(i); }"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-done-","dir":"Reference","previous_headings":"","what":"cli_progress_done()","title":"The cli progress C API — progress-c","text":"Terminate progress bar. bar: progress bar object.","code":"void cli_progress_done(SEXP bar);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-init-timer-","dir":"Reference","previous_headings":"","what":"cli_progress_init_timer()","title":"The cli progress C API — progress-c","text":"Initialize cli timer without creating progress bar.","code":"void cli_progress_init_timer();"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-num-","dir":"Reference","previous_headings":"","what":"cli_progress_num()","title":"The cli progress C API — progress-c","text":"Returns number currently active progress bars.","code":"int cli_progress_num();"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-","dir":"Reference","previous_headings":"","what":"cli_progress_set()","title":"The cli progress C API — progress-c","text":"Set progress bar specified number progress units. bar: progress bar object. set: number current progress progress units.","code":"void cli_progress_set(SEXP bar, double set);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-clear-","dir":"Reference","previous_headings":"","what":"cli_progress_set_clear()","title":"The cli progress C API — progress-c","text":"Set whether remove progress bar screen. can call time cli_progress_done() called. bar: progress bar object. clear: whether remove progress bar screen, zero one.","code":"void cli_progress_set_clear(SEXP bar, int clear);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-format-","dir":"Reference","previous_headings":"","what":"cli_progress_set_format()","title":"The cli progress C API — progress-c","text":"Set custom format string progress bar. call try update progress bar. want request update, call cli_progress_add(), cli_progress_set() cli_progress_update(). bar: progress bar object. format: format string. ...: values substitute format. format ... passed vsnprintf() create format string. Format strings may contain glue substitutions, referring progress variables, pluralization, cli styling.","code":"void cli_progress_set_format(SEXP bar, const char *format, ...);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-name-","dir":"Reference","previous_headings":"","what":"cli_progress_set_name()","title":"The cli progress C API — progress-c","text":"Set name progress bar. bar; progress bar object. name: progress bar name.","code":"void cli_progress_set_name(SEXP bar, const char *name);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-status-","dir":"Reference","previous_headings":"","what":"cli_progress_set_status()","title":"The cli progress C API — progress-c","text":"Set status progress bar. bar: progress bar object. status : progress bar status.","code":"void cli_progress_set_status(SEXP bar, const char *status);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-type-","dir":"Reference","previous_headings":"","what":"cli_progress_set_type()","title":"The cli progress C API — progress-c","text":"Set progress bar type. Call function right creating progress bar cli_progress_bar(). Otherwise behavior undefined. bar: progress bar object. type: progress bar type. Possible progress bar types: iterator, tasks, download custom.","code":"void cli_progress_set_type(SEXP bar, const char *type);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-update-","dir":"Reference","previous_headings":"","what":"cli_progress_update()","title":"The cli progress C API — progress-c","text":"Update progress bar. Unlike simpler cli_progress_add() cli_progress_set() function, can force update force set 1. bar: progress bar object. set: number current progress units. ignored negative. inc: increment add current number progress units. ignored set negative. force: whether force update, even update due. force update without changing current number progress units, supply set = -1, inc = 0 force = 1.","code":"void cli_progress_update(SEXP bar, double set, double inc, int force);"},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":null,"dir":"Reference","previous_headings":"","what":"Progress bar utility functions. — cli_progress_num","title":"Progress bar utility functions. — cli_progress_num","text":"Progress bar utility functions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Progress bar utility functions. — cli_progress_num","text":"","code":"cli_progress_num() cli_progress_cleanup()"},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Progress bar utility functions. — cli_progress_num","text":"cli_progress_num() returns integer scalar. `cli_progress_cleanup() return anything.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Progress bar utility functions. — cli_progress_num","text":"cli_progress_num() returns number currently active progress bars. (currently include progress bars created C/C++ code.) cli_progress_cleanup() terminates active progress bars. (currently ignores progress bars created C/C++ code.)","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Progress bar variables — progress-variables","title":"Progress bar variables — progress-variables","text":"Progress bar variables","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Progress bar variables — progress-variables","text":"variables can used cli progress bar format strings. calculated demand. use variable, e.g. pb_bar package, either need import pb_bar cli, use qualified form format string: cli::pb_bar. Similarly, R scripts, can use pb_bar library(cli), cli::pb_bar attach cli package.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-bar","dir":"Reference","previous_headings":"","what":"pb_bar","title":"Progress bar variables — progress-variables","text":"Creates visual progress bar. number total units unknown, return empty string.","code":"cli_progress_bar( total = 100, format = \"Fitting model {cli::pb_bar} {cli::pb_percent}\" ) #> Fitting model ███████████████████████████████ 66%"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-current","dir":"Reference","previous_headings":"","what":"pb_current","title":"Progress bar variables — progress-variables","text":"number current progress units.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_spin} Reading file {cli::pb_current}/{cli::pb_total}\" ) #> ⠙ Reading file 66/100"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-current-bytes","dir":"Reference","previous_headings":"","what":"pb_current_bytes","title":"Progress bar variables — progress-variables","text":"number current progress units formatted bytes. output constant width six characters.","code":"cli_progress_bar( format = \"Got {cli::pb_current_bytes} in {cli::pb_elapsed}\" ) #> Got 524 kB in 5s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-elapsed","dir":"Reference","previous_headings":"","what":"pb_elapsed","title":"Progress bar variables — progress-variables","text":"elapsed time since start progress bar. time measured since progress bar created cli_progress_bar() similar.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} [{cli::pb_elapsed}]\" ) #> ███████████████████████████████ 66% [5s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-elapsed-clock","dir":"Reference","previous_headings":"","what":"pb_elapsed_clock","title":"Progress bar variables — progress-variables","text":"elapsed time, hh::mm::ss format.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} [{cli::pb_elapsed_clock}]\" ) #> ███████████████████████████████ 66% [00:00:05]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-elapsed-raw","dir":"Reference","previous_headings":"","what":"pb_elapsed_raw","title":"Progress bar variables — progress-variables","text":"number seconds since start progress bar.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} [{round(cli::pb_elapsed_raw)}s]\" ) #> ███████████████████████████████ 66% [5s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-eta","dir":"Reference","previous_headings":"","what":"pb_eta","title":"Progress bar variables — progress-variables","text":"estimated time end progress bar, human readable form.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} | ETA: {cli::pb_eta}\" ) #> ███████████████████████████████ 66% | ETA: 3s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-eta-raw","dir":"Reference","previous_headings":"","what":"pb_eta_raw","title":"Progress bar variables — progress-variables","text":"estimated time end progress bar, seconds. useful want adjust default pb_eta display.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} | ETA: {round(cli::pb_eta_raw)}s\" ) #> ███████████████████████████████ 66% | ETA: 3s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-eta-str","dir":"Reference","previous_headings":"","what":"pb_eta_str","title":"Progress bar variables — progress-variables","text":"estimated time end progress bar. includes \"ETA:\" prefix. shown time can estimated, otherwise empty string.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} | {cli::pb_eta_str}\" ) #> ███████████████████████████████ 66% | ETA: 3s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-extra","dir":"Reference","previous_headings":"","what":"pb_extra","title":"Progress bar variables — progress-variables","text":"pb_extra can used access extra data, see extra argument cli_progress_bar() cli_progress_update().","code":"cli_progress_bar( total = 100, extra = list(user = whoami::username()), format = \"Cleaning cache for user '{cli::pb_extra$user}': {cli::pb_current_bytes}\" ) #> Cleaning cache for user 'gaborcsardi': 161 MB"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-id","dir":"Reference","previous_headings":"","what":"pb_id","title":"Progress bar variables — progress-variables","text":"id progress bar. id format cli-- process id, integer counter incremented every time cli needs new unique id. useful debugging progress bars.","code":"cli_progress_bar( format = \"Progress bar '{cli::pb_id}' is at {cli::pb_current}\" ) #> Progress bar 'cli-82040-1814' is at 64"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-name","dir":"Reference","previous_headings":"","what":"pb_name","title":"Progress bar variables — progress-variables","text":"name progress bar. supplied developer, default empty string. space character added non-empty names.","code":"cli_progress_bar( name = \"Loading training data\", total = 100, format = \"{cli::pb_name} {cli::pb_bar} {cli::pb_percent}\" ) #> Loading training data ███████████████████████████████ 66%"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-percent","dir":"Reference","previous_headings":"","what":"pb_percent","title":"Progress bar variables — progress-variables","text":"percentage progress bar, always formatted three characters plus percentage sign. total number units unknown, \" NA%\".","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent}\" ) #> ███████████████████████████████ 66%"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-pid","dir":"Reference","previous_headings":"","what":"pb_pid","title":"Progress bar variables — progress-variables","text":"integer process id progress bar. useful aggregating logging output progress results multiple processes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-rate","dir":"Reference","previous_headings":"","what":"pb_rate","title":"Progress bar variables — progress-variables","text":"progress rate, number units per second, formatted string.","code":"cli_progress_bar( total = 156, format = \"Reading input files {pb_current}/{pb_total} [{pb_rate}]\" ) #> Reading input files 68/156 [14/s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-rate-raw","dir":"Reference","previous_headings":"","what":"pb_rate_raw","title":"Progress bar variables — progress-variables","text":"raw progress rate, number units per second.","code":"cli_progress_bar( total = 156, format = \"Reading input files {pb_current}/{pb_total} [{round(pb_rate_raw)}/s]\" ) #> Reading input files 68/156 [14/s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-rate-bytes","dir":"Reference","previous_headings":"","what":"pb_rate_bytes","title":"Progress bar variables — progress-variables","text":"progress rate, formatted bytes per second, human readable form.","code":"cli_progress_bar( total = 256 * 1024 * 1014, format = paste0( \"Reading data {pb_current_bytes}/{pb_total_bytes} \", \"[{ansi_trimws(pb_rate_bytes)}]\" ) #> Reading data 70 MB/266 MB [14 MB/s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-spin","dir":"Reference","previous_headings":"","what":"pb_spin","title":"Progress bar variables — progress-variables","text":"spinner. default spinner selected via get_spinner() call.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_spin} Reading file {cli::pb_current}/{cli::pb_total}\" ) #> ⠙ Reading file 66/100"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-status","dir":"Reference","previous_headings":"","what":"pb_status","title":"Progress bar variables — progress-variables","text":"status string progress bar. default empty string, possible set cli_progress_bar() `cli_progress_update()].","code":"cli_progress_bar(status = \"Connecting...\") #> ⠙ Connecting... 0 done (0/s) | 1s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-timestamp","dir":"Reference","previous_headings":"","what":"pb_timestamp","title":"Progress bar variables — progress-variables","text":"time stamp current time ISO 8601 format.","code":"cli_progress_bar( \"Loading training data files\", format = \"{pb_timestamp} {pb_current} ({pb_rate})\" #> 2022-09-07T11:27:50+00:00 125 (25/s)"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-total","dir":"Reference","previous_headings":"","what":"pb_total","title":"Progress bar variables — progress-variables","text":"total number progress units, NA number units unknown.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_spin} Reading file {cli::pb_current}/{cli::pb_total}\" ) #> ⠙ Reading file 66/100"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-total-bytes","dir":"Reference","previous_headings":"","what":"pb_total_bytes","title":"Progress bar variables — progress-variables","text":"total number progress units, formatted bytes, human readable format.","code":"cli_progress_bar( total = 256 * 1024 * 1014, format = paste0( \"Reading data {pb_current_bytes}/{pb_total_bytes} \", \"[{ansi_trimws(pb_rate_bytes)}]\" ) #> Reading data 70 MB/266 MB [14 MB/s]"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a rule with one or two text labels — rule","title":"Make a rule with one or two text labels — rule","text":"rule can include either centered text label, labels left right side. color labels, use functions col_*, bg_* style_* functions, see ANSI styles, examples . color line, either functions directly, line_col option.","code":""},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a rule with one or two text labels — rule","text":"","code":"rule( left = \"\", center = \"\", right = \"\", line = 1, col = NULL, line_col = col, background_col = NULL, width = console_width() )"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a rule with one or two text labels — rule","text":"left Label show left. interferes center label, one can present. center Label show center. interferes left right labels. right Label show right. interferes center label, one can present. line character string used draw line. can also 1 2, request single line (Unicode, available), double line. strings interpreted specially, see Line styles . col Color text, default line color. Either ANSI style function (see ANSI styles), color name passed make_ansi_style(). line_col, background_col Either color name (used make_ansi_style()), style function (see ANSI styles), color line background. width Width rule. Defaults width option, see base::options().","code":""},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a rule with one or two text labels — rule","text":"Character scalar, rule.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"simple-rule","dir":"Reference","previous_headings":"","what":"Simple rule","title":"Make a rule with one or two text labels — rule","text":"","code":"rule() #> ──────────────────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"line-styles","dir":"Reference","previous_headings":"","what":"Line styles","title":"Make a rule with one or two text labels — rule","text":"strings line argument interpreted specially: \"single\": (1), single line, \"double\": (2), double line, \"bar1\", \"bar2\", \"bar3\", etc., \"bar8\" uses varying height bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"double-rule","dir":"Reference","previous_headings":"","what":"Double rule","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(line = 2) #> ══════════════════════════════════════════════════════════════════════"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"bars","dir":"Reference","previous_headings":"","what":"Bars","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(line = \"bar2\") rule(line = \"bar5\") #> ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ #> ▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"custom-lines","dir":"Reference","previous_headings":"","what":"Custom lines","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = \"TITLE\", line = \"~\") #> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TITLE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rule(center = \"TITLE\", line = col_blue(\"~-\")) #> ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- TITLE ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ rule(center = bg_red(\" \", symbol$star, \"TITLE\", symbol$star, \" \"), line = \"\\u2582\", line_col = \"orange\") #> ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ ★TITLE★ ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"left-label","dir":"Reference","previous_headings":"","what":"Left label","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(left = \"Results\") #> ── Results ───────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"centered-label","dir":"Reference","previous_headings":"","what":"Centered label","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = \" * RESULTS * \") #> ──────────────────────────── * RESULTS * ───────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"colored-labels","dir":"Reference","previous_headings":"","what":"Colored labels","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = col_red(\" * RESULTS * \")) #> ──────────────────────────── * RESULTS * ───────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"colored-line","dir":"Reference","previous_headings":"","what":"Colored line","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = col_red(\" * RESULTS * \"), line_col = \"red\") #> ──────────────────────────── * RESULTS * ───────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":null,"dir":"Reference","previous_headings":"","what":"Print the helpful ruler to the screen — ruler","title":"Print the helpful ruler to the screen — ruler","text":"Print helpful ruler screen","code":""},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print the helpful ruler to the screen — ruler","text":"","code":"ruler(width = console_width())"},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print the helpful ruler to the screen — ruler","text":"width Ruler width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print the helpful ruler to the screen — ruler","text":"","code":"ruler() #> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7---- #> 12345678901234567890123456789012345678901234567890123456789012345678901234"},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":null,"dir":"Reference","previous_headings":"","what":"A simple CLI theme — simple_theme","title":"A simple CLI theme — simple_theme","text":"use theme, can set cli.theme option. Note addition builtin theme, still effect.","code":""},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A simple CLI theme — simple_theme","text":"","code":"simple_theme(dark = getOption(\"cli.theme_dark\", \"auto\"))"},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A simple CLI theme — simple_theme","text":"dark Whether theme optimized dark background. \"auto\", cli try detect . Detection usually works recent RStudio versions, iTerm macOS, platforms.","code":""},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A simple CLI theme — simple_theme","text":"CLI apps started use default theme. can also use temporarily, div element:","code":"options(cli.theme = cli::simple_theme()) cli_div(theme = cli::simple_theme())"},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"showcase","dir":"Reference","previous_headings":"","what":"Showcase","title":"A simple CLI theme — simple_theme","text":"","code":"show <- cli_div(theme = cli::simple_theme()) cli_h1(\"Heading 1\") cli_h2(\"Heading 2\") cli_h3(\"Heading 3\") cli_par() cli_alert_danger(\"Danger alert\") cli_alert_warning(\"Warning alert\") cli_alert_info(\"Info alert\") cli_alert_success(\"Success alert\") cli_alert(\"Alert for starting a process or computation\", class = \"alert-start\") cli_end() cli_text(\"Packages and versions: {.pkg cli} {.version 1.0.0}.\") cli_text(\"Time intervals: {.timestamp 3.4s}\") cli_text(\"{.emph Emphasis} and {.strong strong emphasis}\") cli_text(\"This is a piece of code: {.code sum(x) / length(x)}\") cli_text(\"Function names: {.fn cli::simple_theme}\") cli_text(\"Files: {.file /usr/bin/env}\") cli_text(\"URLs: {.url https://r-project.org}\") cli_h2(\"Longer code chunk\") cli_par(class = \"code R\") cli_verbatim( '# window functions are useful for grouped mutates', 'mtcars %>%', ' group_by(cyl) %>%', ' mutate(rank = min_rank(desc(mpg)))') cli_end(show) #> #> ── Heading 1 ───────────────────────────────────────────────────────── #> #> ─ Heading 2 ── #> #> Heading 3 #> ✖ Danger alert #> ! Warning alert #> ℹ Info alert #> ✔ Success alert #> → Alert for starting a process or computation #> #> Packages and versions: cli 1.0.0. #> Time intervals: [3.4s] #> Emphasis and strong emphasis #> This is a piece of code: `sum(x) / length(x)` #> Function names: `cli::simple_theme()`() #> Files: /usr/bin/env #> URLs: #> #> ─ Longer code chunk ── #> # window functions are useful for grouped mutates #> mtcars %>% #> group_by(cyl) %>% #> mutate(rank = min_rank(desc(mpg))) #>"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a sparkline bar graph with unicode block characters — spark_bar","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"Rendered using block elements. common fixed width fonts rendered wider regular characters means suitable need precise alignment. might want avoid sparklines non-UTF-8 systems, look good. can use is_utf8_output() test support .","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"","code":"spark_bar(x)"},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"x numeric vector 0 1","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"NAs left :","code":"x <- seq(0, 1, length = 6) spark_bar(x) #> ▁▂▄▅▇█ x <- seq(0, 1, length = 6) spark_bar(sample(x)) #> ▅▁█▄▇▂ spark_bar(seq(0, 1, length = 8)) #> ▁▂▃▄▅▆▇█ spark_bar(c(0, NA, 0.5, NA, 1)) #> ▁ ▄ █"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a sparkline line graph with Braille characters. — spark_line","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"might want avoid sparklines non-UTF-8 systems, look good. can use is_utf8_output() test support .","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"","code":"spark_line(x)"},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"x numeric vector 0 1","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"","code":"x <- seq(0, 1, length = 10) spark_line(x) #> ⣀⡠⠔⠊⠉"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":null,"dir":"Reference","previous_headings":"","what":"Start, stop, query the default cli application — start_app","title":"Start, stop, query the default cli application — start_app","text":"start_app creates app, places top app stack.","code":""},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Start, stop, query the default cli application — start_app","text":"","code":"start_app( theme = getOption(\"cli.theme\"), output = c(\"auto\", \"message\", \"stdout\", \"stderr\"), .auto_close = TRUE, .envir = parent.frame() ) stop_app(app = NULL) default_app()"},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Start, stop, query the default cli application — start_app","text":"theme Theme use. output print output. .auto_close Whether stop app, calling frame destroyed. .envir environment use, instead calling frame, trigger stop app. app App stop. NULL, current default app stopped. Otherwise find supplied app app stack, remote , together apps .","code":""},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Start, stop, query the default cli application — start_app","text":"start_app returns new app, default_app returns default app. stop_app return anything.","code":""},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Start, stop, query the default cli application — start_app","text":"stop_app removes top app, multiple apps app stack. default_app returns default app, one top stack.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":null,"dir":"Reference","previous_headings":"","what":"Terminal Hyperlinks — style_hyperlink","title":"Terminal Hyperlinks — style_hyperlink","text":"ansi_hyperlink() creates ANSI hyperlink.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Terminal Hyperlinks — style_hyperlink","text":"","code":"style_hyperlink(text, url, params = NULL) ansi_has_hyperlink_support() ansi_hyperlink_types()"},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Terminal Hyperlinks — style_hyperlink","text":"text Text show. text url recycled match length, via paste0() call. url URL link . params named character vector additional parameters, NULL.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Terminal Hyperlinks — style_hyperlink","text":"Styled cli_ansi_string style_hyperlink(). Logical scalar ansi_has_hyperlink_support().","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Terminal Hyperlinks — style_hyperlink","text":"function currently experimental. particular, many ansi_*() functions support properly. ansi_has_hyperlink_support() checks current stdout() supports hyperlinks. See also https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. ansi_hyperlink_types() checks current stdout() supports various types hyperlinks. returns list entries href, run, help vignettes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Terminal Hyperlinks — style_hyperlink","text":"","code":"cat(\"This is an\", style_hyperlink(\"R\", \"https://r-project.org\"), \"link.\\n\") #> This is an R link. ansi_has_hyperlink_support() #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Various handy symbols to use in a command line UI — symbol","title":"Various handy symbols to use in a command line UI — symbol","text":"Various handy symbols use command line UI","code":""},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Various handy symbols to use in a command line UI — symbol","text":"","code":"symbol list_symbols()"},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Various handy symbols to use in a command line UI — symbol","text":"named list, see names(symbol) sign names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Various handy symbols to use in a command line UI — symbol","text":"Windows fallback less fancy symbols. list_symbols() prints table symbols screen.","code":""},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Various handy symbols to use in a command line UI — symbol","text":"","code":"cat(symbol$tick, \" SUCCESS\\n\", symbol$cross, \" FAILURE\\n\", sep = \"\") #> ✔ SUCCESS #> ✖ FAILURE ## All symbols cat(paste(format(names(symbol), width = 20), unlist(symbol)), sep = \"\\n\") #> tick ✔ #> cross ✖ #> star ★ #> square ▇ #> square_small ◻ #> square_small_filled ◼ #> circle ◯ #> circle_filled ◉ #> circle_dotted ◌ #> circle_double ◎ #> circle_circle ⓞ #> circle_cross ⓧ #> circle_pipe Ⓘ #> circle_question_mark ?⃝ #> bullet • #> dot ․ #> line ─ #> double_line ═ #> ellipsis … #> continue … #> pointer ❯ #> info ℹ #> warning ⚠ #> menu ☰ #> smiley ☺ #> mustache ෴ #> heart ♥ #> arrow_up ↑ #> arrow_down ↓ #> arrow_left ← #> arrow_right → #> radio_on ◉ #> radio_off ◯ #> checkbox_on ☒ #> checkbox_off ☐ #> checkbox_circle_on ⓧ #> checkbox_circle_off Ⓘ #> fancy_question_mark ❓ #> neq ≠ #> geq ≥ #> leq ≤ #> times × #> upper_block_1 ▔ #> upper_block_4 ▀ #> lower_block_1 ▁ #> lower_block_2 ▂ #> lower_block_3 ▃ #> lower_block_4 ▄ #> lower_block_5 ▅ #> lower_block_6 ▆ #> lower_block_7 ▇ #> lower_block_8 █ #> full_block █ #> sup_0 ⁰ #> sup_1 ¹ #> sup_2 ² #> sup_3 ³ #> sup_4 ⁴ #> sup_5 ⁵ #> sup_6 ⁶ #> sup_7 ⁷ #> sup_8 ⁸ #> sup_9 ⁹ #> sup_minus ⁻ #> sup_plus ⁺ #> play ▶ #> stop ■ #> record ● #> figure_dash ‒ #> en_dash – #> em_dash — #> dquote_left “ #> dquote_right ” #> squote_left ‘ #> squote_right ’"},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":null,"dir":"Reference","previous_headings":"","what":"Test cli output with testthat — test_that_cli","title":"Test cli output with testthat — test_that_cli","text":"Use function testthat test files, test cli output. requires testthat edition 3, works best snapshot tests.","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test cli output with testthat — test_that_cli","text":"","code":"test_that_cli( desc, code, configs = c(\"plain\", \"ansi\", \"unicode\", \"fancy\"), links = NULL )"},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test cli output with testthat — test_that_cli","text":"desc Test description, passed testthat::test_that(), appending name cli configuration . code Test code, modified set cli config, passed testthat::test_that() configs cli configurations test code . default NULL, includes possible configurations. can also character vector, restrict tests configurations . See available configurations . links Whether run code various hyperlinks allowed. NULL hyperlinks turned . Otherwise can character vector possible hyperlink configurations: \"\": turn hyperlinks, \"none\": turn hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Test cli output with testthat — test_that_cli","text":"test_that_cli() calls testthat::test_that() multiple times, different cli configurations. makes simple test cli output without ANSI colors, without Unicode characters. Currently available configurations: plain: ANSI colors, ASCII characters . ansi: ANSI colors, ASCII characters . unicode: ANSI colors, Unicode characters. fancy; ANSI colors, Unicode characters. See examples cli's tests, e.g. https://github.com/r-lib/cli/tree/main/tests/testthat corresponding snapshots https://github.com/r-lib/cli/tree/main/tests/testthat/_snaps","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"important-note-regarding-windows","dir":"Reference","previous_headings":"","what":"Important note regarding Windows","title":"Test cli output with testthat — test_that_cli","text":"base R's limitation record Unicode characters Windows, suggest record snapshots Unix, restrict tests ASCII configurations. Unicode tests Windows automatically skipped testthat currently.","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Test cli output with testthat — test_that_cli","text":"","code":"# testthat cannot record or compare snapshots when you run these # examples interactively, so you might want to copy them into a test # file # Default configurations cli::test_that_cli(\"success\", { testthat::local_edition(3) testthat::expect_snapshot({ cli::cli_alert_success(\"wow\") }) }) #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> v wow #> -- Skip: success [plain] ------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> v wow #> -- Skip: success [ansi] -------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> ✔ wow #> -- Skip: success [unicode] ----------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> ✔ wow #> -- Skip: success [fancy] ------------------------------------------------------- #> Reason: empty test #> #> [[1]] #> [1] FALSE #> #> [[2]] #> [1] FALSE #> #> [[3]] #> [1] FALSE #> #> [[4]] #> [1] FALSE #> #> [[5]] #> NULL #> #> [[6]] #> NULL #> #> [[7]] #> NULL #> #> [[8]] #> NULL #> #> [[9]] #> NULL #> #> [[10]] #> NULL #> #> [[11]] #> NULL #> #> [[12]] #> NULL #> # Only use two configurations, because this output does not have colors cli::test_that_cli(configs = c(\"plain\", \"unicode\"), \"cat_bullet\", { testthat::local_edition(3) testthat::expect_snapshot({ cli::cat_bullet(letters[1:5]) }) }) #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cat_bullet(letters[1:5]) #> Output #> * a #> * b #> * c #> * d #> * e #> -- Skip: cat_bullet [plain] ---------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cat_bullet(letters[1:5]) #> Output #> • a #> • b #> • c #> • d #> • e #> -- Skip: cat_bullet [unicode] -------------------------------------------------- #> Reason: empty test #> #> [[1]] #> [1] FALSE #> #> [[2]] #> NULL #> #> [[3]] #> [1] FALSE #> #> [[4]] #> NULL #> #> [[5]] #> NULL #> #> [[6]] #> NULL #> #> [[7]] #> NULL #> #> [[8]] #> NULL #> #> [[9]] #> NULL #> #> [[10]] #> NULL #> #> [[11]] #> NULL #> #> [[12]] #> NULL #> # You often need to evaluate all cli calls of a test case in the same # environment. Use `local()` to do that: cli::test_that_cli(\"theming\", { testthat::local_edition(3) testthat::expect_snapshot(local({ cli::cli_div(theme = list(\".alert\" = list(before = \"!!! \"))) cli::cli_alert(\"wow\") })) }) #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [plain] ------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [ansi] -------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [unicode] ----------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [fancy] ------------------------------------------------------- #> Reason: empty test #> #> [[1]] #> [1] FALSE #> #> [[2]] #> [1] FALSE #> #> [[3]] #> [1] FALSE #> #> [[4]] #> [1] FALSE #> #> [[5]] #> NULL #> #> [[6]] #> NULL #> #> [[7]] #> NULL #> #> [[8]] #> NULL #> #> [[9]] #> NULL #> #> [[10]] #> NULL #> #> [[11]] #> NULL #> #> [[12]] #> NULL #>"},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":null,"dir":"Reference","previous_headings":"","what":"About cli themes — themes","title":"About cli themes — themes","text":"CLI elements can styled via CSS-like language selectors properties. small subset CSS3 supported, lot visual properties implemented terminal, ignored well.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"adding-themes","dir":"Reference","previous_headings":"","what":"Adding themes","title":"About cli themes — themes","text":"style element calculated themes four sources. form stack, themes top stack take precedence, themes bottom. cli package built-theme. always active. See builtin_theme(). app object created via start_app(), caller can specify theme, added theme stack. theme specified start_app(), content cli.theme option used. Removed corresponding app stops. user may specify theme cli.user_theme option. added stack app's theme (step 2.), can override settings. Removed app added stops. Themes specified explicitly cli_div() elements. removed theme stack, corresponding cli_div() elements closed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"writing-themes","dir":"Reference","previous_headings":"","what":"Writing themes","title":"About cli themes — themes","text":"theme named list lists. name entry CSS selector. subset CSS supported: Type selectors, e.g. input selects elements. Class selectors, e.g. .index selects element class \"index\". ID selector. #toc match element ID \"toc\". descendant combinator, .e. space, selects nodes descendants first element. E.g. div span match elements inside
      element. content theme list entry another named list, names CSS properties, e.g. color, font-weight margin-left, list entries define values properties. See builtin_theme() simple_theme() examples.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"formatter-callbacks","dir":"Reference","previous_headings":"","what":"Formatter callbacks","title":"About cli themes — themes","text":"flexibility, themes may also define formatter functions, property name fmt. called styles applied element. called elements produce output, .e. container elements.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"supported-properties","dir":"Reference","previous_headings":"","what":"Supported properties","title":"About cli themes — themes","text":"Right now limited set properties supported. include left, right, top bottom margins, background foreground colors, bold italic fonts, underlined text. properties supported insert text content element. current list properties: : string literal insert element. can also function returns string literal. Supported inline elements, list items, alerts rules. background-color: R color name, HTML hexadecimal color. can applied elements (inline elements, rules, text, etc.), background containers colored properly currently. : string literal insert element. can also function returns string literal. Supported inline elements, list items, alerts rules. class-map: value can named list, specifies R (S3) class names mapped cli class names. E.g. list(fs_path = \"file\") specifies fs_path objects (fs package) always print .file objects cli. color: Text color, R color name HTML hexadecimal color. can applied elements printed. collapse: Specifies collapse vector, applying styling. character string, used separator. function, called, vector argument. digits: Number digits decimal point numeric inline element class .val. fmt: Generic formatter function takes input text returns formatted text. Can applied elements. colors use, input text provided fmt already includes ANSI sequences. font-style: \"italic\" text printed cursive. font-weight: \"bold\", text printed boldface. line-type: Line type cli_rule(). list-style-type: String literal functions returns string literal, used list item marker un-ordered lists. margin-bottom, margin-left, margin-right, margin-top: Margins. padding-left, padding-right: currently used way margins, might change later. start: Integer number, first element ordered list. string-quote: Quoting character inline elements class .val. text-decoration: \"underline\", underlined text created. text-exdent: Amount indentation second line wrapped text. transform: function call glue substitutions, collapsing . Note transform applied prior implementing color via ANSI sequences. vec-last: last separator collapsing vectors. vec-sep: separator use collapsing vectors. vec-sep2: separator use two elements collapsing vectors. set, vec-sep used well. vec-trunc: Vectors longer truncated. Defaults 100. vec-trunc-style: Select two ways collapsing vectors: \"-ends\" current default shows beginning end vector. \"head\" shows beginning vector. properties might added later. think property applied properly element, please open issue cli issue tracker.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"examples","dir":"Reference","previous_headings":"","what":"Examples","title":"About cli themes — themes","text":"Color headings, active paragraphs 'output' class: Create custom alert type:","code":"list( \"par.output h1\" = list(\"background-color\" = \"red\", color = \"#e0e0e0\"), \"par.output h2\" = list(\"background-color\" = \"orange\", color = \"#e0e0e0\"), \"par.output h3\" = list(\"background-color\" = \"blue\", color = \"#e0e0e0\") ) list( \".alert-start\" = list(before = symbol$play), \".alert-stop\" = list(before = symbol$stop) )"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a tree — tree","title":"Draw a tree — tree","text":"Draw tree using box drawing characters. Unicode characters used available. (Set cli.unicode option auto-detection fails.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a tree — tree","text":"","code":"tree( data, root = data[[1]][[1]], style = NULL, width = console_width(), trim = FALSE )"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a tree — tree","text":"data Data frame contains tree structure. first column id, second column list column, contains ids child nodes. optional third column may contain text print annotate node. root name root node. style Optional box style list. width Maximum width output. Defaults width option, see base::options(). trim Whether avoid traversing nodes multiple times. TRUE data trimmed column, used printing repeated nodes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw a tree — tree","text":"Character vector, lines tree drawing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a tree — tree","text":"node might appear multiple times tree, might appear .","code":"data <- data.frame( stringsAsFactors = FALSE, package = c(\"processx\", \"backports\", \"assertthat\", \"Matrix\", \"magrittr\", \"rprojroot\", \"clisymbols\", \"prettyunits\", \"withr\", \"desc\", \"igraph\", \"R6\", \"crayon\", \"debugme\", \"digest\", \"irlba\", \"rcmdcheck\", \"callr\", \"pkgconfig\", \"lattice\"), dependencies = I(list( c(\"assertthat\", \"crayon\", \"debugme\", \"R6\"), character(0), character(0), \"lattice\", character(0), \"backports\", character(0), c(\"magrittr\", \"assertthat\"), character(0), c(\"assertthat\", \"R6\", \"crayon\", \"rprojroot\"), c(\"irlba\", \"magrittr\", \"Matrix\", \"pkgconfig\"), character(0), character(0), \"crayon\", character(0), \"Matrix\", c(\"callr\", \"clisymbols\", \"crayon\", \"desc\", \"digest\", \"prettyunits\", \"R6\", \"rprojroot\", \"withr\"), c(\"processx\", \"R6\"), character(0), character(0) )) ) tree(data) #> processx #> ├─assertthat #> ├─crayon #> ├─debugme #> │ └─crayon #> └─R6 tree(data, root = \"rcmdcheck\") #> rcmdcheck #> ├─callr #> │ ├─processx #> │ │ ├─assertthat #> │ │ ├─crayon #> │ │ ├─debugme #> │ │ │ └─crayon #> │ │ └─R6 #> │ └─R6 #> ├─clisymbols #> ├─crayon #> ├─desc #> │ ├─assertthat #> │ ├─R6 #> │ ├─crayon #> │ └─rprojroot #> │ └─backports #> ├─digest #> ├─prettyunits #> │ ├─magrittr #> │ └─assertthat #> ├─R6 #> ├─rprojroot #> │ └─backports #> └─withr"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"colored-nodes","dir":"Reference","previous_headings":"","what":"Colored nodes","title":"Draw a tree — tree","text":"","code":"data$label <- paste(data$package, style_dim(paste0(\"(\", c(\"2.0.0.1\", \"1.1.1\", \"0.2.0\", \"1.2-11\", \"1.5\", \"1.2\", \"1.2.0\", \"1.0.2\", \"2.0.0\", \"1.1.1.9000\", \"1.1.2\", \"2.2.2\", \"1.3.4\", \"1.0.2\", \"0.6.12\", \"2.2.1\", \"1.2.1.9002\", \"1.0.0.9000\", \"2.0.1\", \"0.20-35\"), \")\")) ) roots <- ! data$package %in% unlist(data$dependencies) data$label[roots] <- col_cyan(style_italic(data$label[roots])) tree(data, root = \"rcmdcheck\") #> rcmdcheck (1.2.1.9002) #> ├─callr (1.0.0.9000) #> │ ├─processx (2.0.0.1) #> │ │ ├─assertthat (0.2.0) #> │ │ ├─crayon (1.3.4) #> │ │ ├─debugme (1.0.2) #> │ │ │ └─crayon (1.3.4) #> │ │ └─R6 (2.2.2) #> │ └─R6 (2.2.2) #> ├─clisymbols (1.2.0) #> ├─crayon (1.3.4) #> ├─desc (1.1.1.9000) #> │ ├─assertthat (0.2.0) #> │ ├─R6 (2.2.2) #> │ ├─crayon (1.3.4) #> │ └─rprojroot (1.2) #> │ └─backports (1.1.1) #> ├─digest (0.6.12) #> ├─prettyunits (1.0.2) #> │ ├─magrittr (1.5) #> │ └─assertthat (0.2.0) #> ├─R6 (2.2.2) #> ├─rprojroot (1.2) #> │ └─backports (1.1.1) #> └─withr (2.0.0)"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"trimming","dir":"Reference","previous_headings":"","what":"Trimming","title":"Draw a tree — tree","text":"","code":"pkgdeps <- list( \"dplyr@0.8.3\" = c(\"assertthat@0.2.1\", \"glue@1.3.1\", \"magrittr@1.5\", \"R6@2.4.0\", \"Rcpp@1.0.2\", \"rlang@0.4.0\", \"tibble@2.1.3\", \"tidyselect@0.2.5\"), \"assertthat@0.2.1\" = character(), \"glue@1.3.1\" = character(), \"magrittr@1.5\" = character(), \"pkgconfig@2.0.3\" = character(), \"R6@2.4.0\" = character(), \"Rcpp@1.0.2\" = character(), \"rlang@0.4.0\" = character(), \"tibble@2.1.3\" = c(\"cli@1.1.0\", \"crayon@1.3.4\", \"fansi@0.4.0\", \"pillar@1.4.2\", \"pkgconfig@2.0.3\", \"rlang@0.4.0\"), \"cli@1.1.0\" = c(\"assertthat@0.2.1\", \"crayon@1.3.4\"), \"crayon@1.3.4\" = character(), \"fansi@0.4.0\" = character(), \"pillar@1.4.2\" = c(\"cli@1.1.0\", \"crayon@1.3.4\", \"fansi@0.4.0\", \"rlang@0.4.0\", \"utf8@1.1.4\", \"vctrs@0.2.0\"), \"utf8@1.1.4\" = character(), \"vctrs@0.2.0\" = c(\"backports@1.1.5\", \"ellipsis@0.3.0\", \"digest@0.6.21\", \"glue@1.3.1\", \"rlang@0.4.0\", \"zeallot@0.1.0\"), \"backports@1.1.5\" = character(), \"ellipsis@0.3.0\" = c(\"rlang@0.4.0\"), \"digest@0.6.21\" = character(), \"glue@1.3.1\" = character(), \"zeallot@0.1.0\" = character(), \"tidyselect@0.2.5\" = c(\"glue@1.3.1\", \"purrr@1.3.1\", \"rlang@0.4.0\", \"Rcpp@1.0.2\"), \"purrr@0.3.3\" = c(\"magrittr@1.5\", \"rlang@0.4.0\") ) pkgs <- data.frame( stringsAsFactors = FALSE, name = names(pkgdeps), deps = I(unname(pkgdeps)) ) tree(pkgs, trim = TRUE) #> dplyr@0.8.3 #> ├─assertthat@0.2.1 #> ├─glue@1.3.1 #> ├─magrittr@1.5 #> ├─R6@2.4.0 #> ├─Rcpp@1.0.2 #> ├─rlang@0.4.0 #> ├─tibble@2.1.3 #> │ ├─cli@1.1.0 #> │ │ ├─assertthat@0.2.1 #> │ │ └─crayon@1.3.4 #> │ ├─crayon@1.3.4 #> │ ├─fansi@0.4.0 #> │ ├─pillar@1.4.2 #> │ │ ├─cli@1.1.0 #> │ │ ├─crayon@1.3.4 #> │ │ ├─fansi@0.4.0 #> │ │ ├─rlang@0.4.0 #> │ │ ├─utf8@1.1.4 #> │ │ └─vctrs@0.2.0 #> │ │ ├─backports@1.1.5 #> │ │ ├─ellipsis@0.3.0 #> │ │ │ └─rlang@0.4.0 #> │ │ ├─digest@0.6.21 #> │ │ ├─glue@1.3.1 #> │ │ ├─rlang@0.4.0 #> │ │ └─zeallot@0.1.0 #> │ ├─pkgconfig@2.0.3 #> │ └─rlang@0.4.0 #> └─tidyselect@0.2.5 #> ├─glue@1.3.1 #> ├─rlang@0.4.0 #> └─Rcpp@1.0.2 # Mark the trimmed nodes pkgs$label <- pkgs$name pkgs$trimmed <- paste(pkgs$name, \" (trimmed)\") tree(pkgs, trim = TRUE) #> dplyr@0.8.3 #> ├─assertthat@0.2.1 #> ├─glue@1.3.1 #> ├─magrittr@1.5 #> ├─R6@2.4.0 #> ├─Rcpp@1.0.2 #> ├─rlang@0.4.0 #> ├─tibble@2.1.3 #> │ ├─cli@1.1.0 #> │ │ ├─assertthat@0.2.1 (trimmed) #> │ │ └─crayon@1.3.4 #> │ ├─crayon@1.3.4 (trimmed) #> │ ├─fansi@0.4.0 #> │ ├─pillar@1.4.2 #> │ │ ├─cli@1.1.0 (trimmed) #> │ │ ├─crayon@1.3.4 (trimmed) #> │ │ ├─fansi@0.4.0 (trimmed) #> │ │ ├─rlang@0.4.0 (trimmed) #> │ │ ├─utf8@1.1.4 #> │ │ └─vctrs@0.2.0 #> │ │ ├─backports@1.1.5 #> │ │ ├─ellipsis@0.3.0 #> │ │ │ └─rlang@0.4.0 (trimmed) #> │ │ ├─digest@0.6.21 #> │ │ ├─glue@1.3.1 (trimmed) #> │ │ ├─rlang@0.4.0 (trimmed) #> │ │ └─zeallot@0.1.0 #> │ ├─pkgconfig@2.0.3 #> │ └─rlang@0.4.0 (trimmed) #> └─tidyselect@0.2.5 #> ├─glue@1.3.1 (trimmed) #> ├─rlang@0.4.0 (trimmed) #> └─Rcpp@1.0.2 (trimmed)"},{"path":"https://cli.r-lib.org/dev/reference/unicode-width-workaround.html","id":null,"dir":"Reference","previous_headings":"","what":"Working around the bad Unicode character widths — unicode-width-workaround","title":"Working around the bad Unicode character widths — unicode-width-workaround","text":"R 3.6.2 also coming 3.6.3 4.0.0 versions use Unicode 8 standard calculate display width Unicode characters. Unfortunately widths emojis incorrect standard, width 1 reported instead correct 2 value.","code":""},{"path":"https://cli.r-lib.org/dev/reference/unicode-width-workaround.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Working around the bad Unicode character widths — unicode-width-workaround","text":"cli implements workaround . package contains table contains Unicode ranges wide characters (display width 2). first use one workaround wrappers (ansi_nchar(), etc.) check current version R thinks width characters, create regex matches ones R wrong (re_bad_char_width). use regex duplicate problematic characters input string wrapper function, calling real string manipulation function (nchar(), strwrap()) etc. end undo duplication return result. workaround fine nchar() strwrap(), consequently ansi_align() ansi_strtrim() well. rest ansi_*() functions work characters, deal character width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":null,"dir":"Reference","previous_headings":"","what":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"Break UTF-8 character vector grapheme clusters","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"","code":"utf8_graphemes(x)"},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"x Character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"List characters vectors, grapheme clusters input string.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"","code":"# Five grapheme clusters str <- paste0( \"\\U0001f477\\U0001f3ff\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3ff\", \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\U0001f3ff\") cat(str, \"\\n\") #> 👷🏿‍♀️👷🏿👷‍♀️👷🏻👷🏿 chrs <- utf8_graphemes(str)"},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":null,"dir":"Reference","previous_headings":"","what":"Count the number of characters in a character vector — utf8_nchar","title":"Count the number of characters in a character vector — utf8_nchar","text":"default counts Unicode grapheme clusters, instead code points.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count the number of characters in a character vector — utf8_nchar","text":"","code":"utf8_nchar(x, type = c(\"chars\", \"bytes\", \"width\", \"graphemes\", \"codepoints\"))"},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count the number of characters in a character vector — utf8_nchar","text":"x Character vector, converted UTF-8. type Whether count graphemes (characters), code points, bytes, calculate display width string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count the number of characters in a character vector — utf8_nchar","text":"Numeric vector, length strings character vector.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count the number of characters in a character vector — utf8_nchar","text":"","code":"# Grapheme example, emoji with combining characters. This is a single # grapheme, consisting of five Unicode code points: # * `\\U0001f477` is the construction worker emoji # * `\\U0001f3fb` is emoji modifier that changes the skin color # * `\\u200d` is the zero width joiner # * `\\u2640` is the female sign # * `\\ufe0f` is variation selector 16, requesting an emoji style glyph emo <- \"\\U0001f477\\U0001f3fb\\u200d\\u2640\\ufe0f\" cat(emo) #> 👷🏻‍♀️ utf8_nchar(emo, \"chars\") # = graphemes #> [1] 1 utf8_nchar(emo, \"bytes\") #> [1] 17 utf8_nchar(emo, \"width\") #> [1] 2 utf8_nchar(emo, \"codepoints\") #> [1] 5 # For comparision, the output for width depends on the R version used: nchar(emo, \"chars\") #> [1] 5 nchar(emo, \"bytes\") #> [1] 17 nchar(emo, \"width\") #> [1] 5"},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":null,"dir":"Reference","previous_headings":"","what":"Substring of an UTF-8 string — utf8_substr","title":"Substring of an UTF-8 string — utf8_substr","text":"function uses grapheme clusters instead Unicode code points UTF-8 strings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Substring of an UTF-8 string — utf8_substr","text":"","code":"utf8_substr(x, start, stop)"},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Substring of an UTF-8 string — utf8_substr","text":"x Character vector. start Starting index indices, recycled match length x. stop Ending index indices, recycled match length x.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Substring of an UTF-8 string — utf8_substr","text":"Character vector length x, containing requested substrings.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Substring of an UTF-8 string — utf8_substr","text":"","code":"# Five grapheme clusters, select the middle three str <- paste0( \"\\U0001f477\\U0001f3ff\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3ff\", \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\U0001f3ff\") cat(str) #> 👷🏿‍♀️👷🏿👷‍♀️👷🏻👷🏿 str24 <- utf8_substr(str, 2, 4) cat(str24) #> 👷🏿👷‍♀️👷🏻"},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"utility function calculates state VT-5xx screen certain set output.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"","code":"vt_output(output, width = 80L, height = 25L)"},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"output Character vector raw vector. Character vectors collapsed (without separater), converted raw vector using base::charToRaw(). width Terminal width. height Terminal height.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"Data frame columns lineno, segmentno, segment, attributes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"Currently supports: configurable terminal width height ASCII printable characters. \\n, \\r. ANSI SGR colors, 8 color mode, 256 color mode true color mode. ANSI SGR features: bold, italic, underline, strikethrough, blink, inverse. currently supports features, mode notably: ANSI control sequences features. control sequences silently ignored. Wide Unicode characters. width taken account correctly. Unicode graphemes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"function experimental, virtual temrinal API likely change future versions cli.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-development-version","dir":"Changelog","previous_headings":"","what":"cli (development version)","title":"cli (development version)","text":"cli_progress_bar() now accepts total = Inf -Inf mimics behavior total NA. num_ansi_colors() now warn Emacs INSIDE_EMACS environment variable proper version number (@rundel, #689). ansi_collapse() inline collapsing now uses last separator (without serial comma) two-element vectors sep2 given (@rundel, #681). ansi_collapse() now correct length-1 vectors style “head” width specified (@rundel, #590).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-363","dir":"Changelog","previous_headings":"","what":"cli 3.6.3","title":"cli 3.6.3","text":"CRAN release: 2024-06-21 cli now builds ARM Windows. “Solarized Dark” now default syntax highlighting theme terminals. {.obj_type_friendly} inline style now shows first class name (#669 @olivroy). Syntax highlighting now fail RStudio rstudioapi package installed (#697).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-362","dir":"Changelog","previous_headings":"","what":"cli 3.6.2","title":"cli 3.6.2","text":"CRAN release: 2023-12-11 ansi_collapse(x, trunc = 1, style = \"head\") now indeed shows one element length(x) == 2, documented (@salim-b, #572). ansi_collapse() gains sep2 argument specify seperate separator length-two inputs. defaults \" \" , conjunction defaults, produces collapsed string fully adheres serial comma rules. (@salim-b, #569) ansi_string() now exported function (@multimeric, #573).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-361","dir":"Changelog","previous_headings":"","what":"cli 3.6.1","title":"cli 3.6.1","text":"CRAN release: 2023-03-23 ANSI hyperlinks now turned RStudio render plane (#581).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-360","dir":"Changelog","previous_headings":"","what":"cli 3.6.0","title":"cli 3.6.0","text":"CRAN release: 2023-01-09 progressr progress handler now reports progress correctly (@HenrikBengtsson, #558). New hash_*sha1() functions calculate SHA-1 hash strings, objects, files. cli now shows progress bars one second default, less half way point. (two seconds, unconditionally, .) See cli.progress_show_after option ?cli-config details (#542). format_inline() now new argument keep_whitespace, keeps whitespace, including newline form feed characters default.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-350","dir":"Changelog","previous_headings":"","what":"cli 3.5.0","title":"cli 3.5.0","text":"CRAN release: 2022-12-20 New keypress() function read single key press terminal. New function pretty_print_code() print function objects syntax highlighting R console. col_* bg_* functions handle zero-length input correctly (#532). New function ansi_collapse() collapse character vectors single string. ansi_strtrim() now handles edge cases better, ellipsis length zero, wider width. New hash_file_md5() function calculate MD5 hash one files.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-341","dir":"Changelog","previous_headings":"","what":"cli 3.4.1","title":"cli 3.4.1","text":"CRAN release: 2022-09-23 cli better error messages now. New format_inline() argument: collapse, collapse multi-line output, potentially \\f characters.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-340","dir":"Changelog","previous_headings":"","what":"cli 3.4.0","title":"cli 3.4.0","text":"CRAN release: 2022-09-08 New experimental styles create ANSI hyperlinks RStudio terminals support . See ?cli::links details (#513). Expressions start end {} substitution now styled correctly. E.g. {.code {var1} + {var2}} (#517). New {.obj_type_friendly} inline style format type R object user friendly way (#463). Improved vector collapsing behavior. cli now shows beginning end collapsed vector, default (#419). Nested cli() calls work now (#497). Return values now work within cli() calls (#496). Style attributes underscores new names dashes instead: vec_sep, vec_last, vec_trunc, string-quote. old names still work, new ones take precedence (#483). cli now crash end R session Arm Windows (#494; @kevinushey) Vectors truncated 20 elements now default, instead 100 (#430). 20 new spinners awesome cli-spinners package, @HenrikBengtsson #469. Run demo , need UTF-8 emoji support: cli exit handlers now compatible withr package (#437). cli functions now keep trailing \\f characters newlines. also keep multiple consecutive \\f multiple newlinees (#491). {} substitutions within inline styles now formatted correctly. E.g. {.code download({url})} add backticks url, {.val pre-{x}-post} format whole value instead x. (#422, #474). cli now replaces newline characters within {.class ... } inline styles spaces. cli.warn_inline_newlines option set TRUE, also throws warning. (#417). code_highlight now falls back default theme (instead theme) unknown RStudio themes (#482, @rossellhayes). cli_abort() now supplies .frame abort(). fixes issue .internal = TRUE argument (r-lib/rlang#1386). cli now better job detecting RStudio build pane, job pane render pane, capabilities w.r.t. ANSI colors hyperlinks. Note requires daily build RStudio (#465). New functions ANSI strings: ansi_grep(), ansi_grepl(), ansi_nzchar(). work like corresponding base R functions, handle ANSI markup. style_hyperlink() (really) longer breaks env variable VTE_VERSION form \\d{4}, .e., 4 consecutive numbers (#441, @michaelchirico) cli_dl() corresponding cli_li() can now style labels. behavior cli’s inline styling expressions now predictable. cli try evaluate styled string R expression . E.g. meaning \"{.emph +1}\" now always “+1”, style .emph, even .emph variable available .emph + 1 expression can evaluated. Functions apply bright background colors (e.g. bg_br_yellow()) now close . longer format text end function (#484, @rossellhayes).","code":"new <- c(\"dots13\", \"dots8Bit\", \"sand\", \"material\", \"weather\", \"christmas\", \"grenade\", \"point\", \"layer\", \"betaWave\", \"fingerDance\", \"fistBump\", \"soccerHeader\", \"mindblown\", \"speaker\", \"orangePulse\", \"bluePulse\", \"orangeBluePulse\", \"timeTravel\", \"aesthetic\", \"growVeriticalDotsLR\", \"growVeriticalDotsRL\", \"growVeriticalDotsLL\", \"growVeriticalDotsRR\") demo_spinners(new)"},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-330","dir":"Changelog","previous_headings":"","what":"cli 3.3.0","title":"cli 3.3.0","text":"CRAN release: 2022-04-25 style_hyperlink() longer breaks env variable VTE_VERSION form \\d{4}, .e., 4 consecutive numbers (#441, @michaelchirico) ansi_*() functions support ANSI hyperlinks (#444). Turning ANSI colors via cli.num_colors option R_CLI_NUM_COLORS NO_COLOR environment variable now also turns ANSI hyperlinks (#447). symbol now two variants: UTF-8 ASCII. special variants RStudio Windows RGui (#424).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-320","dir":"Changelog","previous_headings":"","what":"cli 3.2.0","title":"cli 3.2.0","text":"CRAN release: 2022-02-14","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"breaking-change-3-2-0","dir":"Changelog","previous_headings":"","what":"Breaking change","title":"cli 3.2.0","text":"cli_theme_dark option now known cli.theme_dark, consistent cli option names (#380).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"other-changes-3-2-0","dir":"Changelog","previous_headings":"","what":"Other changes","title":"cli 3.2.0","text":"preferred names S3 classes ansi_string, ansi_style, boxx, rule tree now cli_ prefix: cli_ansi_string, etc. help avoiding name conflicts packages eventually, now old names kept well, compatibility. cli_abort() updated work nicely rlang 1.0. default call backtrace soft-truncation set .envir (set immediate caller cli_abort() default). Line formatting now happens lazily display time via rlang::cnd_message() (called conditionMessage() method rlang errors). New hash_sha256() function calculate SHA-256 hashes. New hash_raw_*(), hash_obj_*() hash_file_*() functions calculate various hashes raw vectors, R objects files. can use new cli.default_num_colors option set default number ANSI colors, ANSI support otherwise detected. See details manual num_ansi_colors(). can set new ESS_BACKGROUND_MODE environment variable dark indicate dark mode. cli now handles quotes comment characters better semantion cli_*() functions perform glue string interpolation (#370).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-311","dir":"Changelog","previous_headings":"","what":"cli 3.1.1","title":"cli 3.1.1","text":"CRAN release: 2022-01-20 style_hyperlink() gains params= argument (#384).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-310","dir":"Changelog","previous_headings":"","what":"cli 3.1.0","title":"cli 3.1.0","text":"CRAN release: 2021-10-27","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"breaking-changes-3-1-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"cli 3.1.0","text":"C progress bar API now uses double instead int data type progress units (#335).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"new-features-3-1-0","dir":"Changelog","previous_headings":"","what":"New features","title":"cli 3.1.0","text":"Several improvements changes ansi_*() functions: ansi_*() functions now implemented C much faster (#316). handle NA values better. many functions now use UTF-8 graphemes default instead code points. E.g. ansi_nchar() counts graphemes, etc. convert input UTF-8 always return UTF-8 encoded strings. new function ansi_simplify() remove superfluous ANSI tags. new function ansi_html() convert ANSI-highlighted strings HTML. ansi_has_any() ansi_strip() now sgr csi arguments look SGR tags, CSI tags, . New functions handle UTF-8 encoded strings correctly: utf8_graphemes(), utf8_nchar(), utf8_substr(). Support palettes, including colorblind friendly palette. See ?ansi_palettes details. True color support: num_ansi_colors() now detects terminals 24 bit color support, make_ansi_style() uses exact RGB colors terminals (#208). new col_br_*() bg_br_() functions create bright versions eight base ANSI colors (#327). New function code_highlight() syntax highlight R code. supports several themes box, see code_theme_list() (#348). New functions hashing: hash_animal(), hash_emoji() hash_md5(). New diff_chr() diff_str() functions calculate difference character vectors letters strings.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"smaller-improvements-3-1-0","dir":"Changelog","previous_headings":"","what":"Smaller improvements","title":"cli 3.1.0","text":"Progress bars clear = FALSE now print last, completed, state properly. progress bar Shiny apps now handles output cli_progress_output(). Progress variables C format_done strings work correctly now (#337). cli_dl() now works empty description, gives better error invalid input (#347). rule() now works better labels ANSI markup. cli_spark objects now format() print() methods. cli_process_done() now error without process (#351). ANSI markup now supported RStudio jobs (#353). lack ANSI support now correctly detected active sink() (#366).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-301","dir":"Changelog","previous_headings":"","what":"cli 3.0.1","title":"cli 3.0.1","text":"CRAN release: 2021-07-17 ansi_strtrim() now correctly keeps NA values (#309). format_inline() now uses correct environment (@rundel, #314).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-300","dir":"Changelog","previous_headings":"","what":"cli 3.0.0","title":"cli 3.0.0","text":"CRAN release: 2021-06-30 New functions progress bars, please see new articles https://cli.r-lib.org/articles/ details. New cli_abort(), cli_warn() cli_inform() functions, throw errors cli pluralization styling. New format_inline() function format cli string without emitting (#278).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-250","dir":"Changelog","previous_headings":"","what":"cli 2.5.0","title":"cli 2.5.0","text":"CRAN release: 2021-04-26 New style_no_*() functions locally undo styling. New col_none() bg_none() functions locally undo text color background color. now possible undo text background color theme, setting NULL \"none\". cli_memo() renamed cli_bullets(), default formatted bullet list (#250). New ansi_toupper(), ansi_tolower ansi_chartr() functions, ANSI styling aware variants toupper(), tolower() chartr() (#248). New test_that_cli() helper function write testthat tests cli output. tree() now produce warnings tibbles (#238). New inline style: .cls format class names, e.g. \"{.var fit} must {.cls lm} object\".","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-240","dir":"Changelog","previous_headings":"","what":"cli 2.4.0","title":"cli 2.4.0","text":"CRAN release: 2021-04-05 New cli_memo() function create list items tasks. New cli::cli() function create single cli message multiple cli calls (#170). cli now highlights weird names, e.g. path names leading trailing space (#227). Styling fixed several places. particular, nested lists now formatted better (#221). New spark_bar() spark_line() functions draw small bar line charts.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-231","dir":"Changelog","previous_headings":"","what":"cli 2.3.1","title":"cli 2.3.1","text":"CRAN release: 2021-02-23 ANSI color support detection works correctly now older RStudio, also older R versions. cli_h1(), cli_h2() cli_h3() now work multiple glue substitutions (#218).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-230","dir":"Changelog","previous_headings":"","what":"cli 2.3.0","title":"cli 2.3.0","text":"CRAN release: 2021-01-31 boxx() now correctly calculates width box non-ASCII characters. New ansi_trimws() ansi_strwrap() functions, similar trimws() strwrap() work ANSI strings. New ansi_columns() function format ANSI strings multiple columns. ansi_substr(), ansi_substring(), ansi_strsplit(), ansi_align() now always return cli_ansi_string objects. ansi_nchar(), ansi_align(), ansi_strtrim() new ansi_strwrap() well handle wide Unicode correctly, according display width. boxx() can now add headers footers boxes.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-220","dir":"Changelog","previous_headings":"","what":"cli 2.2.0","title":"cli 2.2.0","text":"CRAN release: 2020-11-20 New style_hyperlink() function add hyperlinks, terminals support . cli_format_method() now works properly knitr, environments catch message conditions (#159). ANSI strings created col_*, bg_* style_* now also add character class result. fixes issues code expect character objects. New functions manipulate ANSI strings: ansi_aling(), ansi_has_any(), ansi_nchar(), ansi_regex(), ansi_strip(), ansi_strsplit(), ansi_substr(), ansi_substring().","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-210","dir":"Changelog","previous_headings":"","what":"cli 2.1.0","title":"cli 2.1.0","text":"CRAN release: 2020-10-12 New cli_vec() function allow easier formatting collapsed vectors. now also possible use styling set collapsing parameters (#129). New pluralize() function perform pluralization without generating cli output (#155). console_width() works better now RStudio, also terminals. Styling verbatim text work properly now (#147, @tzakharko). Messages (.e. message conditions) coming cli now cliMessage class, can easily suppress without suppressing messages (#156). cli prints output stderr() now, output message sink. make interactive non-interactive sessions consistent (#153). Pluralization works correctly now last alternative empty string (#158). cli now caches result dark background detection iTerm macOS. Reload cli delete cache (#131). is_dynamic_tty(), is_ansi_tty() ansi_hide_cursor() related functions now default \"auto\" stream, automatically selected either stdout() stderr(). See manual details (#144). default theme now quotes file names, paths, email addresses don’t start end alphanumeric character slash. make easier spot names start end space (#167). make_spinner() clears line properly now (@tzakharko, #164). Semantic cli functions now automatically replace Unicode non-breaking space characters (\\u00a0) regular space characters, right output. still used calculate line breaks, outputted (#161). Progress bars now respect is_dynamic_tty() output \\r false (@jimhester, #177)","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-202","dir":"Changelog","previous_headings":"","what":"cli 2.0.2","title":"cli 2.0.2","text":"CRAN release: 2020-02-28 status bar now simplify multiple spaces single space. cli now crash fails detect whether RStudio theme dark theme (#138). cli now works better wide Unicode characters, example emojis. particular, status bar containing emojis cleared properly (#133). status bar now flicker updated, terminals (#135).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-201","dir":"Changelog","previous_headings":"","what":"cli 2.0.1","title":"cli 2.0.1","text":"CRAN release: 2020-01-08 Symbols (symbol$*) now correctly printed RStudio Windows (#124). default theme cli_code() output looks better now, especially RStudio (#123). Remove spurious newline cli_process_start() cleared manually, also end function. Use Oxford comma listing 3 items (@jonocarroll, #128).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-200","dir":"Changelog","previous_headings":"","what":"cli 2.0.0","title":"cli 2.0.0","text":"CRAN release: 2019-12-09","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"semantic-command-line-interface-tools-2-0-0","dir":"Changelog","previous_headings":"","what":"Semantic command line interface tools","title":"cli 2.0.0","text":"cli 2.0.0 new set functions help creating CLI using set higher level elements: headings, paragraphs, lists, alerts, code blocks, etc. formatting elements can customized via themes. See “Building semantic CLI” article package web site: https://cli.r-lib.org","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"bug-fixes-2-0-0","dir":"Changelog","previous_headings":"","what":"Bug fixes:","title":"cli 2.0.0","text":"Fix bug is_dynamic_tty(), setting R_CLI_DYNAMIC=\"FALSE\" now properly turns dynamic tty (#70).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-110","dir":"Changelog","previous_headings":"","what":"cli 1.1.0","title":"cli 1.1.0","text":"CRAN release: 2019-03-19 cli now functions add ANSI styles text. use crayon package internally, provide simpler interface. See col_*, bg_*, style_* also make_ansi_style() combine_ansi_styles() functions (#51). New is_dynamic_tty() function detects \\r used stream (#62). New is_ansi_tty() function detects ANSI control sequences can used stream. New ansi_hide_cursor(), ansi_show_cursor() ansi_with_hidden_cursor() functions hide show cursor terminals. New make_spinner() function helps integrating spinners functions. Now symbol always uses ASCII symbols cli.unicode option set FALSE.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-100","dir":"Changelog","previous_headings":"","what":"cli 1.0.0","title":"cli 1.0.0","text":"CRAN release: 2017-11-05 First public release.","code":""}] +[{"path":[]},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://cli.r-lib.org/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://cli.r-lib.org/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 cli authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"ANSI function benchmarks","text":"Often can use corresponding base R function baseline. also compare fansi package, possible.","code":""},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"data","dir":"Articles","previous_headings":"","what":"Data","title":"ANSI function benchmarks","text":"cli typical use case short string scalars, run benchmarks longer strings string vectors well.","code":"library(cli) library(fansi) options(cli.unicode = TRUE) options(cli.num_colors = 256) ansi <- format_inline( \"{col_green(symbol$tick)} {.code print(x)} {.emph emphasised}\" ) plain <- ansi_strip(ansi) vec_plain <- rep(plain, 100) vec_ansi <- rep(ansi, 100) vec_plain6 <- rep(plain, 6) vec_ansi6 <- rep(plain, 6) txt_plain <- paste(vec_plain, collapse = \" \") txt_ansi <- paste(vec_ansi, collapse = \" \") uni <- paste( \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\U0001f3ff\\u200d\\u2640\\ufe0f\" ) vec_uni <- rep(uni, 100) txt_uni <- paste(vec_uni, collapse = \" \")"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_align","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_align()","title":"ANSI function benchmarks","text":"","code":"bench::mark( ansi = ansi_align(ansi, width = 20), plain = ansi_align(plain, width = 20), base = format(plain, width = 20), check = FALSE ) #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 44.5µs 48µs 20158. 98.5KB 19.0 #> 2 plain 44.1µs 47.6µs 20251. 0B 19.8 #> 3 base 11.3µs 12.5µs 77769. 48.4KB 23.3 bench::mark( ansi = ansi_align(ansi, width = 20, align = \"right\"), plain = ansi_align(plain, width = 20, align = \"right\"), base = format(plain, width = 20, justify = \"right\"), check = FALSE ) #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 46.2µs 50.1µs 19301. 0B 21.3 #> 2 plain 45.7µs 49.6µs 19478. 0B 21.4 #> 3 base 13.5µs 14.9µs 64831. 0B 19.5"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_chartr","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_chartr()","title":"ANSI function benchmarks","text":"","code":"bench::mark( ansi = ansi_chartr(\"abc\", \"XYZ\", ansi), plain = ansi_chartr(\"abc\", \"XYZ\", plain), base = chartr(\"abc\", \"XYZ\", plain), check = FALSE ) #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 110.75µs 117.9µs 8232. 75.07KB 14.7 #> 2 plain 88.45µs 93.5µs 10317. 8.73KB 12.5 #> 3 base 1.85µs 2µs 479676. 0B 48.0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_columns","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_columns()","title":"ANSI function benchmarks","text":"","code":"bench::mark( ansi = ansi_columns(vec_ansi6, width = 120), plain = ansi_columns(vec_plain6, width = 120), check = FALSE ) #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 ansi 331µs 354µs 2800. 33.17KB 19.1 #> 2 plain 330µs 353µs 2778. 1.09KB 19.2"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_has_any","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_has_any()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_has_any(ansi), fansi_ansi = has_sgr(ansi), cli_plain = ansi_has_any(plain), fansi_plain = has_sgr(plain), cli_vec_ansi = ansi_has_any(vec_ansi), fansi_vec_ansi = has_sgr(vec_ansi), cli_vec_plain = ansi_has_any(vec_plain), fansi_vec_plain = has_sgr(vec_plain), cli_txt_ansi = ansi_has_any(txt_ansi), fansi_txt_ansi = has_sgr(txt_ansi), cli_txt_plain = ansi_has_any(txt_plain), fansi_txt_plain = has_sgr(vec_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 5.42µs 5.93µs 161544. 8.02KB 32.3 #> 2 fansi_ansi 29.54µs 32.56µs 29890. 4.18KB 23.9 #> 3 cli_plain 5.39µs 5.95µs 162465. 0B 16.2 #> 4 fansi_plain 29.89µs 32.52µs 29926. 688B 27.0 #> 5 cli_vec_ansi 6.75µs 7.17µs 135705. 448B 13.6 #> 6 fansi_vec_ansi 39.44µs 41.6µs 23454. 5.02KB 18.8 #> 7 cli_vec_plain 7.27µs 7.72µs 126735. 448B 25.4 #> 8 fansi_vec_plain 38.3µs 40.52µs 23971. 5.02KB 19.2 #> 9 cli_txt_ansi 5.4µs 5.81µs 168122. 0B 33.6 #> 10 fansi_txt_ansi 29.97µs 32.11µs 30222. 688B 21.2 #> 11 cli_txt_plain 6.19µs 6.63µs 146776. 0B 29.4 #> 12 fansi_txt_plain 38.28µs 40.65µs 23733. 5.02KB 19.0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_html","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_html()","title":"ANSI function benchmarks","text":"typically used longer text.","code":"bench::mark( cli = ansi_html(txt_ansi), fansi = sgr_to_html(txt_ansi, classes = TRUE), check = FALSE ) #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 66µs 67.5µs 14552. 28.8KB 6.10 #> 2 fansi 122µs 125.4µs 7818. 55.3KB 8.20"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_nchar","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_nchar()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_nchar(ansi), fansi_ansi = nchar_sgr(ansi), base_ansi = nchar(ansi), cli_plain = ansi_nchar(plain), fansi_plain = nchar_sgr(plain), base_plain = nchar(plain), cli_vec_ansi = ansi_nchar(vec_ansi), fansi_vec_ansi = nchar_sgr(vec_ansi), base_vec_ansi = nchar(vec_ansi), cli_vec_plain = ansi_nchar(vec_plain), fansi_vec_plain = nchar_sgr(vec_plain), base_vec_plain = nchar(vec_plain), cli_txt_ansi = ansi_nchar(txt_ansi), fansi_txt_ansi = nchar_sgr(txt_ansi), base_txt_ansi = nchar(txt_ansi), cli_txt_plain = ansi_nchar(txt_plain), fansi_txt_plain = nchar_sgr(txt_plain), base_txt_plain = nchar(txt_plain), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 6.5µs 7.04µs 138584. 0B 13.9 #> 2 fansi_ansi 90.82µs 96.16µs 10118. 31.85KB 16.8 #> 3 base_ansi 852.04ns 932.02ns 865496. 0B 0 #> 4 cli_plain 6.41µs 7.04µs 138251. 0B 27.7 #> 5 fansi_plain 90.83µs 95.59µs 10180. 688B 16.9 #> 6 base_plain 772.07ns 821.08ns 1138145. 0B 0 #> 7 cli_vec_ansi 28.17µs 29.55µs 32967. 448B 6.59 #> 8 fansi_vec_ansi 111.39µs 116.98µs 8281. 5.02KB 12.5 #> 9 base_vec_ansi 14.8µs 14.86µs 66228. 448B 0 #> 10 cli_vec_plain 26.28µs 27.22µs 35838. 448B 7.17 #> 11 fansi_vec_plain 101.69µs 106.54µs 9064. 5.02KB 14.7 #> 12 base_vec_plain 8.11µs 8.17µs 120064. 448B 0 #> 13 cli_txt_ansi 28.07µs 29.06µs 33396. 0B 6.68 #> 14 fansi_txt_ansi 102.76µs 108.5µs 8931. 688B 14.6 #> 15 base_txt_ansi 14.26µs 14.31µs 68774. 0B 0 #> 16 cli_txt_plain 25.91µs 26.67µs 36624. 0B 7.33 #> 17 fansi_txt_plain 93.39µs 99.61µs 9716. 688B 14.7 #> 18 base_txt_plain 8.39µs 8.92µs 109862. 0B 0 bench::mark( cli_ansi = ansi_nchar(ansi, type = \"width\"), fansi_ansi = nchar_sgr(ansi, type = \"width\"), base_ansi = nchar(ansi, \"width\"), cli_plain = ansi_nchar(plain, type = \"width\"), fansi_plain = nchar_sgr(plain, type = \"width\"), base_plain = nchar(plain, \"width\"), cli_vec_ansi = ansi_nchar(vec_ansi, type = \"width\"), fansi_vec_ansi = nchar_sgr(vec_ansi, type = \"width\"), base_vec_ansi = nchar(vec_ansi, \"width\"), cli_vec_plain = ansi_nchar(vec_plain, type = \"width\"), fansi_vec_plain = nchar_sgr(vec_plain, type = \"width\"), base_vec_plain = nchar(vec_plain, \"width\"), cli_txt_ansi = ansi_nchar(txt_ansi, type = \"width\"), fansi_txt_ansi = nchar_sgr(txt_ansi, type = \"width\"), base_txt_ansi = nchar(txt_ansi, \"width\"), cli_txt_plain = ansi_nchar(txt_plain, type = \"width\"), fansi_txt_plain = nchar_sgr(txt_plain, type = \"width\"), base_txt_plain = nchar(txt_plain, type = \"width\"), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 8.12µs 8.94µs 108004. 0B 21.6 #> 2 fansi_ansi 92.26µs 98.13µs 9828. 688B 16.9 #> 3 base_ansi 1.18µs 1.22µs 761723. 0B 0 #> 4 cli_plain 8.11µs 9.01µs 94088. 0B 18.8 #> 5 fansi_plain 92.01µs 98.13µs 9861. 688B 16.9 #> 6 base_plain 961.01ns 1µs 933818. 0B 0 #> 7 cli_vec_ansi 33.88µs 34.84µs 28098. 448B 5.62 #> 8 fansi_vec_ansi 118.55µs 125.3µs 7737. 5.02KB 12.0 #> 9 base_vec_ansi 41.73µs 42.53µs 23167. 448B 2.32 #> 10 cli_vec_plain 33µs 33.93µs 28922. 448B 5.79 #> 11 fansi_vec_plain 107.92µs 113.97µs 8499. 5.02KB 12.5 #> 12 base_vec_plain 21.36µs 21.55µs 45771. 448B 4.58 #> 13 cli_txt_ansi 34.22µs 34.94µs 28097. 0B 5.62 #> 14 fansi_txt_ansi 108.83µs 113.47µs 8582. 688B 12.4 #> 15 base_txt_ansi 43.82µs 45.01µs 21929. 0B 2.19 #> 16 cli_txt_plain 32.59µs 33.37µs 29420. 0B 5.89 #> 17 fansi_txt_plain 97.74µs 103.44µs 9416. 688B 14.6 #> 18 base_txt_plain 23.93µs 24.14µs 40842. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_simplify","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_simplify()","title":"ANSI function benchmarks","text":"Nothing compare .","code":"bench::mark( cli_ansi = ansi_simplify(ansi), cli_plain = ansi_simplify(plain), cli_vec_ansi = ansi_simplify(vec_ansi), cli_vec_plain = ansi_simplify(vec_plain), cli_txt_ansi = ansi_simplify(txt_ansi), cli_txt_plain = ansi_simplify(txt_plain), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 6.38µs 7.01µs 138661. 0B 13.9 #> 2 cli_plain 5.95µs 6.45µs 150799. 0B 30.2 #> 3 cli_vec_ansi 39.62µs 40.58µs 24120. 848B 2.41 #> 4 cli_vec_plain 9.86µs 10.4µs 93939. 848B 18.8 #> 5 cli_txt_ansi 37.33µs 38.6µs 25404. 0B 2.54 #> 6 cli_txt_plain 6.76µs 7.3µs 133308. 0B 26.7"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strip","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strip()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_strip(ansi), fansi_ansi = strip_sgr(ansi), cli_plain = ansi_strip(plain), fansi_plain = strip_sgr(plain), cli_vec_ansi = ansi_strip(vec_ansi), fansi_vec_ansi = strip_sgr(vec_ansi), cli_vec_plain = ansi_strip(vec_plain), fansi_vec_plain = strip_sgr(vec_plain), cli_txt_ansi = ansi_strip(txt_ansi), fansi_txt_ansi = strip_sgr(txt_ansi), cli_txt_plain = ansi_strip(txt_plain), fansi_txt_plain = strip_sgr(txt_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 11.3µs 11.9µs 81439. 0B 32.6 #> 2 fansi_ansi 27.3µs 29.2µs 33190. 688B 23.2 #> 3 cli_plain 11.1µs 11.7µs 83228. 0B 25.0 #> 4 fansi_plain 27µs 28.8µs 33495. 688B 26.8 #> 5 cli_vec_ansi 20µs 21.1µs 46162. 848B 13.9 #> 6 fansi_vec_ansi 52.8µs 55.4µs 17598. 5.41KB 12.6 #> 7 cli_vec_plain 13.6µs 14.8µs 65802. 848B 26.3 #> 8 fansi_vec_plain 36µs 38.1µs 25459. 4.59KB 17.8 #> 9 cli_txt_ansi 19.5µs 20.4µs 47919. 0B 14.4 #> 10 fansi_txt_ansi 43.2µs 45.5µs 21332. 5.12KB 17.1 #> 11 cli_txt_plain 11.9µs 12.7µs 76627. 0B 23.0 #> 12 fansi_txt_plain 28.5µs 30.3µs 31929. 688B 25.6"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strsplit","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strsplit()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_strsplit(ansi, \"i\"), fansi_ansi = strsplit_sgr(ansi, \"i\"), base_ansi = strsplit(ansi, \"i\"), cli_plain = ansi_strsplit(plain, \"i\"), fansi_plain = strsplit_sgr(plain, \"i\"), base_plain = strsplit(plain, \"i\"), cli_vec_ansi = ansi_strsplit(vec_ansi, \"i\"), fansi_vec_ansi = strsplit_sgr(vec_ansi, \"i\"), base_vec_ansi = strsplit(vec_ansi, \"i\"), cli_vec_plain = ansi_strsplit(vec_plain, \"i\"), fansi_vec_plain = strsplit_sgr(vec_plain, \"i\"), base_vec_plain = strsplit(vec_plain, \"i\"), cli_txt_ansi = ansi_strsplit(txt_ansi, \"i\"), fansi_txt_ansi = strsplit_sgr(txt_ansi, \"i\"), base_txt_ansi = strsplit(txt_ansi, \"i\"), cli_txt_plain = ansi_strsplit(txt_plain, \"i\"), fansi_txt_plain = strsplit_sgr(txt_plain, \"i\"), base_txt_plain = strsplit(txt_plain, \"i\"), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 148.04µs 155.53µs 6211. 103.31KB 16.8 #> 2 fansi_ansi 126.83µs 134.37µs 7176. 102.13KB 19.1 #> 3 base_ansi 3.97µs 4.38µs 223119. 224B 22.3 #> 4 cli_plain 144.54µs 152.28µs 6371. 8.09KB 17.3 #> 5 fansi_plain 124.48µs 132.04µs 7382. 9.62KB 19.1 #> 6 base_plain 3.45µs 3.71µs 260968. 0B 26.1 #> 7 cli_vec_ansi 7.52ms 7.75ms 128. 823.77KB 25.2 #> 8 fansi_vec_ansi 1.05ms 1.1ms 885. 846.81KB 17.4 #> 9 base_vec_ansi 156.25µs 162.49µs 6042. 22.7KB 2.04 #> 10 cli_vec_plain 7.44ms 7.67ms 130. 823.77KB 26.0 #> 11 fansi_vec_plain 1ms 1.05ms 930. 845.98KB 19.8 #> 12 base_vec_plain 111.42µs 115.8µs 8476. 848B 2.01 #> 13 cli_txt_ansi 3.31ms 3.36ms 297. 63.6KB 2.02 #> 14 fansi_txt_ansi 1.54ms 1.56ms 638. 35.05KB 0 #> 15 base_txt_ansi 136.61µs 147.68µs 6687. 18.47KB 2.03 #> 16 cli_txt_plain 2.45ms 2.47ms 400. 63.6KB 0 #> 17 fansi_txt_plain 524.43µs 553.03µs 1800. 30.6KB 6.18 #> 18 base_txt_plain 90.78µs 92.74µs 10530. 11.05KB 2.02"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strtrim","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strtrim()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_strtrim(ansi, 10), fansi_ansi = strtrim_sgr(ansi, 10), base_ansi = strtrim(ansi, 10), cli_plain = ansi_strtrim(plain, 10), fansi_plain = strtrim_sgr(plain, 10), base_plain = strtrim(plain, 10), cli_vec_ansi = ansi_strtrim(vec_ansi, 10), fansi_vec_ansi = strtrim_sgr(vec_ansi, 10), base_vec_ansi = strtrim(vec_ansi, 10), cli_vec_plain = ansi_strtrim(vec_plain, 10), fansi_vec_plain = strtrim_sgr(vec_plain, 10), base_vec_plain = strtrim(vec_plain, 10), cli_txt_ansi = ansi_strtrim(txt_ansi, 10), fansi_txt_ansi = strtrim_sgr(txt_ansi, 10), base_txt_ansi = strtrim(txt_ansi, 10), cli_txt_plain = ansi_strtrim(txt_plain, 10), fansi_txt_plain = strtrim_sgr(txt_plain, 10), base_txt_plain = strtrim(txt_plain, 10), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 97.3µs 103.38µs 9312. 32.23KB 21.6 #> 2 fansi_ansi 53.11µs 57.19µs 16822. 31.43KB 21.3 #> 3 base_ansi 991.04ns 1.04µs 912275. 4.2KB 0 #> 4 cli_plain 94.91µs 99.98µs 9629. 0B 21.2 #> 5 fansi_plain 53.36µs 57.33µs 16701. 872B 21.3 #> 6 base_plain 932.14ns 1.02µs 882828. 0B 88.3 #> 7 cli_vec_ansi 234.35µs 243.5µs 4027. 16.73KB 8.29 #> 8 fansi_vec_ansi 122.99µs 128µs 7615. 5.59KB 10.4 #> 9 base_vec_ansi 35.22µs 35.63µs 27627. 848B 2.76 #> 10 cli_vec_plain 177.49µs 185.49µs 5275. 16.73KB 10.4 #> 11 fansi_vec_plain 117.4µs 122.45µs 7944. 5.59KB 12.6 #> 12 base_vec_plain 30.76µs 30.99µs 31928. 848B 0 #> 13 cli_txt_ansi 103.87µs 109.33µs 8918. 0B 19.5 #> 14 fansi_txt_ansi 52.93µs 56.05µs 17344. 872B 23.6 #> 15 base_txt_ansi 1.03µs 1.07µs 890273. 0B 0 #> 16 cli_txt_plain 94.55µs 99.78µs 9746. 0B 21.2 #> 17 fansi_txt_plain 51.62µs 55.6µs 17155. 872B 21.3 #> 18 base_txt_plain 952.04ns 1µs 934697. 0B 93.5"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_strwrap","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_strwrap()","title":"ANSI function benchmarks","text":"function useful longer text, often called short text cli, makes sense benchmark well.","code":"bench::mark( cli_ansi = ansi_strwrap(ansi, 30), fansi_ansi = strwrap_sgr(ansi, 30), base_ansi = strwrap(ansi, 30), cli_plain = ansi_strwrap(plain, 30), fansi_plain = strwrap_sgr(plain, 30), base_plain = strwrap(plain, 30), cli_vec_ansi = ansi_strwrap(vec_ansi, 30), fansi_vec_ansi = strwrap_sgr(vec_ansi, 30), base_vec_ansi = strwrap(vec_ansi, 30), cli_vec_plain = ansi_strwrap(vec_plain, 30), fansi_vec_plain = strwrap_sgr(vec_plain, 30), base_vec_plain = strwrap(vec_plain, 30), cli_txt_ansi = ansi_strwrap(txt_ansi, 30), fansi_txt_ansi = strwrap_sgr(txt_ansi, 30), base_txt_ansi = strwrap(txt_ansi, 30), cli_txt_plain = ansi_strwrap(txt_plain, 30), fansi_txt_plain = strwrap_sgr(txt_plain, 30), base_txt_plain = strwrap(txt_plain, 30), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 313.79µs 331.89µs 2947. 266.59KB 21.3 #> 2 fansi_ansi 96.04µs 102.76µs 9359. 10.29KB 19.0 #> 3 base_ansi 36.05µs 38.52µs 24923. 0B 22.5 #> 4 cli_plain 195.73µs 205.17µs 4726. 0B 16.8 #> 5 fansi_plain 94.4µs 101.67µs 9475. 872B 21.3 #> 6 base_plain 29.82µs 31.75µs 30190. 0B 21.1 #> 7 cli_vec_ansi 33.31ms 33.68ms 29.3 2.48KB 52.8 #> 8 fansi_vec_ansi 240.07µs 250.11µs 3908. 7.25KB 10.4 #> 9 base_vec_ansi 2.19ms 2.27ms 436. 48.18KB 25.0 #> 10 cli_vec_plain 20.04ms 20.72ms 48.0 2.48KB 32.0 #> 11 fansi_vec_plain 199.75µs 206.29µs 4774. 6.42KB 12.5 #> 12 base_vec_plain 1.58ms 1.62ms 614. 47.4KB 24.2 #> 13 cli_txt_ansi 22.94ms 23.39ms 42.7 507.59KB 13.3 #> 14 fansi_txt_ansi 227.28µs 235.68µs 4162. 6.77KB 8.21 #> 15 base_txt_ansi 2.05ms 2.08ms 477. 582.06KB 13.2 #> 16 cli_txt_plain 1.64ms 1.68ms 592. 369.84KB 10.8 #> 17 fansi_txt_plain 180.62µs 187.87µs 5227. 2.51KB 12.5 #> 18 base_txt_plain 1.31ms 1.33ms 742. 367.31KB 13.1"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_substr","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_substr()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_substr(ansi, 2, 10), fansi_ansi = substr_sgr(ansi, 2, 10), base_ansi = substr(ansi, 2, 10), cli_plain = ansi_substr(plain, 2, 10), fansi_plain = substr_sgr(plain, 2, 10), base_plain = substr(plain, 2, 10), cli_vec_ansi = ansi_substr(vec_ansi, 2, 10), fansi_vec_ansi = substr_sgr(vec_ansi, 2, 10), base_vec_ansi = substr(vec_ansi, 2, 10), cli_vec_plain = ansi_substr(vec_plain, 2, 10), fansi_vec_plain = substr_sgr(vec_plain, 2, 10), base_vec_plain = substr(vec_plain, 2, 10), cli_txt_ansi = ansi_substr(txt_ansi, 2, 10), fansi_txt_ansi = substr_sgr(txt_ansi, 2, 10), base_txt_ansi = substr(txt_ansi, 2, 10), cli_txt_plain = ansi_substr(txt_plain, 2, 10), fansi_txt_plain = substr_sgr(txt_plain, 2, 10), base_txt_plain = substr(txt_plain, 2, 10), check = FALSE ) #> # A tibble: 18 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 6.23µs 6.75µs 142670. 23.82KB 42.8 #> 2 fansi_ansi 75.79µs 81.2µs 11945. 28.48KB 19.1 #> 3 base_ansi 961.94ns 1.01µs 918560. 0B 91.9 #> 4 cli_plain 6.15µs 6.66µs 145773. 0B 29.2 #> 5 fansi_plain 75.49µs 80.73µs 12000. 1.98KB 21.3 #> 6 base_plain 922.13ns 972.07ns 965472. 0B 0 #> 7 cli_vec_ansi 26.55µs 27.64µs 35513. 1.7KB 7.10 #> 8 fansi_vec_ansi 113.97µs 118.99µs 8171. 8.86KB 14.8 #> 9 base_vec_ansi 5.72µs 6µs 162504. 848B 16.3 #> 10 cli_vec_plain 22.36µs 23.61µs 41583. 1.7KB 8.32 #> 11 fansi_vec_plain 107.73µs 112.84µs 8629. 8.86KB 14.8 #> 12 base_vec_plain 5.4µs 5.68µs 172178. 848B 0 #> 13 cli_txt_ansi 6.18µs 6.76µs 142942. 0B 28.6 #> 14 fansi_txt_ansi 76.25µs 81.27µs 11937. 1.98KB 21.4 #> 15 base_txt_ansi 5.12µs 5.18µs 188160. 0B 18.8 #> 16 cli_txt_plain 6.98µs 7.54µs 128426. 0B 25.7 #> 17 fansi_txt_plain 76.15µs 80.7µs 12043. 1.98KB 21.3 #> 18 base_txt_plain 3.36µs 3.42µs 285380. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_tolower-ansi_toupper","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_tolower() , ansi_toupper()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_tolower(ansi), base_ansi = tolower(ansi), cli_plain = ansi_tolower(plain), base_plain = tolower(plain), cli_vec_ansi = ansi_tolower(vec_ansi), base_vec_ansi = tolower(vec_ansi), cli_vec_plain = ansi_tolower(vec_plain), base_vec_plain = tolower(vec_plain), cli_txt_ansi = ansi_tolower(txt_ansi), base_txt_ansi = tolower(txt_ansi), cli_txt_plain = ansi_tolower(txt_plain), base_txt_plain = tolower(txt_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 103.18µs 107.85µs 8963. 11.88KB 17.2 #> 2 base_ansi 1.32µs 1.36µs 714085. 0B 0 #> 3 cli_plain 83.2µs 86.88µs 11177. 8.73KB 14.6 #> 4 base_plain 1µs 1.04µs 920968. 0B 0 #> 5 cli_vec_ansi 3.94ms 4.04ms 246. 838.77KB 28.7 #> 6 base_vec_ansi 78.05µs 78.73µs 12566. 848B 0 #> 7 cli_vec_plain 2.25ms 2.3ms 432. 816.9KB 27.4 #> 8 base_vec_plain 46.97µs 47.77µs 20665. 848B 0 #> 9 cli_txt_ansi 13.02ms 13.13ms 75.8 114.42KB 6.50 #> 10 base_txt_ansi 78.67µs 79.12µs 12385. 0B 0 #> 11 cli_txt_plain 252.01µs 259.81µs 3745. 18.16KB 6.12 #> 12 base_txt_plain 44.78µs 45.13µs 21836. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"ansi_trimws","dir":"Articles","previous_headings":"ANSI functions","what":"ansi_trimws()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli_ansi = ansi_trimws(ansi), base_ansi = trimws(ansi), cli_plain = ansi_trimws(plain), base_plain = trimws(plain), cli_vec_ansi = ansi_trimws(vec_ansi), base_vec_ansi = trimws(vec_ansi), cli_vec_plain = ansi_trimws(vec_plain), base_vec_plain = trimws(vec_plain), cli_txt_ansi = ansi_trimws(txt_ansi), base_txt_ansi = trimws(txt_ansi), cli_txt_plain = ansi_trimws(txt_plain), base_txt_plain = trimws(txt_plain), check = FALSE ) #> # A tibble: 12 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_ansi 72.1µs 77.3µs 12375. 0B 21.2 #> 2 base_ansi 16.3µs 17.4µs 55502. 0B 22.2 #> 3 cli_plain 71.7µs 76.2µs 12363. 0B 18.9 #> 4 base_plain 16.2µs 17.3µs 55674. 0B 22.3 #> 5 cli_vec_ansi 156.3µs 164.9µs 5925. 7.2KB 10.4 #> 6 base_vec_ansi 55.1µs 59.8µs 16387. 1.66KB 6.12 #> 7 cli_vec_plain 143µs 151.4µs 6460. 7.2KB 10.3 #> 8 base_vec_plain 48.6µs 53.5µs 18098. 1.66KB 6.14 #> 9 cli_txt_ansi 137.2µs 142µs 6862. 0B 12.4 #> 10 base_txt_ansi 38.3µs 39.8µs 24530. 0B 7.36 #> 11 cli_txt_plain 121.6µs 126.4µs 7683. 0B 12.4 #> 12 base_txt_plain 32.9µs 34.2µs 28525. 0B 11.4"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"utf8_nchar","dir":"Articles","previous_headings":"UTF-8 functions","what":"utf8_nchar()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli = utf8_nchar(uni, type = \"chars\"), base = nchar(uni, \"chars\"), cli_vec = utf8_nchar(vec_uni, type = \"chars\"), base_vec = nchar(vec_uni, \"chars\"), cli_txt = utf8_nchar(txt_uni, type = \"chars\"), base_txt = nchar(txt_uni, \"chars\"), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 7.92µs 8.66µs 110674. 12.3KB 33.2 #> 2 base 840.98ns 891.16ns 1055676. 0B 0 #> 3 cli_vec 24.35µs 25.25µs 38799. 448B 7.76 #> 4 base_vec 11.76µs 12µs 82182. 448B 0 #> 5 cli_txt 24.92µs 25.83µs 37716. 0B 7.54 #> 6 base_txt 12.79µs 12.89µs 76262. 0B 7.63 bench::mark( cli = utf8_nchar(uni, type = \"width\"), base = nchar(uni, \"width\"), cli_vec = utf8_nchar(vec_uni, type = \"width\"), base_vec = nchar(vec_uni, \"width\"), cli_txt = utf8_nchar(txt_uni, type = \"width\"), base_txt = nchar(txt_uni, \"width\"), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 7.87µs 8.55µs 112784. 0B 22.6 #> 2 base 1.22µs 1.28µs 734707. 0B 0 #> 3 cli_vec 28.71µs 29.65µs 33034. 448B 9.91 #> 4 base_vec 46.69µs 49.06µs 20206. 448B 0 #> 5 cli_txt 30µs 30.9µs 31714. 0B 6.34 #> 6 base_txt 81.37µs 84.66µs 11708. 0B 0 bench::mark( cli = utf8_nchar(uni, type = \"codepoints\"), base = nchar(uni, \"chars\"), cli_vec = utf8_nchar(vec_uni, type = \"codepoints\"), base_vec = nchar(vec_uni, \"chars\"), cli_txt = utf8_nchar(txt_uni, type = \"codepoints\"), base_txt = nchar(txt_uni, \"chars\"), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 8.66µs 9.35µs 103823. 0B 20.8 #> 2 base 842.03ns 902.1ns 1031247. 0B 0 #> 3 cli_vec 20µs 20.78µs 47018. 448B 14.1 #> 4 base_vec 11.76µs 12.02µs 82120. 448B 0 #> 5 cli_txt 20.59µs 21.44µs 45644. 0B 9.13 #> 6 base_txt 12.78µs 12.94µs 74926. 0B 7.49"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"utf8_substr","dir":"Articles","previous_headings":"UTF-8 functions","what":"utf8_substr()","title":"ANSI function benchmarks","text":"","code":"bench::mark( cli = utf8_substr(uni, 2, 10), base = substr(uni, 2, 10), cli_vec = utf8_substr(vec_uni, 2, 10), base_vec = substr(vec_uni, 2, 10), cli_txt = utf8_substr(txt_uni, 2, 10), base_txt = substr(txt_uni, 2, 10), check = FALSE ) #> # A tibble: 6 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli 5.69µs 6.18µs 153181. 21.1KB 30.6 #> 2 base 971.02ns 1.03µs 909236. 0B 90.9 #> 3 cli_vec 29.5µs 30.36µs 32292. 1.7KB 6.46 #> 4 base_vec 7.66µs 7.87µs 124974. 848B 0 #> 5 cli_txt 5.77µs 6.33µs 146777. 0B 29.4 #> 6 base_txt 5.85µs 5.91µs 165588. 0B 16.6"},{"path":"https://cli.r-lib.org/dev/articles/ansi-benchmark.html","id":"session-info","dir":"Articles","previous_headings":"","what":"Session info","title":"ANSI function benchmarks","text":"","code":"sessioninfo::session_info() #> ─ Session info ───────────────────────────────────────────────────────── #> setting value #> version R version 4.4.1 (2024-06-14) #> os Ubuntu 22.04.5 LTS #> system x86_64, linux-gnu #> ui X11 #> language en #> collate C.UTF-8 #> ctype C.UTF-8 #> tz UTC #> date 2024-10-03 #> pandoc 3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/ (via rmarkdown) #> #> ─ Packages ───────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> bench 1.1.3 2023-05-04 [1] RSPM #> bslib 0.8.0 2024-07-29 [1] RSPM #> cachem 1.1.0 2024-05-16 [1] RSPM #> cli * 3.6.3.9000 2024-10-03 [1] local #> codetools 0.2-20 2024-03-31 [3] CRAN (R 4.4.1) #> desc 1.4.3 2023-12-10 [1] RSPM #> digest 0.6.37 2024-08-19 [1] RSPM #> evaluate 1.0.0 2024-09-17 [1] RSPM #> fansi * 1.0.6 2023-12-08 [1] RSPM #> fastmap 1.2.0 2024-05-15 [1] RSPM #> fs 1.6.4 2024-04-25 [1] RSPM #> glue 1.8.0 2024-09-30 [1] RSPM #> htmltools 0.5.8.1 2024-04-04 [1] RSPM #> htmlwidgets 1.6.4 2023-12-06 [1] RSPM #> jquerylib 0.1.4 2021-04-26 [1] RSPM #> jsonlite 1.8.9 2024-09-20 [1] RSPM #> knitr 1.48 2024-07-07 [1] RSPM #> lifecycle 1.0.4 2023-11-07 [1] RSPM #> magrittr 2.0.3 2022-03-30 [1] RSPM #> pillar 1.9.0 2023-03-22 [1] RSPM #> pkgconfig 2.0.3 2019-09-22 [1] RSPM #> pkgdown 2.1.1 2024-09-17 [1] any (@2.1.1) #> profmem 0.6.0 2020-12-13 [1] RSPM #> R6 2.5.1 2021-08-19 [1] RSPM #> ragg 1.3.3 2024-09-11 [1] RSPM #> rlang 1.1.4 2024-06-04 [1] RSPM #> rmarkdown 2.28 2024-08-17 [1] RSPM #> sass 0.4.9 2024-03-15 [1] RSPM #> sessioninfo 1.2.2 2021-12-06 [1] RSPM #> systemfonts 1.1.0 2024-05-15 [1] RSPM #> textshaping 0.4.0 2024-05-24 [1] RSPM #> tibble 3.2.1 2023-03-20 [1] RSPM #> utf8 1.2.4 2023-10-22 [1] RSPM #> vctrs 0.6.5 2023-12-01 [1] RSPM #> xfun 0.47 2024-08-17 [1] RSPM #> yaml 2.3.10 2024-07-26 [1] RSPM #> #> [1] /home/runner/work/_temp/Library #> [2] /opt/R/4.4.1/lib/R/site-library #> [3] /opt/R/4.4.1/lib/R/library #> #> ────────────────────────────────────────────────────────────────────────"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"asciicast","dir":"Articles","previous_headings":"Internal environment variables","what":"ASCIICAST","title":"Configuration (internal)","text":"Used detect asciicast sub-process RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"ansicon","dir":"Articles","previous_headings":"Internal environment variables","what":"ANSICON","title":"Configuration (internal)","text":"Used detect ANSICON detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"ci","dir":"Articles","previous_headings":"Internal environment variables","what":"CI","title":"Configuration (internal)","text":"Used detect code running CI. yes, avoid ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_debug_bad_end","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_DEBUG_BAD_END","title":"Configuration (internal)","text":"Whether warn cli_end() calls container close.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_no_builtin_theme","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_NO_BUILTIN_THEME","title":"Configuration (internal)","text":"Set true omit builtin theme.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_speed_time","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_SPEED_TIME","title":"Configuration (internal)","text":"Can used speed cli’s timer. factor, e.g. setting 2 makes cli’s time go twice fast.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli_tick_time","dir":"Articles","previous_headings":"Internal environment variables","what":"CLI_TICK_TIME","title":"Configuration (internal)","text":"often cli timer alert, milliseconds.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cmder_root","dir":"Articles","previous_headings":"Internal environment variables","what":"CMDER_ROOT","title":"Configuration (internal)","text":"Used detect cmder detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"colorterm","dir":"Articles","previous_headings":"Internal environment variables","what":"COLORTERM","title":"Configuration (internal)","text":"Used detecting ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"conemuansi","dir":"Articles","previous_headings":"Internal environment variables","what":"ConEmuANSI","title":"Configuration (internal)","text":"Used detect ConEmu detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"emacs","dir":"Articles","previous_headings":"Internal environment variables","what":"EMACS","title":"Configuration (internal)","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"inside_emacs","dir":"Articles","previous_headings":"Internal environment variables","what":"INSIDE_EMACS","title":"Configuration (internal)","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"not_cran","dir":"Articles","previous_headings":"Internal environment variables","what":"NOT_CRAN","title":"Configuration (internal)","text":"Set true run tests / examples / checks, run CRAN.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_check_package_name_","dir":"Articles","previous_headings":"Internal environment variables","what":"_R_CHECK_PACKAGE_NAME_","title":"Configuration (internal)","text":"Used detect R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_browser","dir":"Articles","previous_headings":"Internal environment variables","what":"R_BROWSER","title":"Configuration (internal)","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_gui_app_version","dir":"Articles","previous_headings":"Internal environment variables","what":"R_GUI_APP_VERSION","title":"Configuration (internal)","text":"Used detect R.app macOS, decide console ANSI control sequences.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_package_dir","dir":"Articles","previous_headings":"Internal environment variables","what":"R_PACKAGE_DIR","title":"Configuration (internal)","text":"Used detect code running R CMD INSTALL.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_pdfviewer","dir":"Articles","previous_headings":"Internal environment variables","what":"R_PDFVIEWER","title":"Configuration (internal)","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"r_progress_no_examples","dir":"Articles","previous_headings":"Internal environment variables","what":"R_PROGRESS_NO_EXAMPLES","title":"Configuration (internal)","text":"Set true avoid running examples, outside R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO","title":"Configuration (internal)","text":"Used detect RStudio, various functions.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio_console_color","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO_CONSOLE_COLOR","title":"Configuration (internal)","text":"Used detect number colors RStudio. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio_console_width","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO_CONSOLE_WIDTH","title":"Configuration (internal)","text":"Used auto-detect console width RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio_term","dir":"Articles","previous_headings":"Internal environment variables","what":"RSTUDIO_TERM","title":"Configuration (internal)","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"teamcity_version","dir":"Articles","previous_headings":"Internal environment variables","what":"TEAMCITY_VERSION","title":"Configuration (internal)","text":"Used detect TeamCity CI, turn ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"term","dir":"Articles","previous_headings":"Internal environment variables","what":"TERM","title":"Configuration (internal)","text":"Used detect console ANSI control sequences, terminal.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"term_program","dir":"Articles","previous_headings":"Internal environment variables","what":"TERM_PROGRAM","title":"Configuration (internal)","text":"Used detect iTerm dark theme detection ANSI hyperlink support detection.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"term_program_version","dir":"Articles","previous_headings":"Internal environment variables","what":"TERM_PROGRAM_VERSION","title":"Configuration (internal)","text":"Used detect suitable iTerm version ANSI hyperlink support.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"testthat","dir":"Articles","previous_headings":"Internal environment variables","what":"TESTTHAT","title":"Configuration (internal)","text":"Used detect running testthat tests.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"vte_version","dir":"Articles","previous_headings":"Internal environment variables","what":"VTE_VERSION","title":"Configuration (internal)","text":"Used detect suitable VTE version ANSI hyperlinks.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli__pb","dir":"Articles","previous_headings":"Internal options","what":"cli__pb","title":"Configuration (internal)","text":"option set progress bar updated, interpolating format string.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"cli-record","dir":"Articles","previous_headings":"Internal options","what":"cli.record","title":"Configuration (internal)","text":"Internal option mark state cli recording messages.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"crayon-colors","dir":"Articles","previous_headings":"Internal options","what":"crayon.colors","title":"Configuration (internal)","text":"Deprecated option number ANSI colors, still supported cli, new options set. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"crayon-enabled","dir":"Articles","previous_headings":"Internal options","what":"crayon.enabled","title":"Configuration (internal)","text":"Deprecated option turn ANSI colors /. still supported cli new options set. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"crayon-hyperlink","dir":"Articles","previous_headings":"Internal options","what":"crayon.hyperlink","title":"Configuration (internal)","text":"Whether assume ANSI hyperlink support. See [ansi_has_hyperlink_support()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"knitr-in-progress","dir":"Articles","previous_headings":"Internal options","what":"knitr.in.progress","title":"Configuration (internal)","text":"Used detect knitr detecting interactive sessions ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-internal.html","id":"rstudio-notebook-executing","dir":"Articles","previous_headings":"Internal options","what":"rstudio.notebook.executing","title":"Configuration (internal)","text":"Used detect knitr detecting interactive sessions.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_hyperlink_mode","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_HYPERLINK_MODE","title":"Configuration","text":"Set posix force generating POSIX compatible ANSI hyperlinks. set, RStudio compatible links generated. temporary crutch RStudio handles POSIX hyperlinks correctly, removed.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"no_color","dir":"Articles","previous_headings":"User facing environment variables","what":"NO_COLOR","title":"Configuration","text":"Set nonempty value turn ANSI colors. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"ess_background_mode","dir":"Articles","previous_headings":"User facing environment variables","what":"ESS_BACKGROUND_MODE","title":"Configuration","text":"Set environment variable light dark indicate dark mode Emacs. https://github.com/emacs-ess/ESS/pull/1178 merged, ESS set automatically.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_dynamic","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_DYNAMIC","title":"Configuration","text":"Set true, TRUE True assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See [is_dynamic_tty()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_num_colors","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_NUM_COLORS","title":"Configuration","text":"Set positive integer assume given number colors. See [num_ansi_colors()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"r_cli_hyperlinks","dir":"Articles","previous_headings":"User facing environment variables","what":"R_CLI_HYPERLINKS","title":"Configuration","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See [style_hyperlink()].","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-ansi","dir":"Articles","previous_headings":"User facing options","what":"cli.ansi","title":"Configuration","text":"Set true, TRUE True assume terminal supports ANSI control sequences. Set anything else assume non-ANSI terminal. See [is_ansi_tty()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-condition_unicode_bullets","dir":"Articles","previous_headings":"User facing options","what":"cli.condition_unicode_bullets","title":"Configuration","text":"TRUE FALSE force turn Unicode symbols printing conditions. E.g. format_error(), format_warning(), format_message() also cli_abort(), cli_warn() cli_inform().","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-condition_width","dir":"Articles","previous_headings":"User facing options","what":"cli.condition_width","title":"Configuration","text":"Integer scalar (Inf) set console width cli formatting errors, warnings messages format_error(), format_warning() format_message(). formatting conditions option takes precedence cli.width.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-default_handler","dir":"Articles","previous_headings":"User facing options","what":"cli.default_handler","title":"Configuration","text":"General handler function cli conditions. See https://cli.r-lib.org/articles/semantic-cli.html#cli-messages-1","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-default_num_colors","dir":"Articles","previous_headings":"User facing options","what":"cli.default_num_colors","title":"Configuration","text":"Default number ANSI colors. value used number colors already set * cli.num_colors option, * R_CLI_NUM_COLORS environment variable, * crayon.enabled crayon.colors options, * NO_COLOR environment variable, * knitr..progress option, * sink() call stream. can also use option color support detected correctly, want adjust number colors. E.g. * crayon.enabled TRUE, crayon.colors , * Emacs Windows, * terminals. See [num_ansi_colors()]. See also cli.num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-dynamic","dir":"Articles","previous_headings":"User facing options","what":"cli.dynamic","title":"Configuration","text":"Set TRUE assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See [is_dynamic_tty()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-hide_cursor","dir":"Articles","previous_headings":"User facing options","what":"cli.hide_cursor","title":"Configuration","text":"Whether cli status bar try hide cursor terminals. Set FALSE hidden cursor causes issues.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-hyperlink","dir":"Articles","previous_headings":"User facing options","what":"cli.hyperlink","title":"Configuration","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See [style_hyperlink()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-ignore_unknown_rstudio_theme","dir":"Articles","previous_headings":"User facing options","what":"cli.ignore_unknown_rstudio_theme","title":"Configuration","text":"Set TRUE omit warning unknown RStudio theme code_highlight().","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-num_colors","dir":"Articles","previous_headings":"User facing options","what":"cli.num_colors","title":"Configuration","text":"Number ANSI colors. See [num_ansi_colors()]. See also cli.default_num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-message_class","dir":"Articles","previous_headings":"User facing options","what":"cli.message_class","title":"Configuration","text":"Character vector classes add cli’s conditions.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_bar_style","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_bar_style","title":"Configuration","text":"Progress bar style. See [cli_progress_styles()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_bar_style_ascii","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_bar_style_ascii","title":"Configuration","text":"Progress bar style ASCII consoles. See [cli_progress_styles()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_bar_style_unicode","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_bar_style_unicode","title":"Configuration","text":"Progress bar style Unicode (UTF-8) consoles; See [cli_progress_styles()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_clear","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_clear","title":"Configuration","text":"Whether clear terminated progress bar screen dynamic terminals. See [cli_progress_bar()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_demo_live","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_demo_live","title":"Configuration","text":"Whether cli_progress_demo() show live demo, just record progress bar frames.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_download","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_download","title":"Configuration","text":"Default format string download progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_download_nototal","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_download_nototal","title":"Configuration","text":"Default format string download progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_iterator","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_iterator","title":"Configuration","text":"Default format string iterator progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_iterator_nototal","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_iterator_nototal","title":"Configuration","text":"Default format string iterator progress bars unknown total number progress units.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_tasks","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_tasks","title":"Configuration","text":"Default format string tasks progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_format_tasks_nototal","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_format_tasks_nototal","title":"Configuration","text":"Default format string tasks progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_handlers","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_handlers","title":"Configuration","text":"Progress handlers try. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_handlers_force","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_handlers_force","title":"Configuration","text":"Progress handlers always used, even another handler already selected. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_handlers_only","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_handlers_only","title":"Configuration","text":"Progress handlers force, ignoring handlers set cli.progress_handlers cli.progress_handlers_force. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_say_args","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_say_args","title":"Configuration","text":"Command line arguments say progress handlers. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_say_command","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_say_command","title":"Configuration","text":"External command use say progress handler. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_say_frequency","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_say_frequency","title":"Configuration","text":"Minimum delay say calls say progress handler. say ignores frequent updates, keep speech comprehensible. See [cli_progress_builtin_handlers()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-progress_show_after","dir":"Articles","previous_headings":"User facing options","what":"cli.progress_show_after","title":"Configuration","text":"Delay showing progress bar, seconds. Progress bars finish delay shown . cli also shows progress bars 50% go half delay passed.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-spinner","dir":"Articles","previous_headings":"User facing options","what":"cli.spinner","title":"Configuration","text":"Default spinner use, see [get_spinner()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-spinner_ascii","dir":"Articles","previous_headings":"User facing options","what":"cli.spinner_ascii","title":"Configuration","text":"Default spinner use ASCII terminals, see [get_spinner()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-spinner_unicode","dir":"Articles","previous_headings":"User facing options","what":"cli.spinner_unicode","title":"Configuration","text":"Default spinner use Unicode terminals, see [get_spinner()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-theme","dir":"Articles","previous_headings":"User facing options","what":"cli.theme","title":"Configuration","text":"Default cli theme, addition built-theme. option intended package developers. See [themes] [start_app()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-theme_dark","dir":"Articles","previous_headings":"User facing options","what":"cli.theme_dark","title":"Configuration","text":"Whether cli assume dark theme builtin theme. See [builtin_theme()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-unicode","dir":"Articles","previous_headings":"User facing options","what":"cli.unicode","title":"Configuration","text":"Whether assume Unicode terminal. set, auto-detected. See [is_utf8_output()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-user_theme","dir":"Articles","previous_headings":"User facing options","what":"cli.user_theme","title":"Configuration","text":"cli user theme. option intended end users. See [themes].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-warn_inline_newlines","dir":"Articles","previous_headings":"User facing options","what":"cli.warn_inline_newlines","title":"Configuration","text":"Whether emit warning cli replaces newline characters spaces within {.class } inline style. Defaults FALSE.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"cli-width","dir":"Articles","previous_headings":"User facing options","what":"cli.width","title":"Configuration","text":"Terminal width assume. set, auto-detected. See [console_width()].","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"rlib_interactive","dir":"Articles","previous_headings":"User facing options","what":"rlib_interactive","title":"Configuration","text":"Whether assume interactive R session. set, auto-detected.","code":""},{"path":"https://cli.r-lib.org/dev/articles/cli-config-user.html","id":"width","dir":"Articles","previous_headings":"User facing options","what":"width","title":"Configuration","text":"Terminal width. used platforms, cli.width set.","code":""},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"built-in-palettes","dir":"Articles","previous_headings":"","what":"Built-in palettes","title":"cli color palettes","text":"vignette demonstrates various palettes included package look like easy visual reference. See ?ansi_palettes reference source use {cli}.","code":""},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"dichro","dir":"Articles","previous_headings":"Built-in palettes","what":"dichro","title":"cli color palettes","text":"Colorblind friendly palette, https://github.com/romainl/vim-dichromatic#dichromatic.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"vga","dir":"Articles","previous_headings":"Built-in palettes","what":"vga","title":"cli color palettes","text":"Typical colors used booting PCs leaving text mode, used 16-entry color table. colors different EGA/VGA graphic modes. https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"winxp","dir":"Articles","previous_headings":"Built-in palettes","what":"winxp","title":"cli color palettes","text":"Windows XP Console. Seen Windows XP Windows 8.1. https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"vscode","dir":"Articles","previous_headings":"Built-in palettes","what":"vscode","title":"cli color palettes","text":"Visual Studio Debug console, ‘Dark+’ theme. https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"win10","dir":"Articles","previous_headings":"Built-in palettes","what":"win10","title":"cli color palettes","text":"Campbell theme, used Windows 10 version 1709. Also usedby PowerShell 6.https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"macos","dir":"Articles","previous_headings":"Built-in palettes","what":"macos","title":"cli color palettes","text":"Terminal.app macOSFrom https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"putty","dir":"Articles","previous_headings":"Built-in palettes","what":"putty","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"mirc","dir":"Articles","previous_headings":"Built-in palettes","what":"mirc","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"xterm","dir":"Articles","previous_headings":"Built-in palettes","what":"xterm","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"ubuntu","dir":"Articles","previous_headings":"Built-in palettes","what":"ubuntu","title":"cli color palettes","text":"virtual terminals, /etc/vtrgb.https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"eclipse","dir":"Articles","previous_headings":"Built-in palettes","what":"eclipse","title":"cli color palettes","text":"https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-pastel","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-pastel","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-smoooooth","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-smoooooth","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-snazzy","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-snazzy","title":"cli color palettes","text":"https://github.com/sindresorhus/iterm2-snazzy.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-solarized","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-solarized","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/palettes.html","id":"iterm-tango","dir":"Articles","previous_headings":"Built-in palettes","what":"iterm-tango","title":"cli color palettes","text":"Built-iTerm2 theme.","code":"#> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"cli pluralization","text":"cli tools create messages printed correctly singular plural forms. usually requires minimal extra work, increases quality messages greatly. document first show pluralization examples can use guidelines. Hopefully intuitive enough, can used without knowing exact cli pluralization rules. need pluralization without semantic cli functions, see pluralize() function.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"pluralization-markup","dir":"Articles","previous_headings":"Examples","what":"Pluralization markup","title":"cli pluralization","text":"simplest case message contains single {} glue substitution, specifies quantity used select singular plural forms. Pluralization uses markup similar glue, uses {? } delimiters: value nfile used decide whether singular plural form file used. common case English messages.","code":"library(cli) nfile <- 0; cli_text(\"Found {nfile} file{?s}.\") #> Found 0 files. nfile <- 1; cli_text(\"Found {nfile} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {nfile} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"irregular-plurals","dir":"Articles","previous_headings":"Examples","what":"Irregular plurals","title":"cli pluralization","text":"plural form difficult simple s suffix, singular plural forms can given, separated forward slash:","code":"ndir <- 1; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 1 directory. ndir <- 5; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 5 directories."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"use-no-instead-of-zero","dir":"Articles","previous_headings":"Examples","what":"Use \"no\" instead of zero","title":"cli pluralization","text":"readability, better use () helper function include count message. () prints word \"\" count zero, prints numeric count otherwise:","code":"nfile <- 0; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found no files. nfile <- 1; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"use-the-length-of-character-vectors","dir":"Articles","previous_headings":"Examples","what":"Use the length of character vectors","title":"cli pluralization","text":"auto-collapsing feature cli easy include list objects message. cli interprets character vector pluralization quantity, takes length vector: Note length used non-numeric vectors (.numeric(x) return FALSE). want use length numeric vector, convert character via .character(). can combine collapsed vectors \"\", like : pluralization markup contains three alternatives, like , first one used zero, second one, third one larger quantities.","code":"pkgs <- \"pkg1\" cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1 package. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. pkgs <- character() cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove no packages. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages."},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"choosing-the-right-quantity","dir":"Articles","previous_headings":"Examples","what":"Choosing the right quantity","title":"cli pluralization","text":"text contains multiple glue {} substitutions, one right pluralization markup used. example: sometimes correct one. can explicitly specify correct quantity using qty() function. sets quantity without printing anything: Note message contains single {} substitution, may appear pluralization markup. message contains multiple {} substitutions pluralization markup, error thrown. Similarly, message contains {} substitutions , pluralization markup, error thrown.","code":"nfiles <- 3; ndirs <- 1 cli_text(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}\") #> Found 3 files and 1 directory nupd <- 3; ntotal <- 10 cli_text(\"{nupd}/{ntotal} {qty(nupd)} file{?s} {?needs/need} updates\") #> 3/10 files need updates"},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"rules","dir":"Articles","previous_headings":"","what":"Rules","title":"cli pluralization","text":"exact rules cli pluralization. two sets rules. first set specifies quantity associated {?} pluralization markup. second set describes {?} parsed interpreted.","code":""},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"quantities","dir":"Articles","previous_headings":"Rules","what":"Quantities","title":"cli pluralization","text":"{} substitutions define quantities. value {} substitution numeric (.numeric(x) holds), length one define quantity. enforced {} substitution used pluralization. quantity defined value {} , rounded .integer(). value {} numeric, quantity defined length. message {?} markup {} substitution, error thrown. message exactly one {} substitution, value used pluralization quantity {?} markup message. message multiple {} substitutions, {?} markup cli uses quantity {} substitution precedes . message multiple {} substitutions pluralization markup without preceding {} substitution, error thrown.","code":""},{"path":"https://cli.r-lib.org/dev/articles/pluralization.html","id":"pluralization-markup-1","dir":"Articles","previous_headings":"Rules","what":"Pluralization markup","title":"cli pluralization","text":"Pluralization markup starts {? ends }. may contain { } characters, may contain {} substitutions either. Alternative words suffixes separated /. single alternative, nothing used quantity == 1 single alternative used quantity != 1. two alternatives, first one used quantity == 1, second one quantity != 1 (including `quantity == 0). three alternatives, first one used quantity == 0, second one quantity == 1, third one otherwise.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"overhead","dir":"Articles","previous_headings":"","what":"Overhead","title":"Advanced cli progress bars","text":"cli progress bars overhead may may significant use case. R API, tight loop, update progress bar often.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"minimizing-overhead","dir":"Articles","previous_headings":"Overhead","what":"Minimizing overhead","title":"Advanced cli progress bars","text":"minimize progress bar overhead, cli_progress_update() uses internal timer update progress bar screen timer due. C code, can refer timer directly avoid update. CLI_SHOULD_TICK macro evaluates one timer due update needed, otherwise zero. CLI_SHOULD_TICK works already created cli progress bar C, called cli_progress_init_timer(). latter initializes cli timer without creating progress bar. (timer initialized, CLI_SHOULD_TICK evaluates zero.)","code":"SEXP bar = PROTECT(cli_progress_bar(num_iters, NULL)); for (i = 0; i < num_iters; i++) { if (CLI_SHOULD_TICK) cli_progress_set(bar, i); // ... } cli_progress_done(bar);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"non-interactive-r-sessions","dir":"Articles","previous_headings":"","what":"Non-interactive R sessions","title":"Advanced cli progress bars","text":"cli output different terminal platform dynamic, .e. support \\r character move cursor beginning line without starting new line. often happens R running non-interactively standard error redirected file. cli uses cli::is_dynamic_tty() function determine output supports \\r. non-dynamic terminal, cli simply prints progress updates new lines screen. Frequently updating progress fashion produce lot output, non-dynamic terminals cli falls back slower timer update interval. default cli timer signals every 3000 milliseconds R session without dynamic terminal, instead 200 milliseconds.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"progress-bars-in-scripts","dir":"Articles","previous_headings":"","what":"Progress bars in scripts","title":"Advanced cli progress bars","text":"can use progress bars R scripts, just like use R packages. R script might create progress bar global environment, instead within function call. global environment also current progress bar, create progress bar global environment, previous one environment terminated. However, function return , last progress bar script terminated script terminates, explicitly terminate using cli_progress_done().","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"customization","dir":"Articles","previous_headings":"","what":"Customization","title":"Advanced cli progress bars","text":"cli progress bars can customized developer end user, setting options, providing function arguments regular cli themes. aspects can customized developer, others can customized end user. Others can customized , end user’s setting taking precedence.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"about-progress-bar-types","dir":"Articles","previous_headings":"Customization > Developer customization","what":"About progress bar types","title":"Advanced cli progress bars","text":"progress bar type default display (format string), can configured end user. current progress bar types , default display, known unknown number total progress units.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"iterator","dir":"Articles","previous_headings":"Customization > Developer customization","what":"iterator","title":"Advanced cli progress bars","text":"Typically loops mapping functions. shows bar default, total number iterations known.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"tasks","dir":"Articles","previous_headings":"Customization > Developer customization","what":"tasks","title":"Advanced cli progress bars","text":"list tasks, default shows current/total display.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"download","dir":"Articles","previous_headings":"Customization > Developer customization","what":"download","title":"Advanced cli progress bars","text":"downloads, progress units shown bytes default .","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom","dir":"Articles","previous_headings":"Customization > Developer customization","what":"custom","title":"Advanced cli progress bars","text":"custom displays, developer specify format string custom progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-format-strings-by-the-developer","dir":"Articles","previous_headings":"Customization > Developer customization","what":"Custom format strings (by the developer)","title":"Advanced cli progress bars","text":"developer can specify custom format string progress bar. custom progress bars, compulsory. Format strings may use glue templating, cli pluralization cli theming. can also use number built-cli progress variables, see ‘Progress variables’ . custom progress bars cli always uses specified format string. types, end user might customize format string, see .","code":"f <- function() { cli_progress_bar( total = 20000, format = \"Step {step} | {pb_bar} {pb_percent}\" ) step <- 1 for (i in 1:10000) { Sys.sleep(2/10000) cli_progress_update(set = i) } step <- 2 for (i in 10001:20000) { Sys.sleep(2/10000) cli_progress_update(set = i) } } f()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"quick-loops","dir":"Articles","previous_headings":"Customization > End user customization","what":"Quick loops","title":"Advanced cli progress bars","text":"cli.progress_show_after (default two seconds) option number seconds wait showing progress bar.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-bars","dir":"Articles","previous_headings":"Customization > End user customization","what":"Custom bars","title":"Advanced cli progress bars","text":"end user can customize progress bar look, setting one following options: cli.progress_bar_style cli.progress_bar_style_unicode cli.progress_bar_style_ascii UTF-8 displays cli.progress_bar_style_unicode used, set. Otherwise cli.progress_bar_style used. non UTF-8 displays cli.progress_bar_style_ascii used, set. Otherwise cli.progress_bar_style used. options can set built-progress bar style name: Alternatively, can set list entries complete, incomplete current, specify characters (strings) parts progress bar:","code":"names(cli_progress_styles()) #> [1] \"classic\" \"squares\" \"dot\" \"fillsquares\" \"bar\" options(cli.progress_bar_style = \"fillsquares\") f <- function() lapply(cli_progress_along(letters), function(l) Sys.sleep(0.2)) x <- f() options(cli.progress_bar_style = list( complete = cli::col_yellow(\"\\u2605\"), incomplete = cli::col_grey(\"\\u00b7\") )) f <- function() lapply(cli_progress_along(letters), function(l) Sys.sleep(0.2)) x <- f()"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-spinners","dir":"Articles","previous_headings":"Customization > End user customization","what":"Custom spinners","title":"Advanced cli progress bars","text":"Options customize cli spinners: cli.spinner cli.spinner_unicode cli.spinner_ascii UTF-8 displays cli.spinner_unicode used, set, otherwise cli.spinner. ASCII displays cli.spinner_ascii used, set, otherwise cli.spinner. Use list_spinners() list spinners demo_spinners() take peek .","code":"options(cli.spinner = \"moon\") f <- function() { cli_progress_bar(format = strrep(\"{cli::pb_spin} \", 20), clear = TRUE) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"custom-format-strings","dir":"Articles","previous_headings":"Customization > End user customization","what":"Custom format strings","title":"Advanced cli progress bars","text":"end user may use number global options customize built-progress bar types displayed screen: cli.progress_format_iterator used iterator progress bars. cli.progress_format_iterator_nototal used iterator progress bars unknown number total units. cli.progress_format_tasks used tasks progress bars. cli.progress_format_tasks_nototal used tasks progress bars unknown number total units. cli.progress_format_download used download progress bars. cli.progress_format_download_nototal used download progress bars unknown number total units.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"progress-variables","dir":"Articles","previous_headings":"Customization","what":"Progress variables","title":"Advanced cli progress bars","text":"Custom format strings may use progress variables glue interpolated expressions, refer state progress bar. See ?\"progress-variables\" manual list supported variables. refer progress variable package, need need import qualify reference cli::. set custom format string end user option, suggest always use qualified form, case cli package attached. example, set minimal display downloads might write get can use expressions functions progress bar tokens. E.g. show current number steps letters instead numbers, use letters[pb_current]:","code":"options(cli.progress_format_download = paste0( \"{cli::col_cyan('\\u2B07')} {cli::pb_spin} \", \"{cli::pb_name}[{cli::pb_current_bytes}/{cli::pb_total_bytes}]\" ) ) f <- function() { cli_progress_bar( total = 26, format = \"{pb_spin} This is step {.emph {letters[pb_current]}}. {pb_spin}\" ) for (i in 1:26) { Sys.sleep(3/26) cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"clearing-or-keeping-terminated-progress-bars","dir":"Articles","previous_headings":"Customization","what":"Clearing or keeping terminated progress bars","title":"Advanced cli progress bars","text":"default terminated progress bars removed screen. end user can set cli.progress_clear option FALSE override default. addition, developer can also change default, using clear parameter cli_progress_bar(). option parameter set, parameter used.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"the-c-api","dir":"Articles","previous_headings":"","what":"The C API","title":"Advanced cli progress bars","text":"use C cli progress API package, need add cli LinkingTo Imports: C files want use API include cli/progress.h: Now ready call cli functions. C API similar traditional R API: cli_progress_bar() creates progress bar. cli_progress_update() updates progress bar. cli_progress_done() terminates . complete example:","code":"LinkingTo: cli Imports: cli #include SEXP progress_test1() { int i; SEXP bar = PROTECT(cli_progress_bar(1000, NULL)); for (i = 0; i < 1000; i++) { cli_progress_sleep(0, 4 * 1000 * 1000); if (CLI_SHOULD_TICK) cli_progress_set(bar, i); } cli_progress_done(bar); UNPROTECT(1); return Rf_ScalarInteger(i); }"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_should_tick","dir":"Articles","previous_headings":"The C API > C API reference","what":"CLI_SHOULD_TICK","title":"Advanced cli progress bars","text":"macro evaluates (int) 1 cli progress bar update due, (int) 0 otherwise. timer hasn’t initialized compilation unit yet, always 0. initialize timer, call cli_progress_init_timer() create progress bar cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_add","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_add()","title":"Advanced cli progress bars","text":"Add number progress units progress bar. also trigger update update due. bar: progress bar object. inc: progress increment.","code":"void cli_progress_add(SEXP bar, double inc);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_bar","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_bar()","title":"Advanced cli progress bars","text":"Create new progress bar object. returned progress bar object must PROTECT()-ed. total: Total number progress units. Use NA_REAL known. config: R named list object additional parameters. May NULL (C NULL~) orR_NilValue(RNULL`) defaults. config may contain following entries: name: progress bar name. status: (initial) progress bar status. type: progress bar type. total: total number progress units. show_after: show progress bar specified number seconds. overrides global show_after option. format: format string, must specified custom progress bars. format_done: format string successful termination. format_failed: format string unsuccessful termination. clear: whether remove progress bar screen termination. auto_terminate: whether terminate progress bar number current units equals number total progress units.","code":"SEXP cli_progress_bar(double total, SEXP config);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"example","dir":"Articles","previous_headings":"The C API > C API reference > cli_progress_bar()","what":"Example","title":"Advanced cli progress bars","text":"","code":"#include SEXP progress_test1() { int i; SEXP bar = PROTECT(cli_progress_bar(1000, NULL)); for (i = 0; i < 1000; i++) { cli_progress_sleep(0, 4 * 1000 * 1000); if (CLI_SHOULD_TICK) cli_progress_set(bar, i); } cli_progress_done(bar); UNPROTECT(1); return Rf_ScalarInteger(i); }"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_done","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_done()","title":"Advanced cli progress bars","text":"Terminate progress bar. bar: progress bar object.","code":"void cli_progress_done(SEXP bar);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_init_timer","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_init_timer()","title":"Advanced cli progress bars","text":"Initialize cli timer without creating progress bar.","code":"void cli_progress_init_timer();"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_num","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_num()","title":"Advanced cli progress bars","text":"Returns number currently active progress bars.","code":"int cli_progress_num();"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set()","title":"Advanced cli progress bars","text":"Set progress bar specified number progress units. bar: progress bar object. set: number current progress progress units.","code":"void cli_progress_set(SEXP bar, double set);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_clear","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_clear()","title":"Advanced cli progress bars","text":"Set whether remove progress bar screen. can call time cli_progress_done() called. bar: progress bar object. clear: whether remove progress bar screen, zero one.","code":"void cli_progress_set_clear(SEXP bar, int clear);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_format","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_format()","title":"Advanced cli progress bars","text":"Set custom format string progress bar. call try update progress bar. want request update, call cli_progress_add(), cli_progress_set() cli_progress_update(). bar: progress bar object. format: format string. ...: values substitute format. format ... passed vsnprintf() create format string. Format strings may contain glue substitutions, referring progress variables, pluralization, cli styling.","code":"void cli_progress_set_format(SEXP bar, const char *format, ...);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_name","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_name()","title":"Advanced cli progress bars","text":"Set name progress bar. bar; progress bar object. name: progress bar name.","code":"void cli_progress_set_name(SEXP bar, const char *name);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_status","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_status()","title":"Advanced cli progress bars","text":"Set status progress bar. bar: progress bar object. status: progress bar status.","code":"void cli_progress_set_status(SEXP bar, const char *status);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_set_type","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_set_type()","title":"Advanced cli progress bars","text":"Set progress bar type. Call function right creating progress bar cli_progress_bar(). Otherwise behavior undefined. bar: progress bar object. type: progress bar type. Possible progress bar types: iterator, tasks, download custom.","code":"void cli_progress_set_type(SEXP bar, const char *type);"},{"path":"https://cli.r-lib.org/dev/articles/progress-advanced.html","id":"cli_progress_update","dir":"Articles","previous_headings":"The C API > C API reference","what":"cli_progress_update()","title":"Advanced cli progress bars","text":"Update progress bar. Unlike simpler cli_progress_add() cli_progress_set() function, can force update force set 1. bar: progress bar object. set: number current progress units. ignored negative. inc: increment add current number progress units. ignored set negative. force: whether force update, even update due. force update without changing current number progress units, supply set = -1, inc = 0 force = 1.","code":"void cli_progress_update(SEXP bar, double set, double inc, int force);"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"cli progress bar benchmark","text":"make sure timer TRUE, setting ten hours.","code":"library(cli) # 10 hours cli:::cli_tick_set(10 * 60 * 60 * 1000) cli_tick_reset() #> NULL `__cli_update_due` #> [1] FALSE"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"the-timer","dir":"Articles","previous_headings":"R benchmarks","what":"The timer","title":"cli progress bar benchmark","text":"","code":"fun <- function() NULL ben_st <- bench::mark( `__cli_update_due`, fun(), .Call(ccli_tick_reset), interactive(), check = FALSE ) ben_st #> # A tibble: 4 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 __cli_update_due 8.96ns 20ns 54252984. 0B 0 #> 2 fun() 130.04ns 151ns 4723967. 0B 0 #> 3 .Call(ccli_tick_reset) 99.88ns 120ns 7845446. 0B 0 #> 4 interactive() 8.96ns 20ns 61376404. 0B 0 ben_st2 <- bench::mark( if (`__cli_update_due`) foobar() ) ben_st2 #> # A tibble: 1 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 if (`__cli_update_due`) fooba… 40ns 50.1ns 20255296. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"cli_progress_along","dir":"Articles","previous_headings":"R benchmarks","what":"cli_progress_along()","title":"cli progress bar benchmark","text":"","code":"seq <- 1:100000 ta <- cli_progress_along(seq) bench::mark(seq[[1]], ta[[1]]) #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 seq[[1]] 120ns 140ns 6595195. 0B 0 #> 2 ta[[1]] 140ns 160ns 5830179. 0B 0"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"for-loop","dir":"Articles","previous_headings":"R benchmarks > cli_progress_along()","what":"for loop","title":"cli progress bar benchmark","text":"baseline: progress bars: Overhead per iteration:","code":"f0 <- function(n = 1e5) { x <- 0 seq <- 1:n for (i in seq) { x <- x + i %% 2 } x } fp <- function(n = 1e5) { x <- 0 seq <- 1:n for (i in cli_progress_along(seq)) { x <- x + seq[[i]] %% 2 } x } ben_taf <- bench::mark(f0(), fp()) ben_taf #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 12ms 12ms 82.7 21.6KB 372. #> 2 fp() 13.9ms 14.1ms 70.0 82.4KB 350. (ben_taf$median[2] - ben_taf$median[1]) / 1e5 #> [1] 20.6ns ben_taf2 <- bench::mark(f0(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_taf2 #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 134ms 145ms 6.36 0B 52.5 #> 2 fp(1e+06) 148ms 152ms 6.61 1.93KB 54.6 (ben_taf2$median[2] - ben_taf2$median[1]) / 1e6 #> [1] 6.76ns ben_taf3 <- bench::mark(f0(1e7), fp(1e7)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_taf3 #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+07) 1.46s 1.46s 0.683 0B 57.4 #> 2 fp(1e+07) 1.59s 1.59s 0.629 1.93KB 51.6 (ben_taf3$median[2] - ben_taf3$median[1]) / 1e7 #> [1] 12.6ns ben_taf4 <- bench::mark(f0(1e8), fp(1e8)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_taf4 #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+08) 13.8s 13.8s 0.0723 0B 36.0 #> 2 fp(1e+08) 15.1s 15.1s 0.0663 1.93KB 32.9 (ben_taf4$median[2] - ben_taf4$median[1]) / 1e8 #> [1] 12.5ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"mapping-with-lapply","dir":"Articles","previous_headings":"R benchmarks > cli_progress_along()","what":"Mapping with lapply()","title":"cli progress bar benchmark","text":"baseline: index vector: progress bars: Overhead per iteration:","code":"f0 <- function(n = 1e5) { seq <- 1:n ret <- lapply(seq, function(x) { x %% 2 }) invisible(ret) } f01 <- function(n = 1e5) { seq <- 1:n ret <- lapply(seq_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } fp <- function(n = 1e5) { seq <- 1:n ret <- lapply(cli_progress_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } ben_tam <- bench::mark(f0(), f01(), fp()) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_tam #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 78.7ms 91.3ms 10.8 781KB 23.4 #> 2 f01() 126.7ms 128.5ms 6.49 781KB 14.6 #> 3 fp() 97.9ms 106.4ms 8.87 783KB 14.2 (ben_tam$median[3] - ben_tam$median[1]) / 1e5 #> [1] 151ns ben_tam2 <- bench::mark(f0(1e6), f01(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_tam2 #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 848.49ms 848.49ms 1.18 7.63MB 3.54 #> 2 f01(1e+06) 1.04s 1.04s 0.964 7.63MB 5.79 #> 3 fp(1e+06) 1.42s 1.42s 0.702 7.63MB 4.21 (ben_tam2$median[3] - ben_tam2$median[1]) / 1e6 #> [1] 575ns (ben_tam2$median[3] - ben_tam2$median[2]) / 1e6 #> [1] 387ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"mapping-with-purrr","dir":"Articles","previous_headings":"R benchmarks > cli_progress_along()","what":"Mapping with purrr","title":"cli progress bar benchmark","text":"baseline: index vector: progress bars: Overhead per iteration:","code":"f0 <- function(n = 1e5) { seq <- 1:n ret <- purrr::map(seq, function(x) { x %% 2 }) invisible(ret) } f01 <- function(n = 1e5) { seq <- 1:n ret <- purrr::map(seq_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } fp <- function(n = 1e5) { seq <- 1:n ret <- purrr::map(cli_progress_along(seq), function(i) { seq[[i]] %% 2 }) invisible(ret) } ben_pur <- bench::mark(f0(), f01(), fp()) ben_pur #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 66.8ms 67ms 14.8 1.11MB 8.88 #> 2 f01() 83.7ms 84.4ms 11.8 781.3KB 5.90 #> 3 fp() 88.2ms 88.2ms 11.3 783.29KB 17.0 (ben_pur$median[3] - ben_pur$median[1]) / 1e5 #> [1] 212ns (ben_pur$median[3] - ben_pur$median[2]) / 1e5 #> [1] 37.5ns ben_pur2 <- bench::mark(f0(1e6), f01(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_pur2 #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 823.77ms 823.77ms 1.21 7.63MB 3.64 #> 2 f01(1e+06) 1.05s 1.05s 0.948 7.63MB 2.85 #> 3 fp(1e+06) 2.68s 2.68s 0.373 7.63MB 1.87 (ben_pur2$median[3] - ben_pur2$median[1]) / 1e6 #> [1] 1.86µs (ben_pur2$median[3] - ben_pur2$median[2]) / 1e6 #> [1] 1.63µs"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"ticking","dir":"Articles","previous_headings":"R benchmarks","what":"ticking()","title":"cli progress bar benchmark","text":"","code":"f0 <- function(n = 1e5) { i <- 0 x <- 0 while (i < n) { x <- x + i %% 2 i <- i + 1 } x } fp <- function(n = 1e5) { i <- 0 x <- 0 while (ticking(i < n)) { x <- x + i %% 2 i <- i + 1 } x } ben_tk <- bench::mark(f0(), fp()) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_tk #> # A tibble: 2 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 12.87ms 12.98ms 70.8 39.3KB 5.90 #> 2 fp() 4.09s 4.09s 0.245 99.9KB 2.93 (ben_tk$median[2] - ben_tk$median[1]) / 1e5 #> [1] 40.8µs"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"traditional-api","dir":"Articles","previous_headings":"R benchmarks","what":"Traditional API","title":"cli progress bar benchmark","text":"","code":"f0 <- function(n = 1e5) { x <- 0 for (i in 1:n) { x <- x + i %% 2 } x } fp <- function(n = 1e5) { cli_progress_bar(total = n) x <- 0 for (i in 1:n) { x <- x + i %% 2 cli_progress_update() } x } ff <- function(n = 1e5) { cli_progress_bar(total = n) x <- 0 for (i in 1:n) { x <- x + i %% 2 if (`__cli_update_due`) cli_progress_update() } x } ben_api <- bench::mark(f0(), ff(), fp()) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_api #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0() 11.99ms 12.46ms 64.8 18.7KB 7.85 #> 2 ff() 22.1ms 22.61ms 40.3 27.7KB 3.84 #> 3 fp() 2.29s 2.29s 0.437 25.2KB 3.06 (ben_api$median[3] - ben_api$median[1]) / 1e5 #> [1] 22.8µs (ben_api$median[2] - ben_api$median[1]) / 1e5 #> [1] 101ns ben_api2 <- bench::mark(f0(1e6), ff(1e6), fp(1e6)) #> Warning: Some expressions had a GC in every iteration; so filtering is #> disabled. ben_api2 #> # A tibble: 3 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 f0(1e+06) 123.4ms 123.5ms 8.06 0B 8.06 #> 2 ff(1e+06) 219.3ms 220.3ms 4.54 1.95KB 4.54 #> 3 fp(1e+06) 22.3s 22.3s 0.0449 1.95KB 2.47 (ben_api2$median[3] - ben_api2$median[1]) / 1e6 #> [1] 22.1µs (ben_api2$median[2] - ben_api2$median[1]) / 1e6 #> [1] 96.8ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"c-benchmarks","dir":"Articles","previous_headings":"","what":"C benchmarks","title":"cli progress bar benchmark","text":"Baseline function: Switch + modulo check: cli progress bar API:","code":"SEXP test_baseline() { int i; int res = 0; for (i = 0; i < 2000000000; i++) { res += i % 2; } return ScalarInteger(res); } SEXP test_modulo(SEXP progress) { int i; int res = 0; int progress_ = LOGICAL(progress)[0]; for (i = 0; i < 2000000000; i++) { if (i % 10000 == 0 && progress_) cli_progress_set(R_NilValue, i); res += i % 2; } return ScalarInteger(res); } SEXP test_cli() { int i; int res = 0; SEXP bar = PROTECT(cli_progress_bar(2000000000, NULL)); for (i = 0; i < 2000000000; i++) { if (CLI_SHOULD_TICK) cli_progress_set(bar, i); res += i % 2; } cli_progress_done(bar); UNPROTECT(1); return ScalarInteger(res); } SEXP test_cli_unroll() { int i = 0; int res = 0; SEXP bar = PROTECT(cli_progress_bar(2000000000, NULL)); int s, final, step = 2000000000 / 100000; for (s = 0; s < 100000; s++) { if (CLI_SHOULD_TICK) cli_progress_set(bar, i); final = (s + 1) * step; for (i = s * step; i < final; i++) { res += i % 2; } } cli_progress_done(bar); UNPROTECT(1); return ScalarInteger(res); } library(progresstest) ben_c <- bench::mark( test_baseline(), test_modulo(), test_cli(), test_cli_unroll() ) ben_c #> # A tibble: 4 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 test_baseline() 636.84ms 636.84ms 1.57 2.08KB 0 #> 2 test_modulo() 1.25s 1.25s 0.803 2.23KB 0 #> 3 test_cli() 1.25s 1.25s 0.803 23.91KB 0 #> 4 test_cli_unroll() 623.89ms 623.89ms 1.60 3.58KB 0 (ben_c$median[3] - ben_c$median[1]) / 2000000000 #> [1] 1ns"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"display-update","dir":"Articles","previous_headings":"","what":"Display update","title":"cli progress bar benchmark","text":"update display fixed number times per second. (Currently maximum five times per second.) Let’s measure long single update takes.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"iterator-with-a-bar","dir":"Articles","previous_headings":"Display update","what":"Iterator with a bar","title":"cli progress bar benchmark","text":"","code":"cli_progress_bar(total = 100000) bench::mark(cli_progress_update(force = TRUE), max_iterations = 10000) #> ■ 0% | ETA: 5m #> ■ 0% | ETA: 2h #> ■ 0% | ETA: 1h #> ■ 0% | ETA: 1h #> ■ 0% | ETA: 1h #> ■ 0% | ETA: 1h #> ■ 0% | ETA: 45m #> ■ 0% | ETA: 41m #> ■ 0% | ETA: 37m #> ■ 0% | ETA: 35m #> ■ 0% | ETA: 33m #> ■ 0% | ETA: 31m #> ■ 0% | ETA: 29m #> ■ 0% | ETA: 28m #> ■ 0% | ETA: 27m #> ■ 0% | ETA: 26m #> ■ 0% | ETA: 25m #> ■ 0% | ETA: 24m #> ■ 0% | ETA: 24m #> ■ 0% | ETA: 23m #> ■ 0% | ETA: 22m #> ■ 0% | ETA: 22m #> ■ 0% | ETA: 21m #> ■ 0% | ETA: 21m #> ■ 0% | ETA: 20m #> ■ 0% | ETA: 20m #> ■ 0% | ETA: 20m #> ■ 0% | ETA: 19m #> ■ 0% | ETA: 19m #> ■ 0% | ETA: 19m #> ■ 0% | ETA: 19m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 18m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 17m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 16m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 15m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> ■ 0% | ETA: 14m #> # A tibble: 1 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_progress_update(force = … 6.04ms 6.38ms 156. 1.41MB 2.08 cli_progress_done()"},{"path":"https://cli.r-lib.org/dev/articles/progress-benchmark.html","id":"iterator-without-a-bar","dir":"Articles","previous_headings":"Display update","what":"Iterator without a bar","title":"cli progress bar benchmark","text":"","code":"cli_progress_bar(total = NA) bench::mark(cli_progress_update(force = TRUE), max_iterations = 10000) #> ⠙ 1 done (423/s) | 3ms #> ⠹ 2 done (60/s) | 34ms #> ⠸ 3 done (71/s) | 43ms #> ⠼ 4 done (79/s) | 51ms #> ⠴ 5 done (85/s) | 60ms #> ⠦ 6 done (89/s) | 68ms #> ⠧ 7 done (93/s) | 76ms #> ⠇ 8 done (96/s) | 84ms #> ⠏ 9 done (98/s) | 93ms #> ⠋ 10 done (100/s) | 101ms #> ⠙ 11 done (102/s) | 109ms #> ⠹ 12 done (104/s) | 116ms #> ⠸ 13 done (106/s) | 123ms #> ⠼ 14 done (108/s) | 131ms #> ⠴ 15 done (109/s) | 138ms #> ⠦ 16 done (110/s) | 145ms #> ⠧ 17 done (112/s) | 153ms #> ⠇ 18 done (113/s) | 160ms #> ⠏ 19 done (114/s) | 168ms #> ⠋ 20 done (114/s) | 175ms #> ⠙ 21 done (115/s) | 183ms #> ⠹ 22 done (116/s) | 191ms #> ⠸ 23 done (116/s) | 198ms #> ⠼ 24 done (117/s) | 206ms #> ⠴ 25 done (117/s) | 213ms #> ⠦ 26 done (118/s) | 221ms #> ⠧ 27 done (118/s) | 229ms #> ⠇ 28 done (119/s) | 236ms #> ⠏ 29 done (119/s) | 244ms #> ⠋ 30 done (120/s) | 251ms #> ⠙ 31 done (120/s) | 259ms #> ⠹ 32 done (121/s) | 266ms #> ⠸ 33 done (121/s) | 274ms #> ⠼ 34 done (121/s) | 281ms #> ⠴ 35 done (122/s) | 289ms #> ⠦ 36 done (122/s) | 296ms #> ⠧ 37 done (122/s) | 303ms #> ⠇ 38 done (122/s) | 311ms #> ⠏ 39 done (123/s) | 319ms #> ⠋ 40 done (123/s) | 326ms #> ⠙ 41 done (123/s) | 334ms #> ⠹ 42 done (123/s) | 342ms #> ⠸ 43 done (123/s) | 350ms #> ⠼ 44 done (123/s) | 357ms #> ⠴ 45 done (123/s) | 365ms #> ⠦ 46 done (124/s) | 373ms #> ⠧ 47 done (124/s) | 380ms #> ⠇ 48 done (124/s) | 388ms #> ⠏ 49 done (124/s) | 395ms #> ⠋ 50 done (124/s) | 403ms #> ⠙ 51 done (124/s) | 411ms #> ⠹ 52 done (125/s) | 418ms #> ⠸ 53 done (125/s) | 426ms #> ⠼ 54 done (125/s) | 433ms #> ⠴ 55 done (125/s) | 441ms #> ⠦ 56 done (125/s) | 448ms #> ⠧ 57 done (125/s) | 456ms #> ⠇ 58 done (125/s) | 463ms #> ⠏ 59 done (125/s) | 471ms #> ⠋ 60 done (126/s) | 478ms #> ⠙ 61 done (126/s) | 485ms #> ⠹ 62 done (126/s) | 493ms #> ⠸ 63 done (126/s) | 500ms #> ⠼ 64 done (126/s) | 507ms #> ⠴ 65 done (125/s) | 519ms #> ⠦ 66 done (125/s) | 527ms #> ⠧ 67 done (126/s) | 534ms #> # A tibble: 1 × 6 #> expression min median `itr/sec` mem_alloc `gc/sec` #> #> 1 cli_progress_update(force = … 7.04ms 7.54ms 131. 265KB 2.02 cli_progress_done()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction to progress bars in cli","text":"document discusses structure simplest uses cli progress bar API. advanced usage C progress bar API, see ‘Advanced cli progress bars’ article manual pages. version 3.0.0 cli provides set functions create progress bars. main goals progress bar API : Reduce clutter. Try avoid verbose syntax, unless necessary. Flexibility R C/C++ code. Support cli features progress bars: glue interpolation, theming, pluralization, etc. Predictably small performance penalty. small constant penalty per iteration, reasonable penalty per second.","code":"library(cli) options(cli.progress_show_after = 0) options(cli.progress_clear = FALSE)"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"the-traditional-progress-bar-api","dir":"Articles","previous_headings":"","what":"The traditional progress bar API","title":"Introduction to progress bars in cli","text":"Add progress bar three steps: Call cli_progress_bar() add create progress bar. Call cli_progress_update() update . Call cli_progress_done() terminate . example: traditional API provides full control w.r.t create, update terminate progress bar.","code":"clean <- function() { cli_progress_bar(\"Cleaning data\", total = 100) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } cli_progress_done() } clean()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"the-current-progress-bar","dir":"Articles","previous_headings":"","what":"The current progress bar","title":"Introduction to progress bars in cli","text":"conciseness, progress bar functions refer current progress bar default. Every function one current progress bar time. current progress bar function terminated function creates another progress bar function returns, errors interrupted. current progress bar lets us omit cli_progress_done() call:","code":"clean <- function() { cli_progress_bar(\"Cleaning data #1\", total = 100) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } cli_progress_bar(\"Cleaning data #2\", total = 100) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } } clean()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"unknown-total-number-of-units","dir":"Articles","previous_headings":"","what":"Unknown total number of units","title":"Introduction to progress bars in cli","text":"cases total number progress units unknown, simply omit cli_progress_bar() (set NA). cli uses different display total unknown:","code":"walk_dirs <- function() { cli_progress_bar(\"Walking directories\") while (TRUE) { if (runif(1) < 0.01) break Sys.sleep(0.01) cli_progress_update() } cli_progress_update(force = TRUE) } walk_dirs()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"quick-loops","dir":"Articles","previous_headings":"","what":"Quick loops","title":"Introduction to progress bars in cli","text":"default, cli show progress bars terminated within two seconds creation. end user can configure limit cli.progress_show_after global option. example, document set limit zero seconds, progress bars shown first update.","code":""},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"progress-bars-for-mapping-functions-cli_progress_along","dir":"Articles","previous_headings":"","what":"Progress bars for mapping functions: cli_progress_along()","title":"Introduction to progress bars in cli","text":"cli_progress_along() currently experimental. add progress bar call lapply() another mapping function, wrap input sequence cli_progress_along(): cli_progress_along() works similarly seq_along(), returns index vector. use cli_progress_along(), lapply() pass indices elements X fun, instead elements . cli_progress_along() expects index vector used , beginning end. best never assign return value cli_progress_along() variable. example: cli_progress_along() uses ALTREP, works R 3.5.0 later. older R versions equivalent seq_along() create progress bar.","code":"lapply(cli_progress_along(X), fun) f <- function() { rawabc <- lapply( cli_progress_along(letters), function(i) { charToRaw(letters[i]) Sys.sleep(0.5) } ) } f()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"for-loops","dir":"Articles","previous_headings":"Progress bars for mapping functions: cli_progress_along()","what":"for loops","title":"Introduction to progress bars in cli","text":"can also use cli_progress_along() loops, additional complication use break, might need terminate progress bar explicitly: cli_progress_done() always returns TRUE allow form. Alternatively, can terminate progress bar right loop: function containing loop returns loop, create another progress bar cli_progress_along() cli_progress_bar(), explicit cli_progress_done() needed.","code":"for (i in cli_progress_along(seq)) { ... if (cond) cli_progress_done() && break ... } for (i in cli_progress_along(seq)) { ... if (cond) break ... } cli_progress_done()"},{"path":"https://cli.r-lib.org/dev/articles/progress.html","id":"simplified-api","dir":"Articles","previous_headings":"","what":"Simplified API","title":"Introduction to progress bars in cli","text":"Often don’t need full power progress bar API, want show status message. cli_progress_message() cli_progress_step() functions tailored . cli_progress_message() shows (potentially templated) message status bar. convenience, progress bar rules still apply default: Status messages removed calling function exits. status message removes previous status message progress bar caller function. Status messages may use glue interpolation, cli styling pluralization, usual. can call cli_progress_update() update status message. cli_progress_step() slightly different cli_progress_message(): * adds cli’s alert themes status messages (info, success danger), * prints duration step (default), * keeps messages screen terminated. usual, can use cli_progress_step() update existing status message. can update status message frequently enough, can also add spinner : cli_progress_step() automatically handles errors, styles status message accordingly:","code":"f <- function() { cli_progress_message(\"Task one is running...\") Sys.sleep(2) cli_progress_message(\"Task two is running...\") Sys.sleep(2) step <- 1L cli_progress_message(\"Task three is underway: step {step}\") for (step in 1:5) { Sys.sleep(0.5) cli_progress_update() } } f() f <- function() { cli_progress_step(\"Downloading data\") Sys.sleep(2) cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\") Sys.sleep(3) } f() f <- function(n = 10) { cli_alert_info(\"About to start downloads of {n} file{?s}\") i <- 0 cli_progress_step(\"Got {i}/{n} {qty(i)}file{?s}.\") for (i in seq_len(n)) { Sys.sleep(0.5) if (i == 5) cli_alert_info(\"Already half way!\") cli_progress_update() } } f() f <- function() { cli_progress_step(\"Downloading data\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(2/100) } cli_progress_step(\"Importing data\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(1/100) } cli_progress_step(\"Cleaning data\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(2/100) } cli_progress_step(\"Fitting model\", spinner = TRUE) for (i in 1:100) { cli_progress_update(); Sys.sleep(3/100) } } f() f <- function() { cli_progress_step(\"First step, this will succeed\") Sys.sleep(1) cli_progress_step(\"Second step, this will fail\") Sys.sleep(1) stop(\"Something is wrong here\") } f()"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Building a Semantic CLI","text":"cli package helps build command line interface (CLI) without getting lost details (colors, wrapping, spacing, etc.) piece output formatted. Instead, can build command line output semantic elements: lists, alerts, quotes code blocks, headers, etc. formatting element specified separately, one cli themes. cli comes builtin theme, satisfied , never need worry formatting. semantic cli similar HTML CSS work together create web site. introduction go functions create semantic CLI elements, also common features .","code":""},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"building-a-command-line-interface","dir":"Articles","previous_headings":"","what":"Building a command line interface","title":"Building a Semantic CLI","text":"build CLI, can simply start using cli_* functions create various CLI elements. exact formatting depends current theme, see ‘Theming’ .","code":"library(cli)"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"alerts","dir":"Articles","previous_headings":"Building a command line interface","what":"Alerts","title":"Building a Semantic CLI","text":"Alerts typically short messages. cli four types alerts (success, info, warning, danger) also generic alert type:","code":"cli_alert_success(\"Updated database.\") #> ✔ Updated database. cli_alert_info(\"Reopened database.\") #> ℹ Reopened database. cli_alert_warning(\"Cannot reach GitHub, using local database cache.\") #> ! Cannot reach GitHub, using local database cache. cli_alert_danger(\"Failed to connect to database.\") #> ✖ Failed to connect to database. cli_alert(\"A generic alert\") #> → A generic alert"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"text","dir":"Articles","previous_headings":"Building a command line interface","what":"Text","title":"Building a Semantic CLI","text":"Text automatically wrapped terminal width. Text may ANSI style markup,","code":"cli_text(cli:::lorem_ipsum()) #> Lorem ad ipsum veniam esse nisi deserunt duis. Qui incididunt elit elit mollit #> sint nulla consectetur aute commodo do elit laboris minim et. Laboris ipsum #> mollit voluptate et non do incididunt eiusmod. Anim consectetur mollit laborum #> occaecat eiusmod excepteur. Ullamco non tempor esse anim tempor magna non."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"paragraphs","dir":"Articles","previous_headings":"Building a command line interface","what":"Paragraphs","title":"Building a Semantic CLI","text":"Paragraphs break output. default theme inserts empty line paragraphs, single empty line added two paragraphs. cli_end() closes latest open paragraph (open container).","code":"fun <- function() { cli_par() cli_text(\"This is some text.\") cli_text(\"Some more text.\") cli_end() cli_par() cli_text(\"Already a new paragraph.\") cli_end() } fun() #> This is some text. #> Some more text. #> #> Already a new paragraph. #>"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"auto-closing-containers","dir":"Articles","previous_headings":"Building a command line interface","what":"Auto-closing containers","title":"Building a Semantic CLI","text":"paragraph (container, see ‘Generic containers’ later), opened within function, cli automatically closes end function, default. previous example last cli_end() call needed. Use .auto_close = FALSE cli_par() leave paragraph open calling function returns.","code":""},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"headings","dir":"Articles","previous_headings":"Building a command line interface","what":"Headings","title":"Building a Semantic CLI","text":"cli supports three levels headings. look default theme. default theme adds empty line headings, empty line cli_h1() cli_h2().","code":"cli_h1(\"Heading 1\") #> ── Heading 1 ─────────────────────────────────────────────────────────────────── cli_h2(\"Heading 2\") #> #> ── Heading 2 ── #> cli_h3(\"Heading 3\") #> ── Heading 3"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"interpolation","dir":"Articles","previous_headings":"Building a command line interface","what":"Interpolation","title":"Building a Semantic CLI","text":"cli text treated glue template, special formatters available (see ‘Inline text formatting’ Section):","code":"size <- 123143123 dt <- 1.3454 cli_alert_info(c( \"Downloaded {prettyunits::pretty_bytes(size)} in \", \"{prettyunits::pretty_sec(dt)}\")) #> ℹ Downloaded 123.14 MB in 1.3s"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"inline-text-formatting","dir":"Articles","previous_headings":"Building a command line interface","what":"Inline text formatting","title":"Building a Semantic CLI","text":"define inline markup, can use regular glue braces, opening brace, supply name markup formatter leading dot, e.g. emphasized text, use .emph. examples , see ?\"inline-markup\" details. combine inline markup string interpolation, need add another set braces: \"val\" special inline style, default theme calls cli_format() tailor conversion values strings. conversion can themed, see “Theming” .","code":"fun <- function() { cli_ul() cli_li(\"{.emph Emphasized} text\") cli_li(\"{.strong Strong} importance\") cli_li(\"A piece of code: {.code sum(a) / length(a)}\") cli_li(\"A package name: {.pkg cli}\") cli_li(\"A function name: {.fn cli_text}\") cli_li(\"A keyboard key: press {.kbd ENTER}\") cli_li(\"A file name: {.file /usr/bin/env}\") cli_li(\"An email address: {.email bugs.bunny@acme.com}\") cli_li(\"A URL: {.url https://acme.com}\") cli_li(\"An environment variable: {.envvar R_LIBS}\") cli_li(\"Some {.field field}\") } fun() #> • Emphasized text #> • Strong importance #> • A piece of code: `sum(a) / length(a)` #> • A package name: cli #> • A function name: `cli_text()` #> • A keyboard key: press [ENTER] #> • A file name: /usr/bin/env #> • An email address: bugs.bunny@acme.com #> • A URL: #> • An environment variable: `R_LIBS` #> • Some field dlurl <- \"https://httpbin.org/status/404\" cli_alert_danger(\"Failed to download {.url {dlurl}}.\") #> ✖ Failed to download . cli_div(theme = list(.val = list(digits = 2))) cli_text(\"Some random numbers: {.val {runif(4)}}.\") cli_end() #> Some random numbers: 0.07, 0.1, 0.32, and 0.52."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"inline-lists-of-items","dir":"Articles","previous_headings":"Building a command line interface","what":"Inline lists of items","title":"Building a Semantic CLI","text":"cli performs inline text formatting, automatically collapses glue substitutions, formatting. handy create lists files, packages, etc. default class names collapsed differently:","code":"pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Packages: {pkgs}.\") #> Packages: pkg1, pkg2, and pkg3. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Packages: {.pkg {pkgs}}\") #> Packages: pkg1, pkg2, and pkg3 x <- Sys.time() cli_text(\"Hey {.var x} has class {.cls {class(x)}}\") #> Hey `x` has class "},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"non-breaking-spaces","dir":"Articles","previous_headings":"Building a command line interface","what":"Non-breaking spaces","title":"Building a Semantic CLI","text":"Use \\u00a0 create non-breaking space. E.g. insert non-breaking spaces, mark X, easy see line breaks non-breaking space:","code":"# Make some spaces non-breaking, and mark them with X txt <- cli:::lorem_ipsum() mch <- gregexpr(txt, pattern = \" \", fixed = TRUE) nbs <- runif(length(mch[[1]])) < 0.5 regmatches(txt, mch)[[1]] <- ifelse(nbs, \"X\\u00a0\", \" \") cli_text(txt) #> Qui mollit anim est in deserunt adipisicing nostrud duis enimX deserunt.X Ad #> quiX quiX magna animX esse non anim magnaX Lorem.X Dolore laboreX cupidatat #> magnaX etX officiaX etX esse nullaX eiusmod Lorem #> exercitationX cupidatatX velitX enim. NostrudX elit id laborum #> dolore.X LoremX esse ea sint proident eu officiaX nisiX fugiat mollit in #> LoremX velit. Exercitation ipsum consectetur ad nisiX utX eu."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"lists","dir":"Articles","previous_headings":"Building a command line interface","what":"Lists","title":"Building a Semantic CLI","text":"cli three types list: ordered, unordered definition lists, see cli_ol(), cli_ul() cli_dl(): Item text wrapped terminal width:","code":"cli_ol(c(\"item 1\", \"item 2\", \"item 3\")) #> 1. item 1 #> 2. item 2 #> 3. item 3 cli_ul(c(\"item 1\", \"item 2\", \"item 3\")) #> • item 1 #> • item 2 #> • item 3 cli_dl(c(\"item 1\" = \"description 1\", \"item 2\" = \"description 2\", \"item 3\" = \"description 3\")) #> item 1: description 1 #> item 2: description 2 #> item 3: description 3 cli_ul(c(\"item 1\" = cli:::lorem_paragraph(1, 50), \"item 2\" = cli:::lorem_paragraph(1, 50))) #> • Officia ad. #> • Minim velit ullamco cupidatat eu ipsum adipisicing ea dolore ipsum consequat #> id irure irure nulla ea nostrud consequat dolor magna commodo proident #> excepteur ullamco est consectetur do quis laboris tempor in laboris Lorem id #> laboris exercitation culpa voluptate deserunt."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"adding-list-items-iteratively","dir":"Articles","previous_headings":"Building a command line interface > Lists","what":"Adding list items iteratively","title":"Building a Semantic CLI","text":"Items can added one one: cli_ul() call creates list container, items specified, leaves container open. items can added one one. (last cli_end() necessary, default containers auto-close calling function exits.)","code":"fun <- function() { lid <- cli_ul() cli_li(\"Item 1\") cli_li(\"Item 2\") cli_li(\"Item 3\") cli_end(lid) } fun() #> • Item 1 #> • Item 2 #> • Item 3"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"adding-text-to-an-item-iteratively","dir":"Articles","previous_headings":"Building a command line interface > Lists","what":"Adding text to an item iteratively","title":"Building a Semantic CLI","text":"cli_li() creates new container list item, within list container. can keep adding text item, container closed via cli_end() new cli_li(), closes current item container, creates another one new item:","code":"fun <- function() { cli_ul() cli_li(\"First item\") cli_text(\"This is still the first item\") cli_li(\"This is the second item\") } fun() #> • First item #> This is still the first item #> • This is the second item"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"nested-lists","dir":"Articles","previous_headings":"Building a command line interface > Lists","what":"Nested lists","title":"Building a Semantic CLI","text":"create nested lists, open nested containers: cli_end(olid), olid necessary, otherwise cli_end() close container list item.","code":"fun <- function() { cli_ol() cli_li(\"Item 1\") ulid <- cli_ul() cli_li(\"Subitem 1\") cli_li(\"Subitem 2\") cli_end(ulid) cli_li(\"Item 2\") cli_end() } fun() #> 1. Item 1 #> • Subitem 1 #> • Subitem 2 #> 2. Item 2"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"horizontal-rules","dir":"Articles","previous_headings":"Building a command line interface","what":"Horizontal rules","title":"Building a Semantic CLI","text":"cli_rule() creates horizontal rule. can use usual inline markup labels rule. rule’s appearance specified current theme. particular: added rule. added rule. color used color rule labels. (Use color within label text different label color.) background-color: background color rule labels. (, can use different background color within label .) margin-top, margin-bottom empty space rule. line-type specifies line type rule. See ?cli_rule line types.","code":"cli_rule(left = \"Compiling {.pkg mypackage}\") #> ── Compiling mypackage ─────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"the-status-bar","dir":"Articles","previous_headings":"Building a command line interface","what":"The status bar","title":"Building a Semantic CLI","text":"cli supports creating status bar last line console, terminal supports carriage return control character move cursor beginning line. supported terminals, RStudio, Emacs, RGui, R.app, etc. supported output file, e.g. typically CI systems. cli_status() creates new status bar, cli_status_update() updates status bar, cli_status_clear() clears . cli_status() returns id, can used cli_status_update() cli_status_clear() refer right status bar. possible create multiple status bars, typical terminal one can shown time. cli default shows one last created updated. status bar active, cli can still produce output, normal. output created “” status bar, always kept last line screen. See following example:","code":"f <- function() { cli_alert_info(\"About to start downloads.\") sb <- cli_status(\"{symbol$arrow_right} Downloading 10 files.\") for (i in 9:1) { Sys.sleep(0.5) if (i == 5) cli_alert_success(\"Already half-way!\") cli_status_update(id = sb, \"{symbol$arrow_right} Got {10-i} file{?s}, downloading {i}\") } cli_status_clear(id = sb) cli_alert_success(\"Downloads done.\") } f()"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"theming","dir":"Articles","previous_headings":"","what":"Theming","title":"Building a Semantic CLI","text":"looks various CLI elements can changed via themes. cli package comes simple built-theme, new themes can added well.","code":""},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"tags-ids-and-classes","dir":"Articles","previous_headings":"Theming","what":"Tags, ids and classes","title":"Building a Semantic CLI","text":"Similarly HTML document, elements CLI form tree nodes. node exactly one tag, one id, optionally set classes. E.g. cli_par() creates node

      tag, cli_ol() creates node

        tag, etc. example CLI tree. always starts tag id \"body\", created automatically. cli theme named list, names selectors based tag names, ids classes, elements list style declarations. example, style

        tags looks like built-theme: See also ?cli::themes reference ?cli::simple_theme example theme.","code":"
          builtin_theme()$h1 #> $`font-weight` #> [1] \"bold\" #> #> $`margin-top` #> [1] 1 #> #> $`margin-bottom` #> [1] 0 #> #> $fmt #> function (x) #> cli::rule(x, line_col = \"cyan\") #> #> #>"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"generic-containers","dir":"Articles","previous_headings":"Theming","what":"Generic containers","title":"Building a Semantic CLI","text":"cli_div() generic container, produce output, can add new theme. theme removed
          node closed. (Like containers, cli_div() auto-closes calling function exits.)","code":"fun <- function() { cli_div(theme = list (.alert = list(color = \"red\"))) cli_alert(\"This will be red\") cli_end() cli_alert(\"Back to normal color\") } fun() #> → This will be red #> → Back to normal color"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"theming-inline-markup","dir":"Articles","previous_headings":"Theming","what":"Theming inline markup","title":"Building a Semantic CLI","text":"inline markup formatters always use tag, add name formatter class. addition adding inline markup explicitly, like .emph , cli can use class(es) substituted expression style automatically. can configured part theme, form mapping class() expression, name markup formatter. example, filename S3 class, can make sure always shown .file cli output:","code":"fun <- function() { cli_div(theme = list(span.emph = list(color = \"orange\"))) cli_text(\"This is very {.emph important}\") cli_end() cli_text(\"Back to the {.emph previous theme}\") } fun() #> This is very important #> Back to the previous theme fun <- function() { cli_div(theme = list(body = list(\"class-map\" = list(\"filename\" = \"file\")))) fns <- structure(c(\"file1\", \"file2\", \"file3\"), class = \"filename\") cli_text(\"Found some files: {fns}.\") cli_end() } fun() #> Found some files: file1, file2, and file3."},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"cli-messages","dir":"Articles","previous_headings":"","what":"CLI messages","title":"Building a Semantic CLI","text":"cli_*() functions implemented using standard R conditions. example cli_alert() call emits R condition class cli_message. messages can caught, muffled, transferred sub-process main R process. cli function called: cli throws cli_message condition. condition caught muffled (via cli_message_handled restart), nothing else happens. Otherwise cli.default_handler option checked function, called message. cli.default_handler option set, function, default cli handler called, shows text, alert, heading, etc. screen, using standard R message() function.","code":"tryCatch(cli_h1(\"Heading\"), cli_message = function(x) x) suppressMessages(cli_text(\"Not shown\")) #> "},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"sub-processes","dir":"Articles","previous_headings":"","what":"Sub-Processes","title":"Building a Semantic CLI","text":"cli_*() commands invoked sub-process via callr::r_session (see https://callr.r-lib.org), cli.message_class option set \"callr_message\", cli messages automatically copied main R process:","code":"rs <- callr::r_session$new() rs$run(function() { options(cli.message_class = \"callr_message\") cli::cli_text(\"This is sub-process {.emph {Sys.getpid()}} from {.pkg callr}\") Sys.getpid() }) invisible(rs$close()) #> This is sub-process 15568 from callr #> [1] 15568"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"ansi-colors","dir":"Articles","previous_headings":"Utility functions","what":"ANSI colors","title":"Building a Semantic CLI","text":"cli functions create ANSI colored styled output console. col_* functions change foreground color, bg_* functions change background color, style_* functions change style text way. functions concatenate arguments using paste0(), add cli_ansi_string class result: Foreground colors: Note might actually look different depending terminal theme. Background colors: Text styles: style_* functions supported terminals. Colors, background colors styles can combined: make_ansi_style() can create custom colors, assuming terminal supports . combine_ansi_styles() combines several styles function:","code":"cat(col_red(\"This \", \"is \", \"red.\"), sep = \"\\n\") #> This is red. cli_ul(c( col_black(\"black\"), col_blue(\"blue\"), col_cyan(\"cyan\"), col_green(\"green\"), col_magenta(\"magenta\"), col_red(\"red\"), col_white(\"white\"), col_yellow(\"yellow\"), col_grey(\"grey\") )) #> • black #> • blue #> • cyan #> • green #> • magenta #> • red #> • white #> • yellow #> • grey cli_ul(c( bg_black(\"black background\"), bg_blue(\"blue background\"), bg_cyan(\"cyan background\"), bg_green(\"green background\"), bg_magenta(\"magenta background\"), bg_red(\"red background\"), bg_white(\"white background\"), bg_yellow(\"yellow background\") )) #> • black background #> • blue background #> • cyan background #> • green background #> • magenta background #> • red background #> • white background #> • yellow background cli_ul(c( style_dim(\"dim style\"), style_blurred(\"blurred style\"), style_bold(\"bold style\"), style_hidden(\"hidden style\"), style_inverse(\"inverse style\"), style_italic(\"italic style\"), style_reset(\"reset style\"), style_strikethrough(\"strikethrough style\"), style_underline(\"underline style\") )) #> • dim style #> • blurred style #> • bold style #> • hidden style #> • inverse style #> • italic style #> • reset style #> • strikethrough style #> • underline style bg_white(style_bold(col_red(\"TITLE\"))) #> #> [1] TITLE col_warn <- combine_ansi_styles(make_ansi_style(\"pink\"), style_bold) col_warn(\"This is a warning in pink!\") cat(col_warn(\"This is a warning in pink!\")) #> #> [1] This is a warning in pink! #>"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"console-capabilities","dir":"Articles","previous_headings":"Utility functions","what":"Console capabilities","title":"Building a Semantic CLI","text":"Query console width: Query console supports ansi escapes: Hide cursor, console supports (-op otherwise): See also ansi_with_hidden_cursor(). Query console supports \\r: Query console supports UTF-8 output:","code":"console_width() #> [1] 80 is_ansi_tty() #> [1] TRUE ansi_hide_cursor() ansi_show_cursor() is_dynamic_tty() #> [1] TRUE is_utf8_output() #> [1] TRUE"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"unicode-characters","dir":"Articles","previous_headings":"Utility functions","what":"Unicode characters","title":"Building a Semantic CLI","text":"symbol variable includes Unicode characters often useful CLI messages. automatically fall back ASCII symbols platform support . can use symbols semantic cli_*() functions directly. list symbols: symbols inspired (copied ) awesome figures JavaScript project.","code":"cli_text(\"{symbol$tick} no errors | {symbol$cross} 2 warnings\") #> ✔ no errors | ✖ 2 warnings list_symbols() #> ✔tick ≠neq #> ✖cross ≥geq #> ★star ≤leq #> ▇square ×times #> ◻square_small ▔upper_block_1 #> ◼square_small_filled ▀upper_block_4 #> ◯circle ▁lower_block_1 #> ◉circle_filled ▂lower_block_2 #> ◌circle_dotted ▃lower_block_3 #> ◎circle_double ▄lower_block_4 #> ⓞcircle_circle ▅lower_block_5 #> ⓧcircle_cross ▆lower_block_6 #> Ⓘcircle_pipe ▇lower_block_7 #> ?⃝circle_question_mark █lower_block_8 #> •bullet █full_block #> ․dot ⁰sup_0 #> ─line ¹sup_1 #> ═double_line ²sup_2 #> …ellipsis ³sup_3 #> …continue ⁴sup_4 #> ❯pointer ⁵sup_5 #> ℹinfo ⁶sup_6 #> ⚠warning ⁷sup_7 #> ☰menu ⁸sup_8 #> ☺smiley ⁹sup_9 #> ෴mustache ⁻sup_minus #> ♥heart ⁺sup_plus #> ↑arrow_up ▶play #> ↓arrow_down ■stop #> ←arrow_left ●record #> →arrow_right ‒figure_dash #> ◉radio_on –en_dash #> ◯radio_off —em_dash #> ☒checkbox_on “dquote_left #> ☐checkbox_off ”dquote_right #> ⓧcheckbox_circle_on ‘squote_left #> Ⓘcheckbox_circle_off ’squote_right #> ❓fancy_question_mark"},{"path":"https://cli.r-lib.org/dev/articles/semantic-cli.html","id":"spinners","dir":"Articles","previous_headings":"Utility functions","what":"Spinners","title":"Building a Semantic CLI","text":"See list_spinners() get_spinner(). awesome cli-spinners project.","code":"list_spinners() #> [1] \"dots\" \"dots2\" \"dots3\" #> [4] \"dots4\" \"dots5\" \"dots6\" #> [7] \"dots7\" \"dots8\" \"dots9\" #> [10] \"dots10\" \"dots11\" \"dots12\" #> [13] \"dots13\" \"dots8Bit\" \"sand\" #> [16] \"line\" \"line2\" \"pipe\" #> [19] \"simpleDots\" \"simpleDotsScrolling\" \"star\" #> [22] \"star2\" \"flip\" \"hamburger\" #> [25] \"growVertical\" \"growHorizontal\" \"balloon\" #> [28] \"balloon2\" \"noise\" \"bounce\" #> [31] \"boxBounce\" \"boxBounce2\" \"triangle\" #> [34] \"arc\" \"circle\" \"squareCorners\" #> [37] \"circleQuarters\" \"circleHalves\" \"squish\" #> [40] \"toggle\" \"toggle2\" \"toggle3\" #> [43] \"toggle4\" \"toggle5\" \"toggle6\" #> [46] \"toggle7\" \"toggle8\" \"toggle9\" #> [49] \"toggle10\" \"toggle11\" \"toggle12\" #> [52] \"toggle13\" \"arrow\" \"arrow2\" #> [55] \"arrow3\" \"bouncingBar\" \"bouncingBall\" #> [58] \"smiley\" \"monkey\" \"hearts\" #> [61] \"clock\" \"earth\" \"material\" #> [64] \"moon\" \"runner\" \"pong\" #> [67] \"shark\" \"dqpb\" \"weather\" #> [70] \"christmas\" \"grenade\" \"point\" #> [73] \"layer\" \"betaWave\" \"fingerDance\" #> [76] \"fistBump\" \"soccerHeader\" \"mindblown\" #> [79] \"speaker\" \"orangePulse\" \"bluePulse\" #> [82] \"orangeBluePulse\" \"timeTravel\" \"aesthetic\" #> [85] \"growVeriticalDotsLR\" \"growVeriticalDotsRL\" \"growVeriticalDotsLL\" #> [88] \"growVeriticalDotsRR\" get_spinner(\"dots\") #> $name #> [1] \"dots\" #> #> $interval #> [1] 80 #> #> $frames #> [1] \"⠋\" \"⠙\" \"⠹\" \"⠸\" \"⠼\" \"⠴\" \"⠦\" \"⠧\" \"⠇\" \"⠏\" #> ansi_with_hidden_cursor(demo_spinners(\"dots\")) ansi_with_hidden_cursor(demo_spinners(\"clock\"))"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"From usethis::ui functions to cli","text":"’ll show transition usethis::ui_* functions cli 2.0.0.","code":"library(cli) library(usethis)"},{"path":[]},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage","dir":"Articles","previous_headings":"How to > usethis::ui_code()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_code(x)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example","dir":"Articles","previous_headings":"How to > usethis::ui_code()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_todo(\"Redocument with {ui_code('devtools::document()')}\") #> • Redocument with `devtools::document()`"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli","dir":"Articles","previous_headings":"How to > usethis::ui_code()","what":"With cli","title":"From usethis::ui functions to cli","text":"general inline code formatting can done inline styles cli. default theme \"code\" class, also one functions, can either :","code":"cli_ul(\"Redocument with {.code devtools::document()}\") #> • Redocument with `devtools::document()` cli_ul(\"Redocument with {.fun devtools::document}\") #> • Redocument with `devtools::document()`"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-1","dir":"Articles","previous_headings":"How to > usethis::ui_code_block()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_code_block(x, copy = interactive(), .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-1","dir":"Articles","previous_headings":"How to > usethis::ui_code_block()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_code_block(\"{format(cli_code)}\") #> function (lines = NULL, ..., language = \"R\", .auto_close = TRUE, #> • .envir = environment()) #> • { #> • lines <- c(lines, unlist(list(...))) #> • id <- cli_div(class = paste(\"code\", language), .auto_close = .auto_close #> , #> • .envir = .envir) #> • cli_verbatim(lines) #> • invisible(id) #> • } #>"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-1","dir":"Articles","previous_headings":"How to > usethis::ui_code_block()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli_code() produces similar output also syntax highlight R code: However, cli copy stuff clipboard, done separately. Another difference also run glue substitutions code text, want happen ’ll need cli call.","code":"cli_code(format(cli_code)) #> function (lines = NULL, ..., language = \"R\", .auto_close = TRUE, #> .envir = environment()) #> { #> lines <- c(lines, unlist(list(...))) #> id <- cli_div(class = paste(\"code\", language), .auto_close = .auto_close, #> .envir = .envir) #> cli_verbatim(lines) #> invisible(id) #> }"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-2","dir":"Articles","previous_headings":"How to > usethis::ui_done()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_done(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-2","dir":"Articles","previous_headings":"How to > usethis::ui_done()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"name <- \"VignetteBuilder\" value <- \"knitr, rmarkdown\" ui_done(\"Setting {ui_field(name)} field in DESCRIPTION to {ui_value(value)}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to 'knitr, rmarkdown'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-2","dir":"Articles","previous_headings":"How to > usethis::ui_done()","what":"With cli","title":"From usethis::ui functions to cli","text":"probably closest cli_alert_success(): want handle success failure, maybe cli_process_*() functions better fit:","code":"cli_alert_success(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to \"knitr, rmarkdown\" tryCatch({ cli_process_start(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") Sys.sleep(1) # <- do the task here, we just sleep cli_process_done() }, error = function(err) { cli_process_failed() cli_alert_danger(\"Failed to ...\") } )"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-3","dir":"Articles","previous_headings":"How to > usethis::ui_field()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_field(x)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-3","dir":"Articles","previous_headings":"How to > usethis::ui_field()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"name <- \"VignetteBuilder\" value <- \"knitr, rmarkdown\" ui_done(\"Setting {ui_field(name)} field in DESCRIPTION to {ui_value(value)}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to 'knitr, rmarkdown'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-3","dir":"Articles","previous_headings":"How to > usethis::ui_field()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli \"field\" class inline styling: Just like usethis::ui_field() similar usethis functions, cli collapses inline vectors, styling: cli also helps correct pluralization:","code":"cli_alert_success(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to \"knitr, rmarkdown\" name <- c(\"Depends\", \"Imports\", \"Suggests\") ui_done(\"Setting the {ui_field(name)} field(s) in DESCRIPTION\") #> ✔ Setting the Depends, Imports, Suggests field(s) in DESCRIPTION cli_alert_success(\"Setting the {.field {name}} field{?s} in DESCRIPTION\") #> ✔ Setting the Depends, Imports, and Suggests fields in DESCRIPTION name <- \"Depends\" cli_alert_success(\"Setting the {.field {name}} field{?s} in DESCRIPTION\") #> ✔ Setting the Depends field in DESCRIPTION"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-4","dir":"Articles","previous_headings":"How to > usethis::ui_info()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_info((x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-4","dir":"Articles","previous_headings":"How to > usethis::ui_info()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_info(\"No labels need renaming\") #> ℹ No labels need renaming"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-4","dir":"Articles","previous_headings":"How to > usethis::ui_info()","what":"With cli","title":"From usethis::ui functions to cli","text":"simply cli_alert_info():","code":"cli_alert_info(\"No labels need renaming\") #> ℹ No labels need renaming"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-5","dir":"Articles","previous_headings":"How to > usethis::ui_line()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_line(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-5","dir":"Articles","previous_headings":"How to > usethis::ui_line()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_line(\"No matching issues/PRs found.\") #> No matching issues/PRs found."},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-5","dir":"Articles","previous_headings":"How to > usethis::ui_line()","what":"With cli","title":"From usethis::ui functions to cli","text":"just line text, cli_text() fine . One difference cli_text() automatically wrap long lines.","code":"cli_text(\"No matching issues/PRs found.\") #> No matching issues/PRs found."},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-6","dir":"Articles","previous_headings":"How to > usethis::ui_nope()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"ui_nope(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-6","dir":"Articles","previous_headings":"How to > usethis::ui_nope()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli support user input currently, stay usethis.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-7","dir":"Articles","previous_headings":"How to > usethis::ui_oops()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_oops(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-6","dir":"Articles","previous_headings":"How to > usethis::ui_oops()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_oops(\"Can't validate token. Is the network reachable?\") #> ✖ Can't validate token. Is the network reachable?"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-7","dir":"Articles","previous_headings":"How to > usethis::ui_oops()","what":"With cli","title":"From usethis::ui functions to cli","text":"mostly just cli_alert_danger(), see also cli_process_*() alternatives usethis::ui_done().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-8","dir":"Articles","previous_headings":"How to > usethis::ui_path()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_path(x, base = NULL)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-7","dir":"Articles","previous_headings":"How to > usethis::ui_path()","what":"Example","title":"From usethis::ui functions to cli","text":"ui_path() formats paths relative project supplied base directory, also appends / directories.","code":"logo_path <- file.path(\"man\", \"figures\", \"logo.svg\") img <- \"/tmp/some-image.svg\" ui_done(\"Copied {ui_path(img)} to {ui_path(logo_path)}\") #> ✔ Copied '/tmp/some-image.svg' to 'man/figures/logo.svg'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-8","dir":"Articles","previous_headings":"How to > usethis::ui_path()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli , inline markup files paths:","code":"cli_alert_success(\"Copied {.file {img}} to {.file {logo_path}}\") #> ✔ Copied /tmp/some-image.svg to man/figures/logo.svg"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-9","dir":"Articles","previous_headings":"How to > usethis::ui_stop()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_stop(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-8","dir":"Articles","previous_headings":"How to > usethis::ui_stop()","what":"Example","title":"From usethis::ui functions to cli","text":"ui_stop() glue substitution string, calls stop() throw error.","code":"ui_stop(\"Could not copy {ui_path(img)} to {ui_path(logo_path)}, file already exists\") #> Error: Could not copy '/tmp/some-image.svg' to 'man/figures/logo.svg', file alr #> eady exists"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-9","dir":"Articles","previous_headings":"How to > usethis::ui_stop()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli_abort() formatted using cli_bullets().","code":"cli_abort(c( \"Could not copy {.file {img}} to {.file {logo_path}}, file already exists\", \"i\" = \"You can set {.arg overwrite = TRUE} to avoid this error\" )) #> Error: #> ! Could not copy /tmp/some-image.svg to man/figures/logo.svg, file #> already exists #> ℹ You can set `overwrite = TRUE` to avoid this error #> Run `rlang::last_trace()` to see where the error occurred."},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-10","dir":"Articles","previous_headings":"How to > usethis::ui_todo()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_todo(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-9","dir":"Articles","previous_headings":"How to > usethis::ui_todo()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"ui_todo(\"Redocument with {ui_code('devtools::document()')}\") #> • Redocument with `devtools::document()`"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-10","dir":"Articles","previous_headings":"How to > usethis::ui_todo()","what":"With cli","title":"From usethis::ui functions to cli","text":"bullet, either cli_ul() cli_alert_info() appropriate:","code":"cli_ul(\"Redocument with {.fun devtools::document}\") #> • Redocument with `devtools::document()`"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-11","dir":"Articles","previous_headings":"How to > usethis::ui_value()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_value(x)"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-10","dir":"Articles","previous_headings":"How to > usethis::ui_value()","what":"Example","title":"From usethis::ui functions to cli","text":"","code":"name <- \"VignetteBuilder\" value <- \"knitr, rmarkdown\" ui_done(\"Setting {ui_field(name)} field in DESCRIPTION to {ui_value(value)}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to 'knitr, rmarkdown'"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-11","dir":"Articles","previous_headings":"How to > usethis::ui_value()","what":"With cli","title":"From usethis::ui functions to cli","text":"\"value\" inline class appropriate .","code":"cli_alert_success(\"Setting {.field {name}} field in DESCRIPTION to {.val {value}}\") #> ✔ Setting VignetteBuilder field in DESCRIPTION to \"knitr, rmarkdown\""},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-12","dir":"Articles","previous_headings":"How to > usethis::ui_warn()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"usethis::ui_warn(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"example-11","dir":"Articles","previous_headings":"How to > usethis::ui_warn()","what":"Example","title":"From usethis::ui functions to cli","text":"ui_warn() glue substitution string, calls warning() throw warning.","code":"ui_warn(\"Could not copy {ui_path(img)} to {ui_path(logo_path)}, file already exists\") #> Warning: Could not copy '/tmp/some-image.svg' to 'man/figures/logo.svg', file a #> lready exists"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-12","dir":"Articles","previous_headings":"How to > usethis::ui_warn()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli_warn() formatted using cli_bullets().","code":"cli_warn(c( \"Could not copy {.file {img}} to {.file {logo_path}}, file already exists\", \"i\" = \"You can set {.arg overwrite = TRUE} to avoid this warning\" )) #> Warning message: #> Could not copy /tmp/some-image.svg to man/figures/logo.svg, file already exists #> ℹ You can set `overwrite = TRUE` to avoid this warning"},{"path":[]},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"usage-13","dir":"Articles","previous_headings":"How to > usethis::ui_yeah()","what":"Usage","title":"From usethis::ui functions to cli","text":"","code":"ui_yeah(x, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/articles/usethis-ui.html","id":"with-cli-13","dir":"Articles","previous_headings":"How to > usethis::ui_yeah()","what":"With cli","title":"From usethis::ui functions to cli","text":"cli support user input currently, stay usethis.","code":""},{"path":"https://cli.r-lib.org/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Gábor Csárdi. Author, maintainer. Hadley Wickham. Contributor. Kirill Müller. Contributor. Salim Brüggemann. Contributor. . Copyright holder, funder.","code":""},{"path":"https://cli.r-lib.org/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Csárdi G (2024). cli: Helpers Developing Command Line Interfaces. R package version 3.6.3.9000, https://github.com/r-lib/cli, https://cli.r-lib.org.","code":"@Manual{, title = {cli: Helpers for Developing Command Line Interfaces}, author = {Gábor Csárdi}, year = {2024}, note = {R package version 3.6.3.9000, https://github.com/r-lib/cli}, url = {https://cli.r-lib.org}, }"},{"path":"https://cli.r-lib.org/dev/index.html","id":"cli","dir":"","previous_headings":"","what":"Helpers for Developing Command Line Interfaces","title":"Helpers for Developing Command Line Interfaces","text":"Helpers Developing Command Line Interfaces suite tools build attractive command line interfaces (CLIs), semantic elements: headers, lists, alerts, paragraphs, etc. Supports theming via CSS-like language. also contains number lower level CLI elements: rules, boxes, trees, Unicode symbols ASCII alternatives. supports ANSI markup terminal colors font styles.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"Helpers for Developing Command Line Interfaces","text":"Build CLI using semantic elements: headings, lists, alerts, paragraphs. Theming via CSS-like language. Terminal colors font styles. cli text can contain interpreted string literals, via glue package. Progress bars R C code. Error warning messages rich text formatting. Support pluralized messages. ANSI styled string manipulation.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Helpers for Developing Command Line Interfaces","text":"Install stable version CRAN: Install development version GitHub:","code":"install.packages(\"cli\") pak::pak(\"r-lib/cli\")"},{"path":"https://cli.r-lib.org/dev/index.html","id":"short-tour","dir":"","previous_headings":"","what":"Short tour","title":"Helpers for Developing Command Line Interfaces","text":"commonly used cli elements, features.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"short-alert-messages","dir":"","previous_headings":"","what":"Short alert messages","title":"Helpers for Developing Command Line Interfaces","text":"One liner messages inform warn.","code":"pkgs <- c(\"foo\", \"bar\", \"foobar\") cli_alert_success(\"Downloaded {length(pkgs)} packages.\") #> ✔ Downloaded 3 packages. db_url <- \"example.com:port\" cli_alert_info(\"Reopened database {.url {db_url}}.\") #> ℹ Reopened database . cli_alert_warning(\"Cannot reach GitHub, using local database cache.\") #> ! Cannot reach GitHub, using local database cache. cli_alert_danger(\"Failed to connect to database.\") #> ✖ Failed to connect to database. cli_alert(\"A generic alert\") #> → A generic alert"},{"path":"https://cli.r-lib.org/dev/index.html","id":"headings","dir":"","previous_headings":"","what":"Headings","title":"Helpers for Developing Command Line Interfaces","text":"Three levels headings.","code":"cli_h1(\"Heading 1\") #> #> ── Heading 1 ─────────────────────────────────────────────────────────────────── cli_h2(\"Heading 2\") #> #> ── Heading 2 ── #> cli_h3(\"Heading 3\") #> ── Heading 3"},{"path":"https://cli.r-lib.org/dev/index.html","id":"lists","dir":"","previous_headings":"","what":"Lists","title":"Helpers for Developing Command Line Interfaces","text":"Ordered, unordered description lists, can nested.","code":"fun <- function() { cli_ol() cli_li(\"Item 1\") ulid <- cli_ul() cli_li(\"Subitem 1\") cli_li(\"Subitem 2\") cli_end(ulid) cli_li(\"Item 2\") cli_end() } fun() #> 1. Item 1 #> • Subitem 1 #> • Subitem 2 #> 2. Item 2"},{"path":"https://cli.r-lib.org/dev/index.html","id":"themes","dir":"","previous_headings":"","what":"Themes","title":"Helpers for Developing Command Line Interfaces","text":"Theming via CSS-like language.","code":"fun <- function() { cli_div(theme = list(span.emph = list(color = \"orange\"))) cli_text(\"This is very {.emph important}\") cli_end() cli_text(\"Back to the {.emph previous theme}\") } fun() #> This is very important #> Back to the previous theme"},{"path":"https://cli.r-lib.org/dev/index.html","id":"command-substitution","dir":"","previous_headings":"","what":"Command substitution","title":"Helpers for Developing Command Line Interfaces","text":"Automatic command substitution via glue package.","code":"size <- 123143123 dt <- 1.3454 cli_alert_info(c( \"Downloaded {prettyunits::pretty_bytes(size)} in \", \"{prettyunits::pretty_sec(dt)}\")) #> ℹ Downloaded 123.14 MB in 1.3s"},{"path":"https://cli.r-lib.org/dev/index.html","id":"pluralization","dir":"","previous_headings":"","what":"Pluralization","title":"Helpers for Developing Command Line Interfaces","text":"Pluralization support.","code":"nfiles <- 3 ndirs <- 1 cli_alert_info(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}.\") #> ℹ Found 3 files and 1 directory."},{"path":"https://cli.r-lib.org/dev/index.html","id":"progress-bars","dir":"","previous_headings":"","what":"Progress bars","title":"Helpers for Developing Command Line Interfaces","text":"","code":"clean <- function() { cli_progress_bar(\"Cleaning data\", total = 100) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } } clean()"},{"path":"https://cli.r-lib.org/dev/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Helpers for Developing Command Line Interfaces","text":"See https://cli.r-lib.org/ also installed package: help(package = \"cli\").","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Helpers for Developing Command Line Interfaces","text":"Please note cli project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://cli.r-lib.org/dev/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Helpers for Developing Command Line Interfaces","text":"MIT © Posit Software, PBC","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":null,"dir":"Reference","previous_headings":"","what":"ANSI colored text — ansi-styles","title":"ANSI colored text — ansi-styles","text":"cli number functions color style text command line. provide modern interface crayon package.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ANSI colored text — ansi-styles","text":"","code":"bg_black(...) bg_blue(...) bg_cyan(...) bg_green(...) bg_magenta(...) bg_red(...) bg_white(...) bg_yellow(...) bg_none(...) bg_br_black(...) bg_br_blue(...) bg_br_cyan(...) bg_br_green(...) bg_br_magenta(...) bg_br_red(...) bg_br_white(...) bg_br_yellow(...) col_black(...) col_blue(...) col_cyan(...) col_green(...) col_magenta(...) col_red(...) col_white(...) col_yellow(...) col_grey(...) col_silver(...) col_none(...) col_br_black(...) col_br_blue(...) col_br_cyan(...) col_br_green(...) col_br_magenta(...) col_br_red(...) col_br_white(...) col_br_yellow(...) style_dim(...) style_blurred(...) style_bold(...) style_hidden(...) style_inverse(...) style_italic(...) style_reset(...) style_strikethrough(...) style_underline(...) style_no_bold(...) style_no_blurred(...) style_no_dim(...) style_no_italic(...) style_no_underline(...) style_no_inverse(...) style_no_hidden(...) style_no_strikethrough(...) style_no_color(...) style_no_bg_color(...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ANSI colored text — ansi-styles","text":"... Character strings, pasted together paste0(), applying style function.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ANSI colored text — ansi-styles","text":"ANSI string (class cli_ansi_string), contains ANSI sequences, current platform supports . can simply use cat() print terminal.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ANSI colored text — ansi-styles","text":"col_* functions change (foreground) color text. eight original ANSI colors. Note terminals, might actually look differently, terminals settings show . col_none() default color, useful substring colored string. col_br_* functions bright versions eight ANSI colors. Note terminal configurations themes might non-bright colors. bg_* functions change background color text. eight original ANSI background colors. , , can vary appearance, depending terminal settings. bg_none() default background color, useful substring background-colored string. bg_br_* functions bright versions eight ANSI background colors. Note terminal configurations themes might non-bright colors. style_* functions apply styling text. currently supported styling functions : style_reset() remove style, including color, style_bold() boldface / strong text, although terminals show bright, high intensity text instead, style_dim() (style_blurred() reduced intensity text. style_italic() (widely supported). style_underline(), style_inverse(), style_hidden(), style_strikethrough() (widely supported). style functions take number character vectors arguments, concatenate using paste0() adding style. Styles can also nested, inner style takes precedence, see examples . Sometimes want revert back default text color, middle colored text, want normal font middle italic text. can use style_no_* functions . Every style_*() function style_no_*() pair, defends argument taking style. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi-styles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ANSI colored text — ansi-styles","text":"","code":"col_blue(\"Hello \", \"world!\") #> #> [1] Hello world! cat(col_blue(\"Hello \", \"world!\")) #> Hello world! cat(\"... to highlight the\", col_red(\"search term\"), \"in a block of text\\n\") #> ... to highlight the search term in a block of text ## Style stack properly cat(col_green( \"I am a green line \", col_blue(style_underline(style_bold(\"with a blue substring\"))), \" that becomes green again!\" )) #> I am a green line with a blue substring that becomes green again! error <- combine_ansi_styles(\"red\", \"bold\") warn <- combine_ansi_styles(\"magenta\", \"underline\") note <- col_cyan cat(error(\"Error: subscript out of bounds!\\n\")) #> Error: subscript out of bounds! #> cat(warn(\"Warning: shorter argument was recycled.\\n\")) #> Warning: shorter argument was recycled. #> cat(note(\"Note: no such directory.\\n\")) #> Note: no such directory. #> # style_no_* functions, note that the color is not removed style_italic(col_green(paste0( \"italic before, \", style_no_italic(\"normal here, \"), \"italic after\" ))) #> #> [1] italic before, normal here, italic after # avoiding color for substring style_italic(col_red(paste( \"red before\", col_none(\"not red between\"), \"red after\" ))) #> #> [1] red before not red between red after"},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":null,"dir":"Reference","previous_headings":"","what":"Align an ANSI colored string — ansi_align","title":"Align an ANSI colored string — ansi_align","text":"Align ANSI colored string","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Align an ANSI colored string — ansi_align","text":"","code":"ansi_align( text, width = console_width(), align = c(\"left\", \"center\", \"right\"), type = \"width\" )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align an ANSI colored string — ansi_align","text":"text character vector align. width Width field align . align Whether align \"left\", \"center\" \"right\". type Passed ansi_nchar() nchar()","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align an ANSI colored string — ansi_align","text":"aligned character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_align.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Align an ANSI colored string — ansi_align","text":"","code":"str <- c( col_red(\"This is red\"), style_bold(\"This is bold\") ) astr <- ansi_align(str, width = 30) boxx(astr) #> ┌────────────────────────────────────┐ #> │ │ #> │ This is red │ #> │ This is bold │ #> │ │ #> └────────────────────────────────────┘ str <- c( col_red(\"This is red\"), style_bold(\"This is bold\") ) astr <- ansi_align(str, align = \"center\", width = 30) boxx(astr) #> ┌────────────────────────────────────┐ #> │ │ #> │ This is red │ #> │ This is bold │ #> │ │ #> └────────────────────────────────────┘ str <- c( col_red(\"This is red\"), style_bold(\"This is bold\") ) astr <- ansi_align(str, align = \"right\", width = 30) boxx(astr) #> ┌────────────────────────────────────┐ #> │ │ #> │ This is red │ #> │ This is bold │ #> │ │ #> └────────────────────────────────────┘"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse a vector into a string scalar — ansi_collapse","title":"Collapse a vector into a string scalar — ansi_collapse","text":"Features: custom separator (sep), custom separator length-two input (sep2), custom last separator (last), adds ellipsis truncated strings, uses Unicode ellipsis character UTF-8 console, can collapse \"ends\", style = \"-ends\", can consider limit display width result, characters, handles ANSI control sequences correctly measuring display width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse a vector into a string scalar — ansi_collapse","text":"","code":"ansi_collapse( x, sep = \", \", sep2 = sub(\"^,\", \"\", last), last = \", and \", trunc = Inf, width = Inf, ellipsis = symbol$ellipsis, style = c(\"both-ends\", \"head\") )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse a vector into a string scalar — ansi_collapse","text":"x Character vector, object .character() method collapse. sep Separator. character string. sep2 Separator special case x contains two elements. character string. Defaults value last without serial comma. last Last separator, truncation. E.g. use \", \" serial comma. character string. trunc Maximum number elements show. style = \"head\" least trunc = 1 used. style = \"-ends\" least trunc = 5 used, even smaller number specified. width Limit display width result, characters. hard limit, output never exceed . argument implemented \"-ends\" style, always uses Inf, warning finite width value set. ellipsis Character string use place truncation. default, Unicode ellipsis character used console UTF-8, three dots otherwise. style Truncation style: -ends: default, shows beginning end vector, skips elements middle needed. head: shows beginning vector, skips elements end, needed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse a vector into a string scalar — ansi_collapse","text":"Character scalar. NA_character_ elements x NA.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_collapse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse a vector into a string scalar — ansi_collapse","text":"","code":"ansi_collapse(letters) #> [1] \"a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, and z\" # truncate ansi_collapse(letters, trunc = 5) #> [1] \"a, b, c, …, y, and z\" # head style ansi_collapse(letters, trunc = 5, style = \"head\") #> [1] \"a, b, c, d, e, …\""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":null,"dir":"Reference","previous_headings":"","what":"Format a character vector in multiple columns — ansi_columns","title":"Format a character vector in multiple columns — ansi_columns","text":"function helps multi-column output ANSI styles strings. works well together boxx(), see example .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format a character vector in multiple columns — ansi_columns","text":"","code":"ansi_columns( text, width = console_width(), sep = \" \", fill = c(\"rows\", \"cols\"), max_cols = 4, align = c(\"left\", \"center\", \"right\"), type = \"width\", ellipsis = symbol$ellipsis )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format a character vector in multiple columns — ansi_columns","text":"text Character vector format. element formatted cell table. width Width screen. sep Separator columns. may ANSI styles. fill Whether fill columns row-wise column-wise. max_cols Maximum number columns use. use , even space . align Alignment within columns. type Passed ansi_nchar() ansi_align(). probably want default, \"width\". ellipsis string append truncated strings. Supply empty string want marker.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format a character vector in multiple columns — ansi_columns","text":"ANSI string vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_columns.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format a character vector in multiple columns — ansi_columns","text":"string fit specified width, truncated using ansi_strtrim().","code":"fmt <- ansi_columns( paste(col_red(\"foo\"), 1:10), width = 50, fill = \"rows\", max_cols=10, align = \"center\", sep = \" \" ) boxx(fmt, padding = c(0,1,0,1), header = col_cyan(\"Columns\")) #> ┌ Columns ───────────────────────────────────────────┐ #> │ foo 1 foo 2 foo 3 foo 4 foo 5 │ #> │ foo 6 foo 7 foo 8 foo 9 foo 10 │ #> └────────────────────────────────────────────────────┘"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":null,"dir":"Reference","previous_headings":"","what":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"First ANSI sequences stripped ansi_strip(), ","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"","code":"ansi_grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE, ...) ansi_grepl(pattern, x, ...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"pattern Character scalar, regular expression fixed string (fixed = TRUE), pattern search . objects coerced using .character(). x Character vector search . objects coerced using .character(). ignore.case, perl, value Passed base::grep(). ... Extra arguments passed base::grep() base::grepl().","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"base::grep() base::grepl(), respectively.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"Note functions work code points (bytes useBytes = TRUE), graphemes. Unlike base::grep() base::grepl() functions special case factors. pattern x converted UTF-8.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_grep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Like base::grep() and base::grepl(), but for ANSI strings — ansi_grep","text":"","code":"red_needle <- col_red(\"needle\") haystack <- c(\"foo\", \"needle\", \"foo\") green_haystack <- col_green(haystack) ansi_grepl(red_needle, haystack) #> [1] FALSE TRUE FALSE ansi_grepl(red_needle, green_haystack) #> [1] FALSE TRUE FALSE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a string has some ANSI styling — ansi_has_any","title":"Check if a string has some ANSI styling — ansi_has_any","text":"Check string ANSI styling","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a string has some ANSI styling — ansi_has_any","text":"","code":"ansi_has_any(string, sgr = TRUE, csi = TRUE, link = TRUE)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a string has some ANSI styling — ansi_has_any","text":"string string check. can also character vector. sgr Whether look SGR (styling) control sequences. csi Whether look non-SGR control sequences. link Whether look ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a string has some ANSI styling — ansi_has_any","text":"Logical vector, TRUE strings ANSI styling.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_has_any.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a string has some ANSI styling — ansi_has_any","text":"","code":"## The second one has style if ANSI colors are supported ansi_has_any(\"foobar\") #> [1] FALSE ansi_has_any(col_red(\"foobar\")) #> [1] TRUE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":null,"dir":"Reference","previous_headings":"","what":"Hide/show cursor in a terminal — ansi_hide_cursor","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"works terminal emulators. environments, nothing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"","code":"ansi_hide_cursor(stream = \"auto\") ansi_show_cursor(stream = \"auto\") ansi_with_hidden_cursor(expr, stream = \"auto\")"},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"stream stream inspect manipulate, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr(). expr R expression evaluate.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_hide_cursor.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Hide/show cursor in a terminal — ansi_hide_cursor","text":"ansi_hide_cursor() hides cursor. ansi_show_cursor() shows cursor. ansi_with_hidden_cursor() temporarily hides cursor evaluating expression.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert ANSI styled text to HTML — ansi_html","title":"Convert ANSI styled text to HTML — ansi_html","text":"Convert ANSI styled text HTML","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert ANSI styled text to HTML — ansi_html","text":"","code":"ansi_html(x, escape_reserved = TRUE, csi = c(\"drop\", \"keep\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert ANSI styled text to HTML — ansi_html","text":"x Input character vector. escape_reserved Whether escape characters reserved HTML (&, < >). csi non-SGR ANSI sequences, either \"keep\", \"drop\" .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert ANSI styled text to HTML — ansi_html","text":"Character vector HTML.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_html.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert ANSI styled text to HTML — ansi_html","text":"","code":"## Syntax highlight the source code of an R function with ANSI tags, ## and export it to a HTML file. code <- withr::with_options( list(ansi.num_colors = 256), code_highlight(format(ansi_html)) ) hcode <- paste(ansi_html(code), collapse = \"\\n\") css <- paste(format(ansi_html_style()), collapse= \"\\n\") page <- htmltools::tagList( htmltools::tags$head(htmltools::tags$style(css)), htmltools::tags$pre(htmltools::HTML(hcode)) ) if (interactive()) htmltools::html_print(page)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":null,"dir":"Reference","previous_headings":"","what":"CSS styles for the output of ansi_html() — ansi_html_style","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"CSS styles output ansi_html()","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"","code":"ansi_html_style( colors = TRUE, palette = c(\"vscode\", \"dichro\", \"vga\", \"winxp\", \"win10\", \"macos\", \"putty\", \"mirc\", \"xterm\", \"ubuntu\", \"eclipse\", \"iterm\", \"iterm-pastel\", \"iterm-smoooooth\", \"iterm-snazzy\", \"iterm-solarized\", \"iterm-tango\") )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"colors Whether include colors. FALSE include colors, TRUE 8 include eight colors (plus bright variants), 256 include 256 colors. palette Character scalar, palette use first eight colors plus bright variants. Terminals define colors differently, cli includes couple examples. Sources palettes: https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit iTerm2 builtin palettes https://github.com/sindresorhus/iterm2-snazzy","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"Named list CSS declaration blocks, names CSS selectors. format() print() methods, can use write output CSS HTML file.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_html_style.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CSS styles for the output of ansi_html() — ansi_html_style","text":"","code":"ansi_html_style(colors = FALSE) #> .ansi-bold { font-weight: bold; } #> .ansi-italic { font-style: italic; } #> .ansi-underline { text-decoration: underline; } #> .ansi-blink { text-decoration: blink; } #> .ansi-hide { visibility: hidden; } #> .ansi-crossedout { text-decoration: line-through; } #> .ansi-link:hover { text-decoration: underline; } ansi_html_style(colors = 8, palette = \"iterm-snazzy\") #> .ansi-bold { font-weight: bold; } #> .ansi-italic { font-style: italic; } #> .ansi-underline { text-decoration: underline; } #> .ansi-blink { text-decoration: blink; } #> .ansi-hide { visibility: hidden; } #> .ansi-crossedout { text-decoration: line-through; } #> .ansi-link:hover { text-decoration: underline; } #> .ansi-color-0 { color: #000000 } #> .ansi-color-1 { color: #ff5c57 } #> .ansi-color-2 { color: #5af78e } #> .ansi-color-3 { color: #f3f99d } #> .ansi-color-4 { color: #57c7ff } #> .ansi-color-5 { color: #ff6ac1 } #> .ansi-color-6 { color: #9aedfe } #> .ansi-color-7 { color: #f1f1f0 } #> .ansi-color-8 { color: #686868 } #> .ansi-color-9 { color: #ff5c57 } #> .ansi-color-10 { color: #5af78e } #> .ansi-color-11 { color: #f3f99d } #> .ansi-color-12 { color: #57c7ff } #> .ansi-color-13 { color: #ff6ac1 } #> .ansi-color-14 { color: #9aedfe } #> .ansi-color-15 { color: #f1f1f0 } #> .ansi-bg-color-0 { background-color: #000000 } #> .ansi-bg-color-1 { background-color: #ff5c57 } #> .ansi-bg-color-2 { background-color: #5af78e } #> .ansi-bg-color-3 { background-color: #f3f99d } #> .ansi-bg-color-4 { background-color: #57c7ff } #> .ansi-bg-color-5 { background-color: #ff6ac1 } #> .ansi-bg-color-6 { background-color: #9aedfe } #> .ansi-bg-color-7 { background-color: #f1f1f0 } #> .ansi-bg-color-8 { background-color: #686868 } #> .ansi-bg-color-9 { background-color: #ff5c57 } #> .ansi-bg-color-10 { background-color: #5af78e } #> .ansi-bg-color-11 { background-color: #f3f99d } #> .ansi-bg-color-12 { background-color: #57c7ff } #> .ansi-bg-color-13 { background-color: #ff6ac1 } #> .ansi-bg-color-14 { background-color: #9aedfe } #> .ansi-bg-color-15 { background-color: #f1f1f0 }"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":null,"dir":"Reference","previous_headings":"","what":"Count number of characters in an ANSI colored string — ansi_nchar","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"color-aware counterpart utf8_nchar(). default counts Unicode grapheme clusters, instead code points.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"","code":"ansi_nchar(x, type = c(\"chars\", \"bytes\", \"width\", \"graphemes\", \"codepoints\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"x Character vector, potentially ANSI styled, vector coerced character. converted UTF-8. type Whether count graphemes (characters), code points, bytes, calculate display width string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"Numeric vector, length strings character vector.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_nchar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count number of characters in an ANSI colored string — ansi_nchar","text":"","code":"str <- paste( col_red(\"red\"), \"default\", col_green(\"green\") ) cat(str, \"\\n\") #> red default green nchar(str) #> [1] 37 ansi_nchar(str) #> [1] 17 nchar(ansi_strip(str)) #> [1] 17"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":null,"dir":"Reference","previous_headings":"","what":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"Like base::nzchar(), ANSI strings","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"","code":"ansi_nzchar(x, ...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"x Charcater vector. objects coarced using base::.character(). ... Passed base::nzchar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_nzchar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Like base::nzchar(), but for ANSI strings — ansi_nzchar","text":"","code":"ansi_nzchar(\"\") #> [1] FALSE ansi_nzchar(col_red(\"\")) #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":null,"dir":"Reference","previous_headings":"","what":"ANSI colors palettes — truecolor","title":"ANSI colors palettes — truecolor","text":"platform supports least 256 colors, can configure colors cli uses eight base eight bright colors. (.e. colors col_black(), col_red(), col_br_black(), col_br_red(), etc.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ANSI colors palettes — truecolor","text":"","code":"truecolor ansi_palettes ansi_palette_show(palette = NULL, colors = num_ansi_colors(), rows = 4)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ANSI colors palettes — truecolor","text":"truecolor integer scalar. ansi_palettes data frame one row palette, one column base ANSI color. attr(ansi_palettes, \"info\") contains list information palette.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ANSI colors palettes — truecolor","text":"palette palette show, format cli.palette option, can name built-palette, list 16 colors. colors Number ANSI colors use show palette. platform sufficient support, output might lower color resolution. Without color support color . rows number colored rows print.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ANSI colors palettes — truecolor","text":"ansi_palette_show returns character vector, rows printed screen, invisibly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ANSI colors palettes — truecolor","text":"truecolor integer constant number 24 bit ANSI colors. customize default palette, set cli.palette option name built-palette (see ansi_palettes()), list 16 colors. Colors can specified RGB colors strings: #rrggbb R color names (see output grDevices::colors()). example, can put R profile: currently possible configure background colors separately, always foreground colors. platform 256 colors, colors specified palette interpolated. true color platforms RGB values used -. ansi_palettes data frame built-palettes, row one palette. ansi_palette_show() shows colors ANSI palette screen.","code":"options(cli.palette = \"vscode\")"},{"path":"https://cli.r-lib.org/dev/reference/ansi_palettes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ANSI colors palettes — truecolor","text":"","code":"ansi_palettes #> black red green yellow blue magenta cyan #> dichro #000000 #882255 #117733 #ddcc77 #332288 #aa4499 #88ccee #> vga #000000 #aa0000 #00aa00 #aa5500 #0000aa #aa00aa #00aaaa #> winxp #000000 #800000 #008000 #808000 #000080 #800080 #008080 #> vscode #000000 #cd3131 #0dbc79 #e5e510 #2472c8 #bc3fbc #11a8cd #> win10 #0c0c0c #c50f1f #13a10e #c19c00 #0037da #881798 #3a96dd #> macos #000000 #c23621 #25bc24 #adad27 #492ee1 #d338d3 #33bbc8 #> putty #000000 #bb0000 #00bb00 #bbbb00 #0000bb #bb00bb #00bbbb #> mirc #000000 #7f0000 #009300 #fc7f00 #00007f #9c009c #009393 #> xterm #000000 #cd0000 #00cd00 #cdcd00 #0000ee #cd00cd #00cdcd #> ubuntu #010101 #de382b #39b54a #ffc706 #006fb8 #762671 #2cb5e9 #> eclipse #000000 #cd0000 #00cd00 #cdcd00 #0000ee #cd00cd #00cdcd #> iterm #000000 #c91b00 #00c200 #c7c400 #0225c7 #ca30c7 #00c5c7 #> iterm-pastel #626262 #ff8373 #b4fb73 #fffdc3 #a5d5fe #ff90fe #d1d1fe #> iterm-smoooooth #14191e #b43c2a #00c200 #c7c400 #2744c7 #c040be #00c5c7 #> iterm-snazzy #000000 #ff5c57 #5af78e #f3f99d #57c7ff #ff6ac1 #9aedfe #> iterm-solarized #073642 #dc322f #859900 #b58900 #268bd2 #d33682 #2aa198 #> iterm-tango #000000 #d81e00 #5ea702 #cfae00 #427ab3 #89658e #00a7aa #> white br_black br_red br_green br_yellow br_blue #> dichro #e5e5e5 #000000 #cc6677 #999933 #ddcc77 #44aa99 #> vga #aaaaaa #555555 #ff5555 #55ff55 #ffff55 #5555ff #> winxp #c0c0c0 #808080 #ff0000 #00ff00 #ffff00 #0000ff #> vscode #e5e5e5 #666666 #f14c4c #23d18b #f5f543 #3b8eea #> win10 #cccccc #767676 #e74856 #16c60c #f9f1a5 #3b78ff #> macos #cbcccd #818383 #fc391f #31e722 #eaec23 #5833ff #> putty #bbbbbb #555555 #ff5555 #55ff55 #ffff55 #5555ff #> mirc #d2d2d2 #7f7f7f #ff0000 #00fc00 #ffff00 #0000fc #> xterm #e5e5e5 #7f7f7f #ff0000 #00ff00 #ffff00 #5c5cff #> ubuntu #cccccc #808080 #ff0000 #00ff00 #ffff00 #0000ff #> eclipse #e5e5e5 #000000 #ff0000 #00ff00 #ffff00 #5c5cff #> iterm #c7c7c7 #686868 #ff6e67 #5ffa68 #fffc67 #6871ff #> iterm-pastel #f1f1f1 #8f8f8f #ffc4be #d6fcba #fffed5 #c2e3ff #> iterm-smoooooth #c7c7c7 #686868 #dd7975 #58e790 #ece100 #a7abf2 #> iterm-snazzy #f1f1f0 #686868 #ff5c57 #5af78e #f3f99d #57c7ff #> iterm-solarized #eee8d5 #002b36 #cb4b16 #586e75 #657b83 #839496 #> iterm-tango #dbded8 #686a66 #f54235 #99e343 #fdeb61 #84b0d8 #> br_magenta br_cyan br_white #> dichro #aa4499 #88ccee #ffffff #> vga #ff55ff #55ffff #ffffff #> winxp #ff00ff #00ffff #ffffff #> vscode #d670d6 #29b8db #e5e5e5 #> win10 #b4009e #61d6d6 #f2f2f2 #> macos #f935f8 #14f0f0 #e9ebeb #> putty #ff55ff #55ffff #ffffff #> mirc #ff00ff #00ffff #ffffff #> xterm #ff00ff #00ffff #ffffff #> ubuntu #ff00ff #00ffff #ffffff #> eclipse #ff00ff #00ffff #ffffff #> iterm #ff77ff #60fdff #ffffff #> iterm-pastel #ffb2fe #e6e7fe #ffffff #> iterm-smoooooth #e17ee1 #60fdff #ffffff #> iterm-snazzy #ff6ac1 #9aedfe #f1f1f0 #> iterm-solarized #6c71c4 #93a1a1 #fdf6e3 #> iterm-tango #bc94b7 #37e6e8 #f1f1f0 ansi_palette_show(\"dichro\", colors = truecolor) #> bright variants #> blck red grn yllw blue mgnt cyan whte blck red grn yllw blue mgnt cyan whte #> #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ #> ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████ ████"},{"path":"https://cli.r-lib.org/dev/reference/ansi_regex.html","id":null,"dir":"Reference","previous_headings":"","what":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","title":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","text":"forget use perl = TRUE using grepl() friends.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_regex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","text":"","code":"ansi_regex()"},{"path":"https://cli.r-lib.org/dev/reference/ansi_regex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perl compatible regular expression that matches ANSI escape sequences — ansi_regex","text":"String scalar, regular expression.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":null,"dir":"Reference","previous_headings":"","what":"Simplify ANSI styling tags — ansi_simplify","title":"Simplify ANSI styling tags — ansi_simplify","text":"creates equivalent, possibly shorter ANSI styled string, removing duplicate empty tags.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simplify ANSI styling tags — ansi_simplify","text":"","code":"ansi_simplify(x, csi = c(\"keep\", \"drop\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simplify ANSI styling tags — ansi_simplify","text":"x Input string csi non-SGR ANSI sequences, either \"keep\", \"drop\" .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_simplify.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simplify ANSI styling tags — ansi_simplify","text":"Simplified cli_ansi_string vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Labels a character vector as containing ANSI control codes. — ansi_string","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"function sets class argument, activating ANSI-string-specific methods printing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"","code":"ansi_string(x)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"x character vector something can coerced one.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Labels a character vector as containing ANSI control codes. — ansi_string","text":"cli_ansi_string object, subclass character, length contents x.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove ANSI escape sequences from a string — ansi_strip","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"input may class cli_ansi_string class, also dropped result.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"","code":"ansi_strip(string, sgr = TRUE, csi = TRUE, link = TRUE)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"string input string. sgr Whether remove SGR (styling) control sequences. csi Whether remove non-SGR control sequences. link Whether remove ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"cleaned string. Note ansi_strip() always drops cli_ansi_string class, even sgr sciareFALSE`.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strip.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove ANSI escape sequences from a string — ansi_strip","text":"","code":"ansi_strip(col_red(\"foobar\")) == \"foobar\" #> [1] TRUE"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":null,"dir":"Reference","previous_headings":"","what":"Split an ANSI colored string — ansi_strsplit","title":"Split an ANSI colored string — ansi_strsplit","text":"color-aware counterpart base::strsplit(). works almost exactly like original, keeps colors substrings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split an ANSI colored string — ansi_strsplit","text":"","code":"ansi_strsplit(x, split, ...)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split an ANSI colored string — ansi_strsplit","text":"x Character vector, potentially ANSI styled, vector coerced character. split Character vector length 1 (object can coerced ) containing regular expression(s) (unless fixed = TRUE) use splitting. empty matches occur, particular split zero characters, x split single characters. ... Extra arguments passed base::strsplit().","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split an ANSI colored string — ansi_strsplit","text":"list length x, -th element contains vector splits x[]. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strsplit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split an ANSI colored string — ansi_strsplit","text":"","code":"str <- paste0( col_red(\"I am red---\"), col_green(\"and I am green-\"), style_underline(\"I underlined\") ) cat(str, \"\\n\") #> I am red---and I am green-I underlined # split at dashes, keep color cat(ansi_strsplit(str, \"[-]+\")[[1]], sep = \"\\n\") #> I am red #> and I am green #> I underlined strsplit(ansi_strip(str), \"[-]+\") #> [[1]] #> [1] \"I am red\" \"and I am green\" \"I underlined\" #> # split to characters, keep color cat(ansi_strsplit(str, \"\")[[1]], \"\\n\", sep = \" \") #> I a m r e d - - - a n d I a m g r e e n - I u n d e r l i n e d strsplit(ansi_strip(str), \"\") #> [[1]] #> [1] \"I\" \" \" \"a\" \"m\" \" \" \"r\" \"e\" \"d\" \"-\" \"-\" \"-\" \"a\" \"n\" \"d\" \" \" \"I\" \" \" #> [18] \"a\" \"m\" \" \" \"g\" \"r\" \"e\" \"e\" \"n\" \"-\" \"I\" \" \" \"u\" \"n\" \"d\" \"e\" \"r\" \"l\" #> [35] \"i\" \"n\" \"e\" \"d\" #>"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":null,"dir":"Reference","previous_headings":"","what":"Truncate an ANSI string — ansi_strtrim","title":"Truncate an ANSI string — ansi_strtrim","text":"function similar base::strtrim(), works correctly ANSI styled strings. also adds ... (corresponding Unicode character Unicode characters allowed) end truncated strings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Truncate an ANSI string — ansi_strtrim","text":"","code":"ansi_strtrim(x, width = console_width(), ellipsis = symbol$ellipsis)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Truncate an ANSI string — ansi_strtrim","text":"x Character vector ANSI strings. width width truncate . ellipsis string append truncated strings. Supply empty string want marker.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Truncate an ANSI string — ansi_strtrim","text":"Note: ansi_strtrim() support NA values currently.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strtrim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Truncate an ANSI string — ansi_strtrim","text":"","code":"text <- cli::col_red(cli:::lorem_ipsum()) ansi_strtrim(c(text, \"foobar\"), 40) #> #> [1] Culpa laboris laborum occaecat occaecat… #> [2] foobar"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap an ANSI styled string to a certain width — ansi_strwrap","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"function similar base::strwrap(), works ANSI styled strings, leaves styling intact.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"","code":"ansi_strwrap( x, width = console_width(), indent = 0, exdent = 0, simplify = TRUE )"},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"x ANSI string. width Width wrap . indent Indentation first line paragraph. exdent Indentation subsequent lines paragraph. simplify Whether return wrapped strings single character vector, wrap element x independently return list.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"simplify FALSE, list character vectors, ANSI string. Otherwise single ANSI string vector.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_strwrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Wrap an ANSI styled string to a certain width — ansi_strwrap","text":"","code":"text <- cli:::lorem_ipsum() # Highlight some words, that start with 's' rexp <- gregexpr(\"\\\\b([sS][a-zA-Z]+)\\\\b\", text) regmatches(text, rexp) <- lapply(regmatches(text, rexp), col_red) cat(text) #> Mollit adipisicing laborum Lorem non eu velit sint deserunt amet Lorem qui culpa. Laboris dolore cupidatat laborum incididunt. Cupidatat duis in amet sit. Incididunt labore aute esse est ipsum cillum commodo qui minim ut veniam laborum nostrud nostrud. Reprehenderit irure nostrud duis esse quis nisi aliquip ipsum minim duis fugiat ea. Dolore consectetur non cupidatat officia Lorem elit. Ad aliqua aute pariatur anim ex culpa Lorem. Mollit magna sint pariatur non quis do duis non sint elit ullamco exercitation consectetur aliqua. Nostrud laborum deserunt adipisicing tempor amet qui duis. Mollit non aliquip ea sunt quis tempor dolore esse. wrp <- ansi_strwrap(text, width = 40) cat(wrp, sep = \"\\n\") #> Mollit adipisicing laborum Lorem non eu #> velit sint deserunt amet Lorem qui #> culpa. Laboris dolore cupidatat laborum #> incididunt. Cupidatat duis in amet sit. #> Incididunt labore aute esse est ipsum #> cillum commodo qui minim ut veniam #> laborum nostrud nostrud. Reprehenderit #> irure nostrud duis esse quis nisi #> aliquip ipsum minim duis fugiat ea. #> Dolore consectetur non cupidatat #> officia Lorem elit. Ad aliqua aute #> pariatur anim ex culpa Lorem. Mollit #> magna sint pariatur non quis do duis #> non sint elit ullamco exercitation #> consectetur aliqua. Nostrud laborum #> deserunt adipisicing tempor amet qui #> duis. Mollit non aliquip ea sunt quis #> tempor dolore esse."},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":null,"dir":"Reference","previous_headings":"","what":"Substring(s) of an ANSI colored string — ansi_substr","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"color-aware counterpart base::substr(). works exactly like original, keeps colors substrings. ANSI escape sequences ignored calculating positions within string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"","code":"ansi_substr(x, start, stop)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"x Character vector, potentially ANSI styled, vector coerced character. start Starting index indices, recycled match length x. stop Ending index indices, recycled match length x.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"Character vector length x, containing requested substrings. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_substr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Substring(s) of an ANSI colored string — ansi_substr","text":"","code":"str <- paste( col_red(\"red\"), \"default\", col_green(\"green\") ) cat(str, \"\\n\") #> red default green cat(ansi_substr(str, 1, 5), \"\\n\") #> red d cat(ansi_substr(str, 1, 15), \"\\n\") #> red default gre cat(ansi_substr(str, 3, 7), \"\\n\") #> d def substr(ansi_strip(str), 1, 5) #> [1] \"red d\" substr(ansi_strip(str), 1, 15) #> [1] \"red default gre\" substr(ansi_strip(str), 3, 7) #> [1] \"d def\" str2 <- paste( \"another\", col_red(\"multi-\", style_underline(\"style\")), \"text\" ) cat(str2, \"\\n\") #> another multi-style text cat(ansi_substr(c(str, str2), c(3,5), c(7, 18)), sep = \"\\n\") #> d def #> her multi-styl substr(ansi_strip(c(str, str2)), c(3,5), c(7, 18)) #> [1] \"d def\" \"her multi-styl\""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":null,"dir":"Reference","previous_headings":"","what":"Substring(s) of an ANSI colored string — ansi_substring","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"color-aware counterpart base::substring(). works exactly like original, keeps colors substrings. ANSI escape sequences ignored calculating positions within string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"","code":"ansi_substring(text, first, last = 1000000L)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"text Character vector, potentially ANSI styled, vector coerced character. recycled longest first last. first Starting index indices, recycled match length x. last Ending index indices, recycled match length x.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"Character vector length x, containing requested substrings. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_substring.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Substring(s) of an ANSI colored string — ansi_substring","text":"","code":"str <- paste( col_red(\"red\"), \"default\", col_green(\"green\") ) cat(str, \"\\n\") #> red default green cat(ansi_substring(str, 1, 5), \"\\n\") #> red d cat(ansi_substring(str, 1, 15), \"\\n\") #> red default gre cat(ansi_substring(str, 3, 7), \"\\n\") #> d def substring(ansi_strip(str), 1, 5) #> [1] \"red d\" substring(ansi_strip(str), 1, 15) #> [1] \"red default gre\" substring(ansi_strip(str), 3, 7) #> [1] \"d def\" str2 <- paste( \"another\", col_red(\"multi-\", style_underline(\"style\")), \"text\" ) cat(str2, \"\\n\") #> another multi-style text cat(ansi_substring(str2, c(3,5), c(7, 18)), sep = \"\\n\") #> other #> her multi-styl substring(ansi_strip(str2), c(3,5), c(7, 18)) #> [1] \"other\" \"her multi-styl\""},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":null,"dir":"Reference","previous_headings":"","what":"ANSI character translation and case folding — ansi_toupper","title":"ANSI character translation and case folding — ansi_toupper","text":"functions similar toupper(), tolower() chartr(), keep ANSI colors string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ANSI character translation and case folding — ansi_toupper","text":"","code":"ansi_toupper(x) ansi_tolower(x) ansi_chartr(old, new, x)"},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ANSI character translation and case folding — ansi_toupper","text":"x Input string. May ANSI colors styles. old character string specifying characters translated. character vector length 2 supplied, first element used warning. new character string specifying translations. character vector length 2 supplied, first element used warning.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ANSI character translation and case folding — ansi_toupper","text":"Character vector length x, containing translated strings. ANSI styles retained.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_toupper.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ANSI character translation and case folding — ansi_toupper","text":"","code":"ansi_toupper(col_red(\"Uppercase\")) #> #> [1] UPPERCASE ansi_tolower(col_red(\"LowerCase\")) #> #> [1] lowercase x <- paste0(col_green(\"MiXeD\"), col_red(\" cAsE 123\")) ansi_chartr(\"iXs\", \"why\", x) #> #> [1] MwheD cAyE 123"},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"function similar base::trimws() works ANSI strings, keeps color styling.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"","code":"ansi_trimws(x, which = c(\"both\", \"left\", \"right\"))"},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"x ANSI string vector. Whether remove leading trailing whitespace .","code":""},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"ANSI string, whitespace removed.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/ansi_trimws.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove leading and/or trailing whitespace from an ANSI string — ansi_trimws","text":"","code":"trimws(paste0(\" \", col_red(\"I am red\"), \" \")) #> [1] \"\\033[31mI am red\\033[39m\" ansi_trimws(paste0(\" \", col_red(\"I am red\"), \" \")) #> #> [1] I am red trimws(col_red(\" I am red \")) #> #> [1] I am red ansi_trimws(col_red(\" I am red \")) #> #> [1] I am red"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a banner-like box in the console — list_border_styles","title":"Draw a banner-like box in the console — list_border_styles","text":"Draw banner-like box console","code":""},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"list_border_styles() boxx( label, header = \"\", footer = \"\", border_style = \"single\", padding = 1, margin = 0, float = c(\"left\", \"center\", \"right\"), col = NULL, background_col = NULL, border_col = col, align = c(\"left\", \"center\", \"right\"), width = console_width() )"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a banner-like box in the console — list_border_styles","text":"label Label show, character vector. element new line. can color using col_*, bg_* style_* functions, see ANSI styles examples . header Text show top border box. long, cut. footer Text show bottom border box. long, cut. border_style String specifies border style. list_border_styles lists current styles. padding Padding within box. Either integer vector four numbers (bottom, left, top, right), single number x, interpreted c(x, 3*x, x, 3*x). margin Margin around box. Either integer vector four numbers (bottom, left, top, right), single number x, interpreted c(x, 3*x, x, 3*x). float Whether display box \"left\", \"center\", \"right\" screen. col Color text, default border color. Either style function (see ANSI styles) color name passed make_ansi_style(). background_col Background color inside box. Either style function (see ANSI styles), color name used make_ansi_style() create background style (.e. bg = TRUE used). border_col Color border. Either style function (see ANSI styles) color name passed make_ansi_style(). align Alignment label within box: \"left\", \"center\", \"right\". width Width screen, defaults console_width().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"defaults","dir":"Reference","previous_headings":"","what":"Defaults","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\") #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"change-border-style","dir":"Reference","previous_headings":"","what":"Change border style","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", border_style = \"double\") #> ╔══════════════════╗ #> ║ ║ #> ║ Hello there! ║ #> ║ ║ #> ╚══════════════════╝"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"multiple-lines","dir":"Reference","previous_headings":"","what":"Multiple lines","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(c(\"Hello\", \"there!\"), padding = 1) #> ┌────────────┐ #> │ │ #> │ Hello │ #> │ there! │ #> │ │ #> └────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"padding","dir":"Reference","previous_headings":"","what":"Padding","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1) boxx(\"Hello there!\", padding = c(1, 5, 1, 5)) #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"floating","dir":"Reference","previous_headings":"","what":"Floating","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1, float = \"center\") boxx(\"Hello there!\", padding = 1, float = \"right\") #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"text-color","dir":"Reference","previous_headings":"","what":"Text color","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(col_cyan(\"Hello there!\"), padding = 1, float = \"center\") #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"background-color","dir":"Reference","previous_headings":"","what":"Background color","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1, background_col = \"brown\") boxx(\"Hello there!\", padding = 1, background_col = bg_red) #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"border-color","dir":"Reference","previous_headings":"","what":"Border color","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(\"Hello there!\", padding = 1, border_col = \"green\") boxx(\"Hello there!\", padding = 1, border_col = col_red) #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘ #> ┌──────────────────┐ #> │ │ #> │ Hello there! │ #> │ │ #> └──────────────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"label-alignment","dir":"Reference","previous_headings":"","what":"Label alignment","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"boxx(c(\"Hi\", \"there\", \"you!\"), padding = 1, align = \"left\") boxx(c(\"Hi\", \"there\", \"you!\"), padding = 1, align = \"center\") boxx(c(\"Hi\", \"there\", \"you!\"), padding = 1, align = \"right\") #> ┌───────────┐ #> │ │ #> │ Hi │ #> │ there │ #> │ you! │ #> │ │ #> └───────────┘ #> ┌───────────┐ #> │ │ #> │ Hi │ #> │ there │ #> │ you! │ #> │ │ #> └───────────┘ #> ┌───────────┐ #> │ │ #> │ Hi │ #> │ there │ #> │ you! │ #> │ │ #> └───────────┘"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"a-very-customized-box","dir":"Reference","previous_headings":"","what":"A very customized box","title":"Draw a banner-like box in the console — list_border_styles","text":"","code":"star <- symbol$star label <- c(paste(star, \"Hello\", star), \" there!\") boxx( col_white(label), border_style=\"round\", padding = 1, float = \"center\", border_col = \"tomato3\", background_col=\"darkolivegreen\" ) #> ╭───────────────╮ #> │ │ #> │ ★ Hello ★ │ #> │ there! │ #> │ │ #> ╰───────────────╯"},{"path":"https://cli.r-lib.org/dev/reference/boxx.html","id":"about-fonts-and-terminal-settings","dir":"Reference","previous_headings":"","what":"About fonts and terminal settings","title":"Draw a banner-like box in the console — list_border_styles","text":"boxes might might look great terminal, depending box style use font terminal uses. found Menlo font looks nice terminals also Emacs. RStudio currently line height greater one console output, makes boxes ugly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":null,"dir":"Reference","previous_headings":"","what":"The built-in CLI theme — builtin_theme","title":"The built-in CLI theme — builtin_theme","text":"theme always active, bottom theme stack. See themes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The built-in CLI theme — builtin_theme","text":"","code":"builtin_theme(dark = getOption(\"cli.theme_dark\", \"auto\"))"},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The built-in CLI theme — builtin_theme","text":"dark Whether use dark theme. cli.theme_dark option can used request dark theme explicitly. set, set \"auto\", cli tries detect dark theme, works recent RStudio versions iTerm macOS.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The built-in CLI theme — builtin_theme","text":"named list, CLI theme.","code":""},{"path":"https://cli.r-lib.org/dev/reference/builtin_theme.html","id":"showcase","dir":"Reference","previous_headings":"","what":"Showcase","title":"The built-in CLI theme — builtin_theme","text":"","code":"cli_h1(\"Heading 1\") cli_h2(\"Heading 2\") cli_h3(\"Heading 3\") cli_par() cli_alert_danger(\"Danger alert\") cli_alert_warning(\"Warning alert\") cli_alert_info(\"Info alert\") cli_alert_success(\"Success alert\") cli_alert(\"Alert for starting a process or computation\", class = \"alert-start\") cli_end() cli_text(\"Packages and versions: {.pkg cli} {.version 1.0.0}.\") cli_text(\"Time intervals: {.timestamp 3.4s}\") cli_text(\"{.emph Emphasis} and {.strong strong emphasis}\") cli_text(\"This is a piece of code: {.code sum(x) / length(x)}\") cli_text(\"Function names: {.fn cli::simple_theme}\") cli_text(\"Files: {.file /usr/bin/env}\") cli_text(\"URLs: {.url https://r-project.org}\") cli_h2(\"Longer code chunk\") cli_par(class = \"code R\") cli_verbatim( '# window functions are useful for grouped mutates', 'mtcars %>%', ' group_by(cyl) %>%', ' mutate(rank = min_rank(desc(mpg)))') #> ── Heading 1 ───────────────────────────────────────────────────────── #> #> ── Heading 2 ── #> #> ── Heading 3 #> ✖ Danger alert #> ! Warning alert #> ℹ Info alert #> ✔ Success alert #> → Alert for starting a process or computation #> #> Packages and versions: cli 1.0.0. #> Time intervals: [3.4s] #> Emphasis and strong emphasis #> This is a piece of code: `sum(x) / length(x)` #> Function names: `cli::simple_theme()` #> Files: /usr/bin/env #> URLs: #> #> ── Longer code chunk ── #> #> # window functions are useful for grouped mutates #> mtcars %>% #> group_by(cyl) %>% #> mutate(rank = min_rank(desc(mpg)))"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":null,"dir":"Reference","previous_headings":"","what":"cat() helpers — cat_line","title":"cat() helpers — cat_line","text":"helpers provide useful wrappers around cat(): importantly set sep = \"\", cat_line() automatically adds newline.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cat() helpers — cat_line","text":"","code":"cat_line(..., col = NULL, background_col = NULL, file = stdout()) cat_bullet( ..., col = NULL, background_col = NULL, bullet = \"bullet\", bullet_col = NULL, file = stdout() ) cat_boxx(..., file = stdout()) cat_rule(..., file = stdout()) cat_print(x, file = \"\")"},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"cat() helpers — cat_line","text":"... cat_line() cat_bullet(), pasted together collapse = \"\\n\". cat_rule() cat_boxx() passed rule() boxx() respectively. col, background_col, bullet_col Colors text, background, bullets respectively. file Output destination. Defaults standard output. bullet Name bullet character. Indexes symbol x object print.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cat_line.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"cat() helpers — cat_line","text":"","code":"cat_line(\"This is \", \"a \", \"line of text.\", col = \"red\") #> This is a line of text. cat_bullet(letters[1:5]) #> • a #> • b #> • c #> • d #> • e cat_bullet(letters[1:5], bullet = \"tick\", bullet_col = \"green\") #> ✔ a #> ✔ b #> ✔ c #> ✔ d #> ✔ e cat_rule() #> ──────────────────────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":null,"dir":"Reference","previous_headings":"","what":"cli environment variables and options — cli-config","title":"cli environment variables and options — cli-config","text":"cli environment variables options","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"user-facing-configuration","dir":"Reference","previous_headings":"","what":"User facing configuration","title":"cli environment variables and options — cli-config","text":"environment variables options uses may set, modify behavior cli.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-hyperlink-mode","dir":"Reference","previous_headings":"","what":"R_CLI_HYPERLINK_MODE","title":"cli environment variables and options — cli-config","text":"Set posix force generating POSIX compatible ANSI hyperlinks. set, RStudio compatible links generated. temporary crutch RStudio handles POSIX hyperlinks correctly, removed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"no-color","dir":"Reference","previous_headings":"","what":"NO_COLOR","title":"cli environment variables and options — cli-config","text":"Set nonempty value turn ANSI colors. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"ess-background-mode","dir":"Reference","previous_headings":"","what":"ESS_BACKGROUND_MODE","title":"cli environment variables and options — cli-config","text":"Set environment variable light dark indicate dark mode Emacs. https://github.com/emacs-ess/ESS/pull/1178 merged, ESS set automatically.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-dynamic","dir":"Reference","previous_headings":"","what":"R_CLI_DYNAMIC","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See is_dynamic_tty().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-num-colors","dir":"Reference","previous_headings":"","what":"R_CLI_NUM_COLORS","title":"cli environment variables and options — cli-config","text":"Set positive integer assume given number colors. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-cli-hyperlinks","dir":"Reference","previous_headings":"","what":"R_CLI_HYPERLINKS","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See style_hyperlink().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-ansi","dir":"Reference","previous_headings":"","what":"cli.ansi","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True assume terminal supports ANSI control sequences. Set anything else assume non-ANSI terminal. See is_ansi_tty().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-condition-unicode-bullets","dir":"Reference","previous_headings":"","what":"cli.condition_unicode_bullets","title":"cli environment variables and options — cli-config","text":"TRUE FALSE force turn Unicode symbols printing conditions. E.g. format_error(), format_warning(), format_message() also cli_abort(), cli_warn() cli_inform().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-condition-width","dir":"Reference","previous_headings":"","what":"cli.condition_width","title":"cli environment variables and options — cli-config","text":"Integer scalar (Inf) set console width cli formatting errors, warnings messages format_error(), format_warning() format_message(). formatting conditions option takes precedence cli.width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-default-handler","dir":"Reference","previous_headings":"","what":"cli.default_handler","title":"cli environment variables and options — cli-config","text":"General handler function cli conditions. See https://cli.r-lib.org/articles/semantic-cli.html#cli-messages-1","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-default-num-colors","dir":"Reference","previous_headings":"","what":"cli.default_num_colors","title":"cli environment variables and options — cli-config","text":"Default number ANSI colors. value used number colors already set cli.num_colors option, R_CLI_NUM_COLORS environment variable, crayon.enabled crayon.colors options, NO_COLOR environment variable, knitr..progress option, sink() call stream. can also use option color support detected correctly, want adjust number colors. E.g. crayon.enabled TRUE, crayon.colors , Emacs Windows, terminals. See num_ansi_colors(). See also cli.num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-dynamic","dir":"Reference","previous_headings":"","what":"cli.dynamic","title":"cli environment variables and options — cli-config","text":"Set TRUE assume dynamic terminal, supports \\r. Set anything else assume non-dynamic terminal. See is_dynamic_tty().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-hide-cursor","dir":"Reference","previous_headings":"","what":"cli.hide_cursor","title":"cli environment variables and options — cli-config","text":"Whether cli status bar try hide cursor terminals. Set FALSE hidden cursor causes issues.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-hyperlink","dir":"Reference","previous_headings":"","what":"cli.hyperlink","title":"cli environment variables and options — cli-config","text":"Set true, TRUE True tell cli terminal supports ANSI hyperlinks. Set anything else assume hyperlink support. See style_hyperlink().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-ignore-unknown-rstudio-theme","dir":"Reference","previous_headings":"","what":"cli.ignore_unknown_rstudio_theme","title":"cli environment variables and options — cli-config","text":"Set TRUE omit warning unknown RStudio theme code_highlight().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-num-colors","dir":"Reference","previous_headings":"","what":"cli.num_colors","title":"cli environment variables and options — cli-config","text":"Number ANSI colors. See num_ansi_colors(). See also cli.default_num_colors option.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-message-class","dir":"Reference","previous_headings":"","what":"cli.message_class","title":"cli environment variables and options — cli-config","text":"Character vector classes add cli's conditions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-bar-style","dir":"Reference","previous_headings":"","what":"cli.progress_bar_style","title":"cli environment variables and options — cli-config","text":"Progress bar style. See cli_progress_styles().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-bar-style-ascii","dir":"Reference","previous_headings":"","what":"cli.progress_bar_style_ascii","title":"cli environment variables and options — cli-config","text":"Progress bar style ASCII consoles. See cli_progress_styles().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-bar-style-unicode","dir":"Reference","previous_headings":"","what":"cli.progress_bar_style_unicode","title":"cli environment variables and options — cli-config","text":"Progress bar style Unicode (UTF-8) consoles; See cli_progress_styles().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-clear","dir":"Reference","previous_headings":"","what":"cli.progress_clear","title":"cli environment variables and options — cli-config","text":"Whether clear terminated progress bar screen dynamic terminals. See cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-demo-live","dir":"Reference","previous_headings":"","what":"cli.progress_demo_live","title":"cli environment variables and options — cli-config","text":"Whether cli_progress_demo() show live demo, just record progress bar frames.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-download","dir":"Reference","previous_headings":"","what":"cli.progress_format_download","title":"cli environment variables and options — cli-config","text":"Default format string download progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-download-nototal","dir":"Reference","previous_headings":"","what":"cli.progress_format_download_nototal","title":"cli environment variables and options — cli-config","text":"Default format string download progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-iterator","dir":"Reference","previous_headings":"","what":"cli.progress_format_iterator","title":"cli environment variables and options — cli-config","text":"Default format string iterator progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-iterator-nototal","dir":"Reference","previous_headings":"","what":"cli.progress_format_iterator_nototal","title":"cli environment variables and options — cli-config","text":"Default format string iterator progress bars unknown total number progress units.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-tasks","dir":"Reference","previous_headings":"","what":"cli.progress_format_tasks","title":"cli environment variables and options — cli-config","text":"Default format string tasks progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-format-tasks-nototal","dir":"Reference","previous_headings":"","what":"cli.progress_format_tasks_nototal","title":"cli environment variables and options — cli-config","text":"Default format string tasks progress bars unknown totals.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-handlers","dir":"Reference","previous_headings":"","what":"cli.progress_handlers","title":"cli environment variables and options — cli-config","text":"Progress handlers try. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-handlers-force","dir":"Reference","previous_headings":"","what":"cli.progress_handlers_force","title":"cli environment variables and options — cli-config","text":"Progress handlers always used, even another handler already selected. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-handlers-only","dir":"Reference","previous_headings":"","what":"cli.progress_handlers_only","title":"cli environment variables and options — cli-config","text":"Progress handlers force, ignoring handlers set cli.progress_handlers cli.progress_handlers_force. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-say-args","dir":"Reference","previous_headings":"","what":"cli.progress_say_args","title":"cli environment variables and options — cli-config","text":"Command line arguments say progress handlers. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-say-command","dir":"Reference","previous_headings":"","what":"cli.progress_say_command","title":"cli environment variables and options — cli-config","text":"External command use say progress handler. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-say-frequency","dir":"Reference","previous_headings":"","what":"cli.progress_say_frequency","title":"cli environment variables and options — cli-config","text":"Minimum delay say calls say progress handler. say ignores frequent updates, keep speech comprehensible. See cli_progress_builtin_handlers().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-progress-show-after","dir":"Reference","previous_headings":"","what":"cli.progress_show_after","title":"cli environment variables and options — cli-config","text":"Delay showing progress bar, seconds. Progress bars finish delay shown . cli also shows progress bars 50% go half delay passed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-spinner","dir":"Reference","previous_headings":"","what":"cli.spinner","title":"cli environment variables and options — cli-config","text":"Default spinner use, see get_spinner().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-spinner-ascii","dir":"Reference","previous_headings":"","what":"cli.spinner_ascii","title":"cli environment variables and options — cli-config","text":"Default spinner use ASCII terminals, see get_spinner().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-spinner-unicode","dir":"Reference","previous_headings":"","what":"cli.spinner_unicode","title":"cli environment variables and options — cli-config","text":"Default spinner use Unicode terminals, see get_spinner().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-theme","dir":"Reference","previous_headings":"","what":"cli.theme","title":"cli environment variables and options — cli-config","text":"Default cli theme, addition built-theme. option intended package developers. See themes start_app().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-theme-dark","dir":"Reference","previous_headings":"","what":"cli.theme_dark","title":"cli environment variables and options — cli-config","text":"Whether cli assume dark theme builtin theme. See builtin_theme().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-unicode","dir":"Reference","previous_headings":"","what":"cli.unicode","title":"cli environment variables and options — cli-config","text":"Whether assume Unicode terminal. set, auto-detected. See is_utf8_output().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-user-theme","dir":"Reference","previous_headings":"","what":"cli.user_theme","title":"cli environment variables and options — cli-config","text":"cli user theme. option intended end users. See themes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-warn-inline-newlines","dir":"Reference","previous_headings":"","what":"cli.warn_inline_newlines","title":"cli environment variables and options — cli-config","text":"Whether emit warning cli replaces newline characters spaces within {.class } inline style. Defaults FALSE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-width","dir":"Reference","previous_headings":"","what":"cli.width","title":"cli environment variables and options — cli-config","text":"Terminal width assume. set, auto-detected. See console_width().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rlib-interactive","dir":"Reference","previous_headings":"","what":"rlib_interactive","title":"cli environment variables and options — cli-config","text":"Whether assume interactive R session. set, auto-detected.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"width","dir":"Reference","previous_headings":"","what":"width","title":"cli environment variables and options — cli-config","text":"Terminal width. used platforms, cli.width set.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"internal-configuration","dir":"Reference","previous_headings":"","what":"Internal configuration","title":"cli environment variables and options — cli-config","text":"environment variables options cli developers, users rely may change cli releases.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"asciicast","dir":"Reference","previous_headings":"","what":"ASCIICAST","title":"cli environment variables and options — cli-config","text":"Used detect asciicast sub-process RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"ansicon","dir":"Reference","previous_headings":"","what":"ANSICON","title":"cli environment variables and options — cli-config","text":"Used detect ANSICON detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"ci","dir":"Reference","previous_headings":"","what":"CI","title":"cli environment variables and options — cli-config","text":"Used detect code running CI. yes, avoid ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-debug-bad-end","dir":"Reference","previous_headings":"","what":"CLI_DEBUG_BAD_END","title":"cli environment variables and options — cli-config","text":"Whether warn cli_end() calls container close.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-no-builtin-theme","dir":"Reference","previous_headings":"","what":"CLI_NO_BUILTIN_THEME","title":"cli environment variables and options — cli-config","text":"Set true omit builtin theme.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-speed-time","dir":"Reference","previous_headings":"","what":"CLI_SPEED_TIME","title":"cli environment variables and options — cli-config","text":"Can used speed cli's timer. factor, e.g. setting 2 makes cli's time go twice fast.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-tick-time","dir":"Reference","previous_headings":"","what":"CLI_TICK_TIME","title":"cli environment variables and options — cli-config","text":"often cli timer alert, milliseconds.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cmder-root","dir":"Reference","previous_headings":"","what":"CMDER_ROOT","title":"cli environment variables and options — cli-config","text":"Used detect cmder detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"colorterm","dir":"Reference","previous_headings":"","what":"COLORTERM","title":"cli environment variables and options — cli-config","text":"Used detecting ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"conemuansi","dir":"Reference","previous_headings":"","what":"ConEmuANSI","title":"cli environment variables and options — cli-config","text":"Used detect ConEmu detecting number ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"emacs","dir":"Reference","previous_headings":"","what":"EMACS","title":"cli environment variables and options — cli-config","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"inside-emacs","dir":"Reference","previous_headings":"","what":"INSIDE_EMACS","title":"cli environment variables and options — cli-config","text":"Used detect Emacs.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"not-cran","dir":"Reference","previous_headings":"","what":"NOT_CRAN","title":"cli environment variables and options — cli-config","text":"Set true run tests / examples / checks, run CRAN.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"-r-check-package-name-","dir":"Reference","previous_headings":"","what":"_R_CHECK_PACKAGE_NAME_","title":"cli environment variables and options — cli-config","text":"Used detect R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-browser","dir":"Reference","previous_headings":"","what":"R_BROWSER","title":"cli environment variables and options — cli-config","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-gui-app-version","dir":"Reference","previous_headings":"","what":"R_GUI_APP_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect R.app macOS, decide console ANSI control sequences.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-package-dir","dir":"Reference","previous_headings":"","what":"R_PACKAGE_DIR","title":"cli environment variables and options — cli-config","text":"Used detect code running R CMD INSTALL.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-pdfviewer","dir":"Reference","previous_headings":"","what":"R_PDFVIEWER","title":"cli environment variables and options — cli-config","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"r-progress-no-examples","dir":"Reference","previous_headings":"","what":"R_PROGRESS_NO_EXAMPLES","title":"cli environment variables and options — cli-config","text":"Set true avoid running examples, outside R CMD check.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio","dir":"Reference","previous_headings":"","what":"RSTUDIO","title":"cli environment variables and options — cli-config","text":"Used detect RStudio, various functions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-console-color","dir":"Reference","previous_headings":"","what":"RSTUDIO_CONSOLE_COLOR","title":"cli environment variables and options — cli-config","text":"Used detect number colors RStudio. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-console-width","dir":"Reference","previous_headings":"","what":"RSTUDIO_CONSOLE_WIDTH","title":"cli environment variables and options — cli-config","text":"Used auto-detect console width RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-term","dir":"Reference","previous_headings":"","what":"RSTUDIO_TERM","title":"cli environment variables and options — cli-config","text":"Used detect RStudio build pane.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"teamcity-version","dir":"Reference","previous_headings":"","what":"TEAMCITY_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect TeamCity CI, turn ANSI hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"term","dir":"Reference","previous_headings":"","what":"TERM","title":"cli environment variables and options — cli-config","text":"Used detect console ANSI control sequences, terminal.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"term-program","dir":"Reference","previous_headings":"","what":"TERM_PROGRAM","title":"cli environment variables and options — cli-config","text":"Used detect iTerm dark theme detection ANSI hyperlink support detection.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"term-program-version","dir":"Reference","previous_headings":"","what":"TERM_PROGRAM_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect suitable iTerm version ANSI hyperlink support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"testthat","dir":"Reference","previous_headings":"","what":"TESTTHAT","title":"cli environment variables and options — cli-config","text":"Used detect running testthat tests.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"vte-version","dir":"Reference","previous_headings":"","what":"VTE_VERSION","title":"cli environment variables and options — cli-config","text":"Used detect suitable VTE version ANSI hyperlinks.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-pb","dir":"Reference","previous_headings":"","what":"cli__pb","title":"cli environment variables and options — cli-config","text":"option set progress bar updated, interpolating format string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"cli-record","dir":"Reference","previous_headings":"","what":"cli.record","title":"cli environment variables and options — cli-config","text":"Internal option mark state cli recording messages.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"crayon-colors","dir":"Reference","previous_headings":"","what":"crayon.colors","title":"cli environment variables and options — cli-config","text":"Deprecated option number ANSI colors, still supported cli, new options set. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"crayon-enabled","dir":"Reference","previous_headings":"","what":"crayon.enabled","title":"cli environment variables and options — cli-config","text":"Deprecated option turn ANSI colors /. still supported cli new options set. See num_ansi_colors().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"crayon-hyperlink","dir":"Reference","previous_headings":"","what":"crayon.hyperlink","title":"cli environment variables and options — cli-config","text":"Whether assume ANSI hyperlink support. See ansi_has_hyperlink_support().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"knitr-in-progress","dir":"Reference","previous_headings":"","what":"knitr.in.progress","title":"cli environment variables and options — cli-config","text":"Used detect knitr detecting interactive sessions ANSI color support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-config.html","id":"rstudio-notebook-executing","dir":"Reference","previous_headings":"","what":"rstudio.notebook.executing","title":"cli environment variables and options — cli-config","text":"Used detect knitr detecting interactive sessions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli-package.html","id":null,"dir":"Reference","previous_headings":"","what":"cli: Helpers for Developing Command Line Interfaces — cli-package","title":"cli: Helpers for Developing Command Line Interfaces — cli-package","text":"suite tools build attractive command line interfaces ('CLIs'), semantic elements: headings, lists, alerts, paragraphs, etc. Supports custom themes via 'CSS'-like language. also contains number lower level 'CLI' elements: rules, boxes, trees, 'Unicode' symbols 'ASCII' alternatives. support ANSI colors text styles well.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"cli: Helpers for Developing Command Line Interfaces — cli-package","text":"Maintainer: Gábor Csárdi csardi.gabor@gmail.com contributors: Hadley Wickham [contributor] Kirill Müller [contributor] Salim Brüggemann salim-b@pm.(ORCID) [contributor] Posit Software, PBC [copyright holder, funder]","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose multiple cli functions — cli","title":"Compose multiple cli functions — cli","text":"cli() record cli_* calls expr, emit together single message. useful want built larger piece output multiple cli_* calls.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose multiple cli functions — cli","text":"","code":"cli(expr)"},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose multiple cli functions — cli","text":"expr Expression contains cli_* calls. output collected sent single message.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compose multiple cli functions — cli","text":"Nothing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compose multiple cli functions — cli","text":"Use function build complex piece CLI make sense show pieces.","code":"cli({ cli_h1(\"Title\") cli_h2(\"Subtitle\") cli_ul(c(\"this\", \"that\", \"end\")) }) #> #> ── Title ───────────────────────────────────────────────────────────── #> #> ── Subtitle ── #> #> • this #> • that #> • end"},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":null,"dir":"Reference","previous_headings":"","what":"Signal an error, warning or message with a cli formatted message — cli_abort","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"functions let create error, warning diagnostic messages cli formatting, including inline styling, pluralization glue substitutions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"","code":"cli_abort( message, ..., call = .envir, .envir = parent.frame(), .frame = .envir ) cli_warn(message, ..., .envir = parent.frame()) cli_inform(message, ..., .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"message formatted via call cli_bullets(). ... Passed rlang::abort(), rlang::warn() rlang::inform(). call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages. .envir Environment evaluate glue expressions . .frame throwing context. Used default .trace_bottom, determine internal package mention internal errors .internal TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_abort.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Signal an error, warning or message with a cli formatted message — cli_abort","text":"","code":"n <- \"boo\" cli_abort(c( \"{.var n} must be a numeric vector\", \"x\" = \"You've supplied a {.cls {class(n)}} vector.\" )) #> Error: #> ! `n` must be a numeric vector #> ✖ You've supplied a vector. #> Run `rlang::last_error()` to see where the error occurred. len <- 26 idx <- 100 cli_abort(c( \"Must index an existing element:\", \"i\" = \"There {?is/are} {len} element{?s}.\", \"x\" = \"You've tried to subset element {idx}.\" )) #> Error: #> ! Must index an existing element: #> ℹ There are 26 elements. #> ✖ You've tried to subset element 100. #> Run `rlang::last_error()` to see where the error occurred."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI alerts — cli_alert","title":"CLI alerts — cli_alert","text":"Alerts typically short status messages.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI alerts — cli_alert","text":"","code":"cli_alert(text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame()) cli_alert_success( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() ) cli_alert_danger( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() ) cli_alert_warning( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() ) cli_alert_info( text, id = NULL, class = NULL, wrap = FALSE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI alerts — cli_alert","text":"text Text alert. id Id alert element. Can used themes. class Class alert element. Can used themes. wrap Whether auto-wrap text alert. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"success","dir":"Reference","previous_headings":"","what":"Success","title":"CLI alerts — cli_alert","text":"","code":"nbld <- 11 tbld <- prettyunits::pretty_sec(5.6) cli_alert_success(\"Built {.emph {nbld}} status report{?s} in {tbld}.\") #> ✔ Built 11 status reports in 5.6s."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"info","dir":"Reference","previous_headings":"","what":"Info","title":"CLI alerts — cli_alert","text":"","code":"cfl <- \"~/.cache/files/latest.cache\" cli_alert_info(\"Updating cache file {.path {cfl}}.\") #> ℹ Updating cache file ~/.cache/files/latest.cache."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"warning","dir":"Reference","previous_headings":"","what":"Warning","title":"CLI alerts — cli_alert","text":"","code":"cfl <- \"~/.cache/files/latest.cache\" cli_alert_warning(\"Failed to update cache file {.path {cfl}}.\") #> ! Failed to update cache file ~/.cache/files/latest.cache."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"danger","dir":"Reference","previous_headings":"","what":"Danger","title":"CLI alerts — cli_alert","text":"","code":"cfl <- \"~/.config/report.yaml\" cli_alert_danger(\"Cannot validate config file at {.path {cfl}}.\") #> ✖ Cannot validate config file at ~/.config/report.yaml."},{"path":"https://cli.r-lib.org/dev/reference/cli_alert.html","id":"text-wrapping","dir":"Reference","previous_headings":"","what":"Text wrapping","title":"CLI alerts — cli_alert","text":"Alerts printed without wrapping, unless set wrap = TRUE:","code":"cli_alert_info(\"Data columns: {.val {names(mtcars)}}.\") cli_alert_info(\"Data columns: {.val {names(mtcars)}}.\", wrap = TRUE) #> ℹ Data columns: \"mpg\", \"cyl\", \"disp\", \"hp\", \"drat\", \"wt\", \"qsec\", \"vs\", \"am\", \"g #> ear\", and \"carb\". #> ℹ Data columns: \"mpg\", \"cyl\", \"disp\", \"hp\", \"drat\", \"wt\", \"qsec\", #> \"vs\", \"am\", \"gear\", and \"carb\"."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI block quote — cli_blockquote","title":"CLI block quote — cli_blockquote","text":"section quoted another source. typically indented.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI block quote — cli_blockquote","text":"","code":"cli_blockquote( quote, citation = NULL, id = NULL, class = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI block quote — cli_blockquote","text":"quote Text quotation. citation Source quotation, typically link name person. id Element id, string. NULL, new id generated returned. class Class name, sting. Can used themes. .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_blockquote.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CLI block quote — cli_blockquote","text":"","code":"evil <- paste( \"The real problem is that programmers have spent far too much time\", \"worrying about efficiency in the wrong places and at the wrong\", \"times; premature optimization is the root of all evil (or at least\", \"most of it) in programming.\") cli_blockquote(evil, citation = \"Donald Ervin Knuth\") #> #> “The real problem is that programmers have spent far #> too much time worrying about efficiency in the wrong #> places and at the wrong times; premature optimization #> is the root of all evil (or at least most of it) in #> programming.” #> — Donald Ervin Knuth #>"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":null,"dir":"Reference","previous_headings":"","what":"List of items — cli_bullets","title":"List of items — cli_bullets","text":"often useful print list items, tasks function package performs, list notes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List of items — cli_bullets","text":"","code":"cli_bullets(text, id = NULL, class = NULL, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List of items — cli_bullets","text":"text Character vector items. See details names interpreted. id Optional id div.bullets element, can used themes. class Optional additional class(es) div.bullets element. .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"List of items — cli_bullets","text":"Items may formatted differently, e.g. can prefix symbol. Formatting specified names text, can themed. cli creates div element class bullets whole bullet list. item another div element class bullet-, name entry text. Entries text without name create div element class bullet-empty, name single space character, class bullet-space. built-theme defines following item types: name: Item without prefix. : Indented item. *: Item bullet. >: Item arrow pointer. v: Item green \"tick\" symbol, like cli_alert_success(). x: Item ref cross, like cli_alert_danger(). !: Item yellow exclamation mark, like cli_alert_warning(). : Info item, like cli_alert_info(). can define new item type simply defining theming corresponding bullet- classes.","code":"cli_bullets(c( \"noindent\", \" \" = \"indent\", \"*\" = \"bullet\", \">\" = \"arrow\", \"v\" = \"success\", \"x\" = \"danger\", \"!\" = \"warning\", \"i\" = \"info\" )) #> noindent #> indent #> • bullet #> → arrow #> ✔ success #> ✖ danger #> ! warning #> ℹ info"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":null,"dir":"Reference","previous_headings":"","what":"List of verbatim items — cli_bullets_raw","title":"List of verbatim items — cli_bullets_raw","text":"cli_format_bullets_raw() similar cli_bullets(), perform inline styling glue substitutions input.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List of verbatim items — cli_bullets_raw","text":"","code":"cli_bullets_raw(text, id = NULL, class = NULL) format_bullets_raw(text, id = NULL, class = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List of verbatim items — cli_bullets_raw","text":"text Character vector items. See details names interpreted. id Optional id div.bullets element, can used themes. class Optional additional class(es) div.bullets element.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_bullets_raw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"List of verbatim items — cli_bullets_raw","text":"format_bullets_raw() returns output instead printing .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":null,"dir":"Reference","previous_headings":"","what":"A block of code — cli_code","title":"A block of code — cli_code","text":"helper function creates div class code calls cli_verbatim() output code lines. builtin theme formats containers specially. particular, adds syntax highlighting valid R code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A block of code — cli_code","text":"","code":"cli_code( lines = NULL, ..., language = \"R\", .auto_close = TRUE, .envir = environment() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A block of code — cli_code","text":"lines Character vector, line line code, newline characters also create new lines. Note glue substitution performed code. ... character vectors, appended lines. language Programming language. also added class, addition code. .auto_close Passed cli_div() creating container code. default code container closed emitting lines ... via cli_verbatim(). can keep container open .auto_close /.envir, calling cli_verbatim() add () code. Note code formatted syntax highlighted separately cli_verbatim() call. .envir Passed cli_div() creating container code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A block of code — cli_code","text":"id container contains code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_code.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A block of code — cli_code","text":"","code":"myfun <- function() { message(\"Just an example function\") graphics::pairs(iris, col = 1:4) } cli_code(format(myfun)) #> function () #> { #> message(\"Just an example function\") #> graphics::pairs(iris, col = 1:4) #> }"},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":null,"dir":"Reference","previous_headings":"","what":"Debug cli internals — cli_debug_doc","title":"Debug cli internals — cli_debug_doc","text":"Return current state cli app. includes currently open tags, ids, classes computed styles.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Debug cli internals — cli_debug_doc","text":"","code":"cli_debug_doc(app = default_app() %||% start_app())"},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Debug cli internals — cli_debug_doc","text":"app cli app debug. Defaults current app. app, creates one calling start_app().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Debug cli internals — cli_debug_doc","text":"Data frame columns: tag, id, class (space separated), theme (id theme element added), styles (computed styles element).","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Debug cli internals — cli_debug_doc","text":"returned data frame print method, want create plain data frame , index empty bracket: cli_debug_doc()[]. see currently active themes, use app$themes, e.g. default app: default_app()$themes.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_debug_doc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Debug cli internals — cli_debug_doc","text":"","code":"if (FALSE) { # \\dontrun{ cli_debug_doc() olid <- cli_ol() cli_li() cli_debug_doc() cli_debug_doc()[] cli_end(olid) cli_debug_doc() } # }"},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":null,"dir":"Reference","previous_headings":"","what":"Generic CLI container — cli_div","title":"Generic CLI container — cli_div","text":"See containers. cli_div container special, may add new themes, valid within container.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generic CLI container — cli_div","text":"","code":"cli_div( id = NULL, class = NULL, theme = NULL, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generic CLI container — cli_div","text":"id Element id, string. NULL, new id generated returned. class Class name, sting. Can used themes. theme custom theme container. See themes. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generic CLI container — cli_div","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"custom-themes","dir":"Reference","previous_headings":"","what":"Custom themes","title":"Generic CLI container — cli_div","text":"","code":"d <- cli_div(theme = list(h1 = list(color = \"cyan\", \"font-weight\" = \"bold\"))) cli_h1(\"Custom title\") cli_end(d) #> #> Custom title"},{"path":"https://cli.r-lib.org/dev/reference/cli_div.html","id":"auto-closing","dir":"Reference","previous_headings":"","what":"Auto-closing","title":"Generic CLI container — cli_div","text":"default cli_div() closed automatically calling frame exits.","code":"div <- function() { cli_div(class = \"tmp\", theme = list(.tmp = list(color = \"yellow\"))) cli_text(\"This is yellow\") } div() cli_text(\"This is not yellow any more\") #> This is yellow #> This is not yellow any more"},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":null,"dir":"Reference","previous_headings":"","what":"Definition list — cli_dl","title":"Definition list — cli_dl","text":"definition list container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Definition list — cli_dl","text":"","code":"cli_dl( items = NULL, labels = names(items), id = NULL, class = NULL, .close = TRUE, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Definition list — cli_dl","text":"items Named character vector, NULL. NULL, used list items. labels Item labels. Defaults names items. id Id list container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class list container. Can used themes. .close Whether close list container items specified. FALSE new items can added list. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Definition list — cli_dl","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"all-items-at-once","dir":"Reference","previous_headings":"","what":"All items at once","title":"Definition list — cli_dl","text":"","code":"fun <- function() { cli_dl(c(foo = \"one\", bar = \"two\", baz = \"three\")) } fun() #> foo: one #> bar: two #> baz: three"},{"path":"https://cli.r-lib.org/dev/reference/cli_dl.html","id":"items-one-by-one","dir":"Reference","previous_headings":"","what":"Items one by one","title":"Definition list — cli_dl","text":"","code":"fun <- function() { cli_dl() cli_li(c(foo = \"{.emph one}\")) cli_li(c(bar = \"two\")) cli_li(c(baz = \"three\")) } fun() #> foo: one #> bar: two #> baz: three"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":null,"dir":"Reference","previous_headings":"","what":"Close a CLI container — cli_end","title":"Close a CLI container — cli_end","text":"Containers aut0-close default, sometimes need explicitly close . Closing container also closes nested containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Close a CLI container — cli_end","text":"","code":"cli_end(id = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Close a CLI container — cli_end","text":"id Id container close. missing, current container closed, .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"explicit-closing","dir":"Reference","previous_headings":"","what":"Explicit closing","title":"Close a CLI container — cli_end","text":"","code":"cnt <- cli_par() cli_text(\"First paragraph.\") cli_end(cnt) cnt <- cli_par() cli_text(\"Second paragraph.\") cli_end(cnt) #> First paragraph. #> #> Second paragraph. #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"closing-a-stack-of-containers","dir":"Reference","previous_headings":"","what":"Closing a stack of containers","title":"Close a CLI container — cli_end","text":"","code":"list <- cli_ul() cli_li(\"Item one:\") cli_li(\"Item two:\") cli_par() cli_text(\"Still item two.\") cli_end(list) cli_text(\"Not in the list any more\") #> • Item one: #> • Item two: #> Still item two. #> #> Not in the list any more"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"omitting-id","dir":"Reference","previous_headings":"","what":"Omitting id","title":"Close a CLI container — cli_end","text":"id omitted, container opened last closed.","code":"cli_par() cli_text(\"First paragraph\") cli_end() cli_par() cli_text(\"Second paragraph\") cli_end() #> First paragraph #> #> Second paragraph #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_end.html","id":"debugging-containers","dir":"Reference","previous_headings":"","what":"Debugging containers","title":"Close a CLI container — cli_end","text":"can use internal cli:::cli_debug_doc() function see currently open containers.","code":"fun <- function() { cli_div(id = \"mydiv\") cli_par(class = \"myclass\") cli:::cli_debug_doc() } fun() #> #> #>
          +theme #> "},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":null,"dir":"Reference","previous_headings":"","what":"Capture the output of cli functions instead of printing it — cli_fmt","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"Capture output cli functions instead printing ","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"","code":"cli_fmt(expr, collapse = FALSE, strip_newline = FALSE)"},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"expr Expression evaluate, containing cli_*() calls, typically. collapse Whether collapse output single character scalar, return character vector one element line. strip_newline Whether strip trailing newline.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_fmt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Capture the output of cli functions instead of printing it — cli_fmt","text":"","code":"cli_fmt({ cli_alert_info(\"Loading data file\") cli_alert_success(\"Loaded data file\") }) #> [1] \"\\033[36mℹ\\033[39m Loading data file\" #> [2] \"\\033[32m✔\\033[39m Loaded data file\""},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Format a value for printing — cli_format","title":"Format a value for printing — cli_format","text":"function can used directly, via {.val ...} inline style. {.val {expr}} calls cli_format() automatically value expr, styling collapsing .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format a value for printing — cli_format","text":"","code":"cli_format(x, style = NULL, ...) # Default S3 method cli_format(x, style = NULL, ...) # S3 method for class 'character' cli_format(x, style = NULL, ...) # S3 method for class 'numeric' cli_format(x, style = NULL, ...)"},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format a value for printing — cli_format","text":"x object format. style List formatting options, see individual methods style options support. ... Additional arguments methods.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"default-style","dir":"Reference","previous_headings":"","what":"Default style","title":"Format a value for printing — cli_format","text":"","code":"months <- month.name[1:3] cli_text(\"{.val {months}}\") #> \"January\", \"February\", and \"March\" nums <- 1:5 / 7 cli_text(\"{.val {nums}}\") #> 0.142857142857143, 0.285714285714286, 0.428571428571429, #> 0.571428571428571, and 0.714285714285714"},{"path":"https://cli.r-lib.org/dev/reference/cli_format.html","id":"styling-with-themes","dir":"Reference","previous_headings":"","what":"Styling with themes","title":"Format a value for printing — cli_format","text":"possible define new S3 methods cli_format used automatically {.val ...} expressions.","code":"nums <- 1:5 / 7 divid <- cli_div(theme = list(.val = list(digits = 3))) cli_text(\"{.val {nums}}\") cli_end(divid) #> 0.143, 0.286, 0.429, 0.571, and 0.714 cli_format.month <- function(x, style = NULL, ...) { x <- encodeString(substr(x, 1, 3), quote = \"\\\"\") NextMethod(\"cli_format\") } registerS3method(\"cli_format\", \"month\", cli_format.month) months <- structure(month.name[1:3], class = \"month\") cli_text(\"{.val {months}}\") #> \"Jan\", \"Feb\", and \"Mar\""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a format method for an object using cli tools — cli_format_method","title":"Create a format method for an object using cli tools — cli_format_method","text":"method can typically used format() S3 methods. print() method class can easily defined terms format() method. See examples .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a format method for an object using cli tools — cli_format_method","text":"","code":"cli_format_method(expr, theme = getOption(\"cli.theme\"))"},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a format method for an object using cli tools — cli_format_method","text":"expr Expression calls cli_* methods, base::cat() base::print() format object's printout. theme Theme use formatting.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a format method for an object using cli tools — cli_format_method","text":"Character vector, one element line printout.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_format_method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a format method for an object using cli tools — cli_format_method","text":"","code":"# Let's create format and print methods for a new S3 class that # represents the an installed R package: `r_package` # An `r_package` will contain the DESCRIPTION metadata of the package # and also its installation path. new_r_package <- function(pkg) { tryCatch( desc <- packageDescription(pkg), warning = function(e) stop(\"Cannot find R package `\", pkg, \"`\") ) file <- dirname(attr(desc, \"file\")) if (basename(file) != pkg) file <- dirname(file) structure( list(desc = unclass(desc), lib = dirname(file)), class = \"r_package\" ) } format.r_package <- function(x, ...) { cli_format_method({ cli_h1(\"{.pkg {x$desc$Package}} {cli::symbol$line} {x$desc$Title}\") cli_text(\"{x$desc$Description}\") cli_ul(c( \"Version: {x$desc$Version}\", if (!is.null(x$desc$Maintainer)) \"Maintainer: {x$desc$Maintainer}\", \"License: {x$desc$License}\" )) if (!is.na(x$desc$URL)) cli_text(\"See more at {.url {x$desc$URL}}\") }) } # Now the print method is easy: print.r_package <- function(x, ...) { cat(format(x, ...), sep = \"\\n\") } # Try it out new_r_package(\"cli\") #> $desc #> $desc$Package #> [1] \"cli\" #> #> $desc$Title #> [1] \"Helpers for Developing Command Line Interfaces\" #> #> $desc$Version #> [1] \"3.6.3.9000\" #> #> $desc$`Authors@R` #> [1] \"c(\\n person(\\\"Gábor\\\", \\\"Csárdi\\\", , \\\"csardi.gabor@gmail.com\\\", role = c(\\\"aut\\\", \\\"cre\\\")),\\n person(\\\"Hadley\\\", \\\"Wickham\\\", role = \\\"ctb\\\"),\\n person(\\\"Kirill\\\", \\\"Müller\\\", role = \\\"ctb\\\"),\\n person(\\\"Salim\\\", \\\"Brüggemann\\\", , \\\"salim-b@pm.me\\\", role = \\\"ctb\\\",\\n comment = c(ORCID = \\\"0000-0002-5329-5987\\\")),\\n person(\\\"Posit Software, PBC\\\", role = c(\\\"cph\\\", \\\"fnd\\\"))\\n )\" #> #> $desc$Description #> [1] \"A suite of tools to build attractive command line interfaces\\n ('CLIs'), from semantic elements: headings, lists, alerts, paragraphs,\\n etc. Supports custom themes via a 'CSS'-like language. It also\\n contains a number of lower level 'CLI' elements: rules, boxes, trees,\\n and 'Unicode' symbols with 'ASCII' alternatives. It support ANSI\\n colors and text styles as well.\" #> #> $desc$License #> [1] \"MIT + file LICENSE\" #> #> $desc$URL #> [1] \"https://cli.r-lib.org, https://github.com/r-lib/cli\" #> #> $desc$BugReports #> [1] \"https://github.com/r-lib/cli/issues\" #> #> $desc$Depends #> [1] \"R (>= 3.4)\" #> #> $desc$Imports #> [1] \"utils\" #> #> $desc$Suggests #> [1] \"callr, covr, crayon, digest, glue (>= 1.6.0), grDevices,\\nhtmltools, htmlwidgets, knitr, methods, mockery, processx, ps\\n(>= 1.3.4.9000), rlang (>= 1.0.2.9003), rmarkdown, rprojroot,\\nrstudioapi, testthat, tibble, whoami, withr\" #> #> $desc$`Config/Needs/website` #> [1] \"r-lib/asciicast, bench, brio, cpp11, decor, desc,\\nfansi, prettyunits, sessioninfo, tidyverse/tidytemplate,\\nusethis, vctrs\" #> #> $desc$`Config/testthat/edition` #> [1] \"3\" #> #> $desc$Encoding #> [1] \"UTF-8\" #> #> $desc$RoxygenNote #> [1] \"7.3.2\" #> #> $desc$RemotePkgRef #> [1] \"local::.\" #> #> $desc$RemoteType #> [1] \"local\" #> #> $desc$NeedsCompilation #> [1] \"yes\" #> #> $desc$Packaged #> [1] \"2024-10-03 20:11:36 UTC; runner\" #> #> $desc$Author #> [1] \"Gábor Csárdi [aut, cre],\\n Hadley Wickham [ctb],\\n Kirill Müller [ctb],\\n Salim Brüggemann [ctb] (),\\n Posit Software, PBC [cph, fnd]\" #> #> $desc$Maintainer #> [1] \"Gábor Csárdi \" #> #> $desc$Built #> [1] \"R 4.4.1; x86_64-pc-linux-gnu; 2024-10-03 20:11:38 UTC; unix\" #> #> attr(,\"file\") #> [1] \"/home/runner/work/_temp/Library/cli/Meta/package.rds\" #> #> $lib #> [1] \"/home/runner/work/_temp/Library\" #> #> attr(,\"class\") #> [1] \"r_package\" # The formatting of the output depends on the current theme: opt <- options(cli.theme = simple_theme()) print(new_r_package(\"cli\")) #> #> ── cli ─ Helpers for Developing Command Line Interfaces ────────────────── #> A suite of tools to build attractive command line interfaces ('CLIs'), #> from semantic elements: headings, lists, alerts, paragraphs, etc. #> Supports custom themes via a 'CSS'-like language. It also contains a #> number of lower level 'CLI' elements: rules, boxes, trees, and 'Unicode' #> symbols with 'ASCII' alternatives. It support ANSI colors and text styles #> as well. #> • Version: 3.6.3.9000 #> • Maintainer: Gábor Csárdi #> • License: MIT + file LICENSE #> See more at options(opt) # <- restore theme"},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI headings — cli_h1","title":"CLI headings — cli_h1","text":"cli three levels headings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI headings — cli_h1","text":"","code":"cli_h1(text, id = NULL, class = NULL, .envir = parent.frame()) cli_h2(text, id = NULL, class = NULL, .envir = parent.frame()) cli_h3(text, id = NULL, class = NULL, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI headings — cli_h1","text":"text Text heading. can contain inline markup. id Id heading element, string. can used themes. class Class heading element, string. can used themes. .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_h1.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CLI headings — cli_h1","text":"headings look default builtin theme.","code":"cli_h1(\"Header {.emph 1}\") cli_h2(\"Header {.emph 2}\") cli_h3(\"Header {.emph 3}\") #> #> ── Header 1 ────────────────────────────────────────────────────────── #> #> ── Header 2 ── #> #> ── Header 3"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI list item(s) — cli_li","title":"CLI list item(s) — cli_li","text":"list item container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI list item(s) — cli_li","text":"","code":"cli_li( items = NULL, labels = names(items), id = NULL, class = NULL, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI list item(s) — cli_li","text":"items Character vector items, NULL. labels definition lists item labels. id Id new container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class item container. Can used themes. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CLI list item(s) — cli_li","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_li.html","id":"nested-lists","dir":"Reference","previous_headings":"","what":"Nested lists","title":"CLI list item(s) — cli_li","text":"","code":"fun <- function() { ul <- cli_ul() cli_li(\"one:\") cli_ol(letters[1:3]) cli_li(\"two:\") cli_li(\"three\") cli_end(ul) } fun() #> • one: #> 1. a #> 2. b #> 3. c #> • two: #> • three"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_list_themes.html","id":null,"dir":"Reference","previous_headings":"","what":"List the currently active themes — cli_list_themes","title":"List the currently active themes — cli_list_themes","text":"active app, calls start_app().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_list_themes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List the currently active themes — cli_list_themes","text":"","code":"cli_list_themes()"},{"path":"https://cli.r-lib.org/dev/reference/cli_list_themes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List the currently active themes — cli_list_themes","text":"list data frames active themes. data frame row style applies selected CLI tree nodes. data frame columns: selector: original CSS-like selector string. See themes. parsed: parsed selector, used cli matching nodes. style: original style. cnt: id container style currently applied , NA style used.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":null,"dir":"Reference","previous_headings":"","what":"Ordered CLI list — cli_ol","title":"Ordered CLI list — cli_ol","text":"ordered list container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ordered CLI list — cli_ol","text":"","code":"cli_ol( items = NULL, id = NULL, class = NULL, .close = TRUE, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ordered CLI list — cli_ol","text":"items NULL, character vector. element vector one list item, list container closed default (see .close argument). id Id list container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class list container. Can used themes. .close Whether close list container items specified. FALSE new items can added list. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ordered CLI list — cli_ol","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"adding-all-items-at-once","dir":"Reference","previous_headings":"","what":"Adding all items at once","title":"Ordered CLI list — cli_ol","text":"","code":"fun <- function() { cli_ol(c(\"one\", \"two\", \"three\")) } fun() #> 1. one #> 2. two #> 3. three"},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"adding-items-one-by-one","dir":"Reference","previous_headings":"","what":"Adding items one by one","title":"Ordered CLI list — cli_ol","text":"","code":"## Adding items one by one fun <- function() { cli_ol() cli_li(\"{.emph one}\") cli_li(\"{.emph two}\") cli_li(\"{.emph three}\") cli_end() } fun() #> 1. one #> 2. two #> 3. three"},{"path":"https://cli.r-lib.org/dev/reference/cli_ol.html","id":"nested-lists","dir":"Reference","previous_headings":"","what":"Nested lists","title":"Ordered CLI list — cli_ol","text":"","code":"fun <- function() { cli_div(theme = list(ol = list(\"margin-left\" = 2))) cli_ul() cli_li(\"one\") cli_ol(c(\"foo\", \"bar\", \"foobar\")) cli_li(\"two\") cli_end() cli_end() } fun() #> • one #> 1. foo #> 2. bar #> 3. foobar #> • two"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":null,"dir":"Reference","previous_headings":"","what":"The connection option that cli would use — cli_output_connection","title":"The connection option that cli would use — cli_output_connection","text":"Note refers current R process. output produced another process, relevant.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The connection option that cli would use — cli_output_connection","text":"","code":"cli_output_connection()"},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The connection option that cli would use — cli_output_connection","text":"Connection object.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_output_connection.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The connection option that cli would use — cli_output_connection","text":"interactive sessions standard output chosen, otherwise standard error used. avoid painting output messages red R GUIs.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI paragraph — cli_par","title":"CLI paragraph — cli_par","text":"builtin theme leaves empty line paragraphs. See also containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI paragraph — cli_par","text":"","code":"cli_par(id = NULL, class = NULL, .auto_close = TRUE, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI paragraph — cli_par","text":"id Element id, string. NULL, new id generated returned. class Class name, sting. Can used themes. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CLI paragraph — cli_par","text":"id new container element, invisibly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_par.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CLI paragraph — cli_par","text":"","code":"clifun <- function() { cli_par() cli_text(cli:::lorem_ipsum()) } clifun() clifun() #> Sunt anim ullamco Lorem qui mollit anim est in deserunt adipisicing. #> Enim deserunt laborum ad qui qui. Anim esse non anim magna Lorem #> consequat dolore labore cupidatat magna et. Esse nulla eiusmod Lorem #> exercitation cupidatat velit enim exercitation excepteur non officia #> incididunt. Id laborum dolore commodo Lorem esse ea sint proident. #> #> Fugiat mollit in Lorem velit qui exercitation ipsum consectetur ad #> nisi ut eu do ullamco. Mollit officia reprehenderit culpa Lorem est #> reprehenderit excepteur enim magna incididunt ea. Irure nisi ad #> exercitation deserunt enim anim excepteur quis minim laboris veniam #> nulla pariatur. Enim irure aute nulla irure qui non. Minim velit #> proident sunt sint. Proident sit occaecat ex aute. #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":null,"dir":"Reference","previous_headings":"","what":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"cli_process_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. Typically call cli_process_start() start process, cli_process_done() done. error happens cli_process_done() called, cli automatically shows message unsuccessful termination.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"","code":"cli_process_start( msg, msg_done = paste(msg, \"... done\"), msg_failed = paste(msg, \"... failed\"), on_exit = c(\"auto\", \"failed\", \"done\"), msg_class = \"alert-info\", done_class = \"alert-success\", failed_class = \"alert-danger\", .auto_close = TRUE, .envir = parent.frame() ) cli_process_done( id = NULL, msg_done = NULL, .envir = parent.frame(), done_class = \"alert-success\" ) cli_process_failed( id = NULL, msg = NULL, msg_failed = NULL, .envir = parent.frame(), failed_class = \"alert-danger\" )"},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"msg message show indicate start process computation. collapsed single string, first line kept cut console_width(). msg_done message use successful termination. msg_failed message use unsuccessful termination. on_exit Whether process fail terminate successfully calling function (environment .envir) exits. msg_class style class add message. Use empty string suppress styling. done_class style class add successful termination message. Use empty string suppress styling.failed_class style class add unsuccessful termination message. Use empty string suppress styling..auto_close Whether clear status bar calling function finishes (.envir removed stack, specified). .envir Environment evaluate glue expressions . also used auto-clear status bar .auto_close TRUE. id Id status bar container clear. id id current status bar (overwritten another status bar container), status bar cleared. NULL (default) status bar always cleared.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"Id status bar container.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"handle errors process computation, can opposite: call cli_process_start() on_exit = \"done\", error handler call cli_process_failed(). cli automatically call cli_process_done() successful termination, calling function finishes. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_process_start.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Indicate the start and termination of some computation in the status bar (superseded) — cli_process_start","text":"","code":"## Failure by default fun <- function() { cli_process_start(\"Calculating\") if (interactive()) Sys.sleep(1) if (runif(1) < 0.5) stop(\"Failed\") cli_process_done() } tryCatch(fun(), error = function(err) err) #> ℹ Calculating #> ✖ Calculating ... failed #> #> ## Success by default fun2 <- function() { cli_process_start(\"Calculating\", on_exit = \"done\") tryCatch({ if (interactive()) Sys.sleep(1) if (runif(1) < 0.5) stop(\"Failed\") }, error = function(err) cli_process_failed()) } fun2() #> ℹ Calculating #> ✔ Calculating ... done #>"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a progress bar to a mapping function or for loop — cli_progress_along","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"Note function currently experimental! Use cli_progress_along() mapping function loop, add progress bar. uses cli_progress_bar() internally.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"","code":"cli_progress_along( x, name = NULL, total = length(x), ..., .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"x Sequence add progress bar . name Name progress bar, label, passed cli_progress_bar(). total Passed cli_progress_bar(). ... Passed cli_progress_bar(). .envir Passed cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"index vector 1 length(x) triggers progress updates iterate .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"for-loop","dir":"Reference","previous_headings":"","what":"for loop","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"loop cli_progress_along() looks like : complete example:","code":"for (i in cli_progress_along(seq)) { ... } clifun <- function() { for (i in cli_progress_along(1:100, \"Downloading\")) { Sys.sleep(4/100) } } clifun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"lapply-and-other-mapping-functions","dir":"Reference","previous_headings":"","what":"lapply() and other mapping functions","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"look like : complete example:","code":"lapply(cli_progress_along(X), function(i) ...) res <- lapply(cli_progress_along(1:100, \"Downloading\"), function(i) { Sys.sleep(4/100) })"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"custom-format-string","dir":"Reference","previous_headings":"","what":"Custom format string","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"","code":"clifun <- function() { for (i in cli_progress_along(1:100, format = \"Downloading data file {cli::pb_current}\")) { Sys.sleep(4/100) } } clifun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_along.html","id":"breaking-out-of-loops","dir":"Reference","previous_headings":"","what":"Breaking out of loops","title":"Add a progress bar to a mapping function or for loop — cli_progress_along","text":"Note use break loop, probably want terminate progress bar explicitly breaking loop, right loop:","code":"for (i in cli_progress_along(seq)) { ... if (cond) cli_progress_done() && break ... }"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":null,"dir":"Reference","previous_headings":"","what":"cli progress bars — cli_progress_bar","title":"cli progress bars — cli_progress_bar","text":"reference manual three functions create, update terminate progress bars. tutorial see cli progress bars. cli_progress_bar() creates new progress bar. cli_progress_update() updates state progress bar, potentially display well. cli_progress_done() terminates progress bar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli progress bars — cli_progress_bar","text":"","code":"cli_progress_bar( name = NULL, status = NULL, type = c(\"iterator\", \"tasks\", \"download\", \"custom\"), total = NA, format = NULL, format_done = NULL, format_failed = NULL, clear = getOption(\"cli.progress_clear\", TRUE), current = TRUE, auto_terminate = type != \"download\", extra = NULL, .auto_close = TRUE, .envir = parent.frame() ) cli_progress_update( inc = NULL, set = NULL, total = NULL, status = NULL, extra = NULL, id = NULL, force = FALSE, .envir = parent.frame() ) cli_progress_done(id = NULL, .envir = parent.frame(), result = \"done\")"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"cli progress bars — cli_progress_bar","text":"name typically used label, short, 20 characters. status New status string progress bar, NULL. type Type progress bar. used select default display format specified. Currently supported types: iterator: e.g. loop mapping function, tasks: (typically small) number tasks, download: download one file, custom: custom type, format must NULL type. total Total number progress units, NA unknown. cli_progress_update() can update total number units. handy know size download beginning, also cases. format set NULL, format (plus format_done format_failed) updated change total NA number. .e. default format strings updated, custom ones . format Format string. specified custom progress bars, otherwise optional, default display selected based progress bat type whether number total units known. Format strings may contain glue substitution, support pluralization cli styling. See progress-variables special variables can use custom format. format_done Format string successful termination. default format. format_failed Format string unsuccessful termination. default format. clear Whether remove progress bar screen terminated. Defaults cli.progress_clear option, TRUE unset. current Whether use progress bar current progress bar calling function. See 'current progress bar' . auto_terminate Whether terminate progress bar number current units reaches number total units. extra Extra data add progress bar. can used custom format strings example. named list. cli_progress_update() can update extra data. Often can get away referring local variables format string, need use argument. Explicitly including constants variables extra can result cleaner code. rare cases need refer progress bar multiple functions, can extra. .auto_close Whether terminate progress bar calling function (one execution environment .envir exits. (Auto termination work progress bars created global environment, e.g. script.) .envir environment use auto-termination glue substitution. also used find set current progress bar. inc Increment progress units. ignored set NULL. set Set current number progress units value. Ignored NULL. id Progress bar update terminate. NULL, current progress bar calling function (.envir specified) updated terminated. force Whether force display update, even update due. result String select successful unsuccessful termination. used progress bar cleared screen. can one \"done\", \"failed\", \"clear\", \"auto\".","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli progress bars — cli_progress_bar","text":"cli_progress_bar() returns id new progress bar. id string constant. cli_progress_update() returns id progress bar, invisibly. cli_progress_done() returns TRUE, invisibly, always.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"basic-usage","dir":"Reference","previous_headings":"","what":"Basic usage","title":"cli progress bars — cli_progress_bar","text":"cli_progress_bar() creates progress bar, cli_progress_update() updates existing progress bar, cli_progress_done() terminates . good practice always set name argument, make progress bar informative.","code":"clean <- function() { cli_progress_bar(\"Cleaning data\", total = 100) for (i in 1:100) { Sys.sleep(5/100) cli_progress_update() } cli_progress_done() } clean()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"progress-bar-types","dir":"Reference","previous_headings":"","what":"Progress bar types","title":"cli progress bars — cli_progress_bar","text":"three builtin types progress bars, custom type.","code":"tasks <- function() { cli_progress_bar(\"Tasks\", total = 3, type = \"tasks\") for (i in 1:3) { Sys.sleep(1) cli_progress_update() } cli_progress_done() } tasks()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"unknown-total","dir":"Reference","previous_headings":"","what":"Unknown total","title":"cli progress bars — cli_progress_bar","text":"total known, cli shows different progress bar. Note can also set total cli_progress_update(), known progress bar created, learn later.","code":"nototal <- function() { cli_progress_bar(\"Parameter tuning\") for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } cli_progress_done() } nototal()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"clearing-the-progress-bar","dir":"Reference","previous_headings":"","what":"Clearing the progress bar","title":"cli progress bars — cli_progress_bar","text":"default cli removes terminated progress bars screen, terminal supports . want change , use clear argument cli_progress_bar(), cli.progress_clear global option (see cli-config) change . (cli documentation usually set cli.progress_clear FALSE, users can see finished progress bars look.) example first progress bar cleared, second .","code":"fun <- function() { cli_progress_bar(\"Data cleaning\", total = 100, clear = TRUE) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } cli_progress_bar(\"Parameter tuning\", total = 100, clear = FALSE) for (i in 1:100) { Sys.sleep(3/100) cli_progress_update() } } fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"initial-delay","dir":"Reference","previous_headings":"","what":"Initial delay","title":"cli progress bars — cli_progress_bar","text":"Updating progress bar screen costly, cli tries avoid quick loops. default progress bar shown two seconds, half less 50% iterations complete. can change two second default cli.progress_show_after global option (see cli-config). (cli documentation usually set cli.progress_show_after 0 (zero seconds), progress bars shown immediately.) example show progress bar one second, 50% iterations remain one second.","code":"fun <- function() { cli_alert(\"Starting now, at {Sys.time()}\") cli_progress_bar( total = 100, format = \"{cli::pb_bar} {pb_percent} @ {Sys.time()}\" ) for (i in 1:100) { Sys.sleep(4/100) cli_progress_update() } } options(cli.progress_show_after = 2) fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"the-current-progress-bar","dir":"Reference","previous_headings":"","what":"The current progress bar","title":"cli progress bars — cli_progress_bar","text":"default cli sets new progress bar current progress bar calling function. current progress bar default one cli progress bar operations. E.g. progress bar id supplied cli_progress_update(), current progress bar updated. Every function can single current progress bar, new one created, previous one () automatically terminated. current progress bar also terminated function created exits. Thanks rules, often need explicitly deal progress bar ids, need explicitly call cli_progress_done():","code":"fun <- function() { cli_progress_bar(\"First step \", total = 100) for (i in 1:100) { Sys.sleep(2/100) cli_progress_update() } cli_progress_bar(\"Second step\", total = 100) for (i in 1:100) { Sys.sleep(2/100) cli_progress_update() } } fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"cli-output-while-the-progress-bar-is-active","dir":"Reference","previous_headings":"","what":"cli output while the progress bar is active","title":"cli progress bars — cli_progress_bar","text":"cli allows emitting regular cli output (alerts, headers, lists, etc.) progress bar active. terminals support , cli remove progress bar temporarily, emit output, restores progress bar. See also cli_progress_output(), sends text current progress handler. E.g. Shiny app send output Shiny progress bar, opposed cli_alert() etc. cli functions print text console.","code":"fun <- function() { cli_alert_info(\"Before the progress bar\") cli_progress_bar(\"Calculating\", total = 100) for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_alert_info(\"Already half way!\") for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_alert_info(\"All done\") } fun()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_bar.html","id":"custom-formats","dir":"Reference","previous_headings":"","what":"Custom formats","title":"cli progress bars — cli_progress_bar","text":"addition builtin types, can also specify custom format string. case progress variables probably useful avoid calculating progress bar quantities like elapsed time, ETA manually. can also use variables calling function:","code":"fun <- function(urls) { cli_progress_bar( format = paste0( \"{pb_spin} Downloading {.path {basename(url)}} \", \"[{pb_current}/{pb_total}] ETA:{pb_eta}\" ), format_done = paste0( \"{col_green(symbol$tick)} Downloaded {pb_total} files \", \"in {pb_elapsed}.\" ),, total = length(urls) ) for (url in urls) { cli_progress_update() Sys.sleep(5/10) } } fun(paste0(\"https://acme.com/data-\", 1:10, \".zip\"))"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":null,"dir":"Reference","previous_headings":"","what":"cli progress handlers — cli_progress_builtin_handlers","title":"cli progress handlers — cli_progress_builtin_handlers","text":"progress handler(s) use can selected global options.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli progress handlers — cli_progress_builtin_handlers","text":"","code":"cli_progress_builtin_handlers()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli progress handlers — cli_progress_builtin_handlers","text":"cli_progress_builtin_handlers() returns names currently supported progress handlers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"cli progress handlers — cli_progress_builtin_handlers","text":"three options specify handlers selected, time need use one . can set options character vector, names built-cli handlers want use: cli.progress_handlers_only set, handlers used, without considering others without checking able handle progress bar. option mainly intended testing purposes. handlers named cli.progress_handlers checked able handle progress bar, ones , first one selected. usually option end use want set. handlers named cli.progress_handlers_force always appended ones selected via cli.progress_handlers. option useful add additional handler, e.g. logger writes file.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"cli","dir":"Reference","previous_headings":"","what":"cli","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use cli's internal status bar, last line screen, show progress bar. handler always able handle progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"logger","dir":"Reference","previous_headings":"","what":"logger","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Log progress updates screen, one line update time stamps. handler always able handle progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"progressr","dir":"Reference","previous_headings":"","what":"progressr","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use progressr package create progress bars. handler always able handle progress bars. (progressr package needs installed.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"rstudio","dir":"Reference","previous_headings":"","what":"rstudio","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use RStudio's job panel show progress bars. handler available RStudio console, recent versions RStudio.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"say","dir":"Reference","previous_headings":"","what":"say","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use macOS say command announce progress events speech (type man say terminal info). Set cli.progress_say_frequency option set minimum delay say invocations, default three seconds. handler available macOS, say command path. external command arguments can configured options: cli_progress_say_args: command line arguments, e.g. can use select voice macOS, cli_progress_say_command: external command run, cli_progress_say_frequency: wait least many seconds calling external command.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_builtin_handlers.html","id":"shiny","dir":"Reference","previous_headings":"","what":"shiny","title":"cli progress handlers — cli_progress_builtin_handlers","text":"Use shiny's progress bars. handler available shiny app running.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":null,"dir":"Reference","previous_headings":"","what":"cli progress bar demo — cli_progress_demo","title":"cli progress bar demo — cli_progress_demo","text":"Useful experimenting format strings documentation. creates progress bar, iterates terminates saves progress updates.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli progress bar demo — cli_progress_demo","text":"","code":"cli_progress_demo( name = NULL, status = NULL, type = c(\"iterator\", \"tasks\", \"download\", \"custom\"), total = NA, .envir = parent.frame(), ..., at = if (is_interactive()) NULL else 50, show_after = 0, live = NULL, delay = 0, start = as.difftime(5, units = \"secs\") )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"cli progress bar demo — cli_progress_demo","text":"name Passed cli_progress_bar(). status Passed cli_progress_bar(). type Passed cli_progress_bar(). total Passed cli_progress_bar(). .envir Passed cli_progress_bar(). ... Passed cli_progress_bar(). number progress units show capture progress bar . NULL, sequence states generated show progress beginning end. show_after Delay show progress bar. Overrides cli.progress_show_after option. live Whether show progress bat screen, just return recorded updates. Defaults value cli.progress_demo_live options. unset, TRUE interactive sessions. delay Delay progress bar updates. start Time subtract start time, simulate progress bar takes longer run.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_demo.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli progress bar demo — cli_progress_demo","text":"List class cli_progress_demo, print format method pretty printing. lines entry contains output lines, corresponding one update.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":null,"dir":"Reference","previous_headings":"","what":"Simplified cli progress messages — cli_progress_message","title":"Simplified cli progress messages — cli_progress_message","text":"simplified progress bar, single (dynamic) message, without progress units.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simplified cli progress messages — cli_progress_message","text":"","code":"cli_progress_message( msg, current = TRUE, .auto_close = TRUE, .envir = parent.frame(), ... )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simplified cli progress messages — cli_progress_message","text":"msg Message show. may contain glue substitution cli styling. can updated via cli_progress_update(), usual. current Passed cli_progress_bar(). .auto_close Passed cli_progress_bar(). .envir Passed cli_progress_bar(). ... Passed cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simplified cli progress messages — cli_progress_message","text":"id new progress bar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_message.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simplified cli progress messages — cli_progress_message","text":"cli_progress_message() always shows message, even update due. progress message terminated, removed screen default. Note message can dynamic: update cli_progress_update(), cli uses current values string substitutions.","code":"fun <- function() { cli_progress_message(\"Task one is running...\") Sys.sleep(2) cli_progress_message(\"Task two is running...\") Sys.sleep(2) step <- 1L cli_progress_message(\"Task three is underway: step {step}\") for (step in 1:5) { Sys.sleep(0.5) cli_progress_update() } } fun()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Add text output to a progress bar — cli_progress_output","title":"Add text output to a progress bar — cli_progress_output","text":"text calculated via cli_text(), cli features can used , including progress variables.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add text output to a progress bar — cli_progress_output","text":"","code":"cli_progress_output(text, id = NULL, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add text output to a progress bar — cli_progress_output","text":"text Text output. formatted via cli_text(). id Progress bar id. default current progress bar. .envir Environment use glue interpolation text.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add text output to a progress bar — cli_progress_output","text":"TRUE, always.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_output.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add text output to a progress bar — cli_progress_output","text":"text passed progress handler(s), may may able print .","code":"fun <- function() { cli_alert_info(\"Before the progress bar\") cli_progress_bar(\"Calculating\", total = 100) for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_progress_output(\"Already half way!\") for (i in 1:50) { Sys.sleep(4/100) cli_progress_update() } cli_alert_info(\"All done\") } fun()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":null,"dir":"Reference","previous_headings":"","what":"Simplified cli progress messages, with styling — cli_progress_step","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"simplified progress bar, single (dynamic) message, without progress units.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"","code":"cli_progress_step( msg, msg_done = msg, msg_failed = msg, spinner = FALSE, class = if (!spinner) \".alert-info\", current = TRUE, .auto_close = TRUE, .envir = parent.frame(), ... )"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"msg Message show. may contain glue substitution cli styling. can updated via cli_progress_update(), usual. style cli info alert (see cli_alert_info()). msg_done Message show successful termination. default msg styled cli success alert (see cli_alert_success()). msg_failed Message show unsuccessful termination. default msg styled cli danger alert (see cli_alert_danger()). spinner Whether show spinner beginning line. make spinner spin, need call cli_progress_update() regularly. class cli class add message. default class steps spinner. current Passed cli_progress_bar(). .auto_close Passed cli_progress_bar(). .envir Passed cli_progress_bar(). ... Passed cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"cli_progress_step() always shows progress message, even update due.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"basic-use","dir":"Reference","previous_headings":"","what":"Basic use","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"","code":"f <- function() { cli_progress_step(\"Downloading data\") Sys.sleep(2) cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\") Sys.sleep(3) } f()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"spinner","dir":"Reference","previous_headings":"","what":"Spinner","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"can add spinner steps spinner = TRUE, note work call cli_progress_update() regularly.","code":"f <- function() { cli_progress_step(\"Downloading data\", spinner = TRUE) for (i in 1:100) { Sys.sleep(2/100); cli_progress_update() } cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\", spinner = TRUE) for (i in 1:100) { Sys.sleep(3/100); cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"dynamic-messages","dir":"Reference","previous_headings":"","what":"Dynamic messages","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"can make step messages dynamic, using glue templates. Since cli_progress_step() show message immediately, need initialize msg first.","code":"f <- function() { msg <- \"\" cli_progress_step(\"Downloading data{msg}\", spinner = TRUE) for (i in 1:100) { Sys.sleep(2/100) msg <- glue::glue(\", got file {i}/100\") cli_progress_update() } cli_progress_step(\"Importing data\") Sys.sleep(1) cli_progress_step(\"Cleaning data\") Sys.sleep(2) cli_progress_step(\"Fitting model\", spinner = TRUE) for (i in 1:100) { Sys.sleep(3/100); cli_progress_update() } } f()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_step.html","id":"termination-messages","dir":"Reference","previous_headings":"","what":"Termination messages","title":"Simplified cli progress messages, with styling — cli_progress_step","text":"can specify different message successful /unsuccessful termination:","code":"f <- function() { size <- 0L cli_progress_step( \"Downloading data.\", msg_done = \"Downloaded {prettyunits::pretty_bytes(size)}.\", spinner = TRUE ) for (i in 1:100) { Sys.sleep(3/100) size <- size + 8192 cli_progress_update() } } f()"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":null,"dir":"Reference","previous_headings":"","what":"List of built-in cli progress styles — cli_progress_styles","title":"List of built-in cli progress styles — cli_progress_styles","text":"following options used select style: cli_progress_bar_style cli_progress_bar_style_ascii cli_progress_bar_style_unicode","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List of built-in cli progress styles — cli_progress_styles","text":"","code":"cli_progress_styles()"},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List of built-in cli progress styles — cli_progress_styles","text":"named list sublists containing elements complete, incomplete potentially current.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_progress_styles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"List of built-in cli progress styles — cli_progress_styles","text":"Unicode terminals (is_utf8_output() TRUE), cli_progress_bar_style_unicode cli_progress_bar_style options used. ASCII terminals (is_utf8_output() FALSE), cli_pgoress_bar_style_ascii cli_progress_bar_style options used.","code":"for (style in names(cli_progress_styles())) { options(cli.progress_bar_style = style) label <- ansi_align(paste0(\"Style '\", style, \"'\"), 20) print(cli_progress_demo(label, live = FALSE, at = 66, total = 100)) } options(cli.progress_var_style = NULL) #> Style 'classic' ##################### 66% | ETA: 3s #> Style 'squares' ■■■■■■■■■■■■■■■■■■■■■ 66% | ETA: 3s #> Style 'dot' ────────────────────●────────── 66% | ETA: 3s #> Style 'fillsquares' ■■■■■■■■■■■■■■■■■■■■■□□□□□□□□□□ 66% | ETA: 3s #> Style 'bar' ███████████████████████████████ 66% | ETA: 3s"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI horizontal rule — cli_rule","title":"CLI horizontal rule — cli_rule","text":"can used separate parts output.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI horizontal rule — cli_rule","text":"","code":"cli_rule( left = \"\", center = \"\", right = \"\", id = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI horizontal rule — cli_rule","text":"left Label show left. interferes center label, one can present. center Label show center. interferes left right labels. right Label show right. interferes center label, one can present. id Element id, string. NULL, new id generated returned. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"inline-styling-and-interpolation","dir":"Reference","previous_headings":"","what":"Inline styling and interpolation","title":"CLI horizontal rule — cli_rule","text":"","code":"pkg <- \"mypackage\" cli_rule(left = \"{.pkg {pkg}} results\") #> ── mypackage results ─────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/cli_rule.html","id":"theming","dir":"Reference","previous_headings":"","what":"Theming","title":"CLI horizontal rule — cli_rule","text":"line style rule can changed via line-type property. Possible values : \"single\": (1), single line, \"double\": (2), double line, \"bar1\", \"bar2\", \"bar3\", etc., \"bar8\" uses varying height bars. Colors background colors can similarly changed via theme.","code":"d <- cli_div(theme = list(rule = list( color = \"cyan\", \"line-type\" = \"double\"))) cli_rule(\"Summary\", right = \"{.pkg mypackage}\") cli_end(d) #> ══ Summary ══════════════════════════════════════════════ mypackage ══"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":null,"dir":"Reference","previous_headings":"","what":"cli situation report — cli_sitrep","title":"cli situation report — cli_sitrep","text":"Contains currently: cli_unicode_option: whether cli.unicode option set value. See is_utf8_output(). symbol_charset: selected character set symbol, UTF-8, Windows, ASCII. console_utf8: whether console supports UTF-8. See base::l10n_info(). latex_active: whether inside knitr, creating LaTeX document. num_colors: number ANSI colors. See num_ansi_colors(). console_with: detected console width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"cli situation report — cli_sitrep","text":"","code":"cli_sitrep()"},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"cli situation report — cli_sitrep","text":"Named list entries listed . cli_sitrep class, print() format() method.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_sitrep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"cli situation report — cli_sitrep","text":"","code":"cli_sitrep() #> - cli_unicode_option : NULL #> - symbol_charset : UTF-8 #> - console_utf8 : TRUE #> - latex_active : FALSE #> - num_colors : 256 #> - console_width : 74"},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":null,"dir":"Reference","previous_headings":"","what":"Update the status bar (superseded) — cli_status","title":"Update the status bar (superseded) — cli_status","text":"cli_status_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. status bar last line terminal. cli apps can use show status information, progress bars, etc. status bar kept intact semantic cli output.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update the status bar (superseded) — cli_status","text":"","code":"cli_status( msg, msg_done = paste(msg, \"... done\"), msg_failed = paste(msg, \"... failed\"), .keep = FALSE, .auto_close = TRUE, .envir = parent.frame(), .auto_result = c(\"clear\", \"done\", \"failed\", \"auto\") )"},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update the status bar (superseded) — cli_status","text":"msg text show, character vector. collapsed single string, first line kept cut console_width(). message often associated start calculation. msg_done message use message cleared, calculation finishes successfully. .auto_close TRUE .auto_result \"done\", printed automatically calling function (.envir) finishes. msg_failed message use message cleared, calculation finishes unsuccessfully. .auto_close TRUE .auto_result \"failed\", printed automatically calling function (.envir) finishes. .keep status bar cleared. TRUE content status bar kept, regular cli output (screen scrolled needed). FALSE, status bar deleted. .auto_close Whether clear status bar calling function finishes (.envir removed stack, specified). .envir Environment evaluate glue expressions . also used auto-clear status bar .auto_close TRUE. .auto_result auto-closing status bar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update the status bar (superseded) — cli_status","text":"id new status bar container element, invisibly.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update the status bar (superseded) — cli_status","text":"Use cli_status_clear() clear status bar. Often status messages associated processes. E.g. app starts downloading large file, sets status bar accordingly. download done (failed), app typically updates status bar . cli automates much , via msg_done, msg_failed, .auto_result arguments. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_status_clear.html","id":null,"dir":"Reference","previous_headings":"","what":"Clear the status bar (superseded) — cli_status_clear","title":"Clear the status bar (superseded) — cli_status_clear","text":"cli_status_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. Clear status bar","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status_clear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clear the status bar (superseded) — cli_status_clear","text":"","code":"cli_status_clear( id = NULL, result = c(\"clear\", \"done\", \"failed\"), msg_done = NULL, msg_failed = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_status_clear.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clear the status bar (superseded) — cli_status_clear","text":"id Id status bar container clear. id id current status bar (overwritten another status bar container), status bar cleared. NULL (default) status bar always cleared. result Whether show message success failure just clear status bar. msg_done NULL, message use successful process termination. overrides message given status bar created. msg_failed NULL, message use failed process termination. overrides message give status bar created. .envir Environment evaluate glue expressions . also used auto-clear status bar .auto_close TRUE.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update the status bar (superseded) — cli_status_update","title":"Update the status bar (superseded) — cli_status_update","text":"cli_status_*() functions superseded cli_progress_message() cli_progress_step() functions, better default behavior. Update status bar","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update the status bar (superseded) — cli_status_update","text":"","code":"cli_status_update( id = NULL, msg = NULL, msg_done = NULL, msg_failed = NULL, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update the status bar (superseded) — cli_status_update","text":"id Id status bar update. Defaults current status bar container. msg Text update status bar . NULL want change . msg_done Updated \"done\" message. NULL want change . msg_failed Updated \"failed\" message. NULL want change . .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_status_update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update the status bar (superseded) — cli_status_update","text":"Id status bar container.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI text — cli_text","title":"CLI text — cli_text","text":"Write text screen. function appropriate longer paragraphs. See cli_alert() shorter status messages.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI text — cli_text","text":"","code":"cli_text(..., .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI text — cli_text","text":"... text show, character vectors. concatenated single string. Newlines preserved. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"text-wrapping","dir":"Reference","previous_headings":"","what":"Text wrapping","title":"CLI text — cli_text","text":"Text wrapped console width, see console_width().","code":"cli_text(cli:::lorem_ipsum()) #> Lorem ad ipsum veniam esse nisi deserunt duis. Qui incididunt elit #> elit mollit sint nulla consectetur aute commodo do elit laboris minim #> et. Laboris ipsum mollit voluptate et non do incididunt eiusmod. Anim #> consectetur mollit laborum occaecat eiusmod excepteur. Ullamco non #> tempor esse anim tempor magna non."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"new-lines","dir":"Reference","previous_headings":"","what":"New lines","title":"CLI text — cli_text","text":"cli_text() call always appends newline character end.","code":"cli_text(\"First line.\") cli_text(\"Second line.\") #> First line. #> Second line."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"styling","dir":"Reference","previous_headings":"","what":"Styling","title":"CLI text — cli_text","text":"can use inline markup, usual.","code":"cli_text(\"The {.fn cli_text} function in the {.pkg cli} package.\") #> The `cli_text()` function in the cli package."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"interpolation","dir":"Reference","previous_headings":"","what":"Interpolation","title":"CLI text — cli_text","text":"String interpolation via glue works usual. Interpolated vectors collapsed.","code":"pos <- c(5, 14, 25, 26) cli_text(\"We have {length(pos)} missing measurements: {pos}.\") #> We have 4 missing measurements: 5, 14, 25, and 26."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"styling-and-interpolation","dir":"Reference","previous_headings":"","what":"Styling and interpolation","title":"CLI text — cli_text","text":"Use double braces combine styling string interpolation.","code":"fun <- \"cli-text\" pkg <- \"cli\" cli_text(\"The {.fn {fun}} function in the {.pkg {pkg}} package.\") #> The `cli-text()` function in the cli package."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"multiple-arguments","dir":"Reference","previous_headings":"","what":"Multiple arguments","title":"CLI text — cli_text","text":"Arguments concatenated.","code":"cli_text(c(\"This \", \"will \", \"all \"), \"be \", \"one \", \"sentence.\") #> This will all be one sentence."},{"path":"https://cli.r-lib.org/dev/reference/cli_text.html","id":"containers","dir":"Reference","previous_headings":"","what":"Containers","title":"CLI text — cli_text","text":"can use cli_text() within cli containers.","code":"ul <- cli_ul() cli_li(\"First item.\") cli_text(\"Still the {.emph first} item\") cli_li(\"Second item.\") cli_text(\"Still the {.emph second} item\") cli_end(ul) #> • First item. #> Still the first item #> • Second item. #> Still the second item"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":null,"dir":"Reference","previous_headings":"","what":"Unordered CLI list — cli_ul","title":"Unordered CLI list — cli_ul","text":"unordered list container, see containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unordered CLI list — cli_ul","text":"","code":"cli_ul( items = NULL, id = NULL, class = NULL, .close = TRUE, .auto_close = TRUE, .envir = parent.frame() )"},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unordered CLI list — cli_ul","text":"items NULL, character vector. element vector one list item, list container closed default (see .close argument). id Id list container. Can used closing cli_end() themes. NULL, id generated returned invisibly. class Class list container. Can used themes. .close Whether close list container items specified. FALSE new items can added list. .auto_close Whether close container, calling function finishes (.envir removed, specified). .envir Environment evaluate glue expressions . also used auto-close container .auto_close TRUE.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unordered CLI list — cli_ul","text":"id new container element, invisibly.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"adding-all-items-at-once","dir":"Reference","previous_headings":"","what":"Adding all items at once","title":"Unordered CLI list — cli_ul","text":"","code":"fun <- function() { cli_ul(c(\"one\", \"two\", \"three\")) } fun() #> • one #> • two #> • three"},{"path":"https://cli.r-lib.org/dev/reference/cli_ul.html","id":"adding-items-one-by-one","dir":"Reference","previous_headings":"","what":"Adding items one by one","title":"Unordered CLI list — cli_ul","text":"","code":"fun <- function() { cli_ul() cli_li(\"{.emph one}\") cli_li(\"{.emph two}\") cli_li(\"{.emph three}\") cli_end() } fun() #> • one #> • two #> • three"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Add custom cli style to a vector — cli_vec","title":"Add custom cli style to a vector — cli_vec","text":"Add custom cli style vector","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add custom cli style to a vector — cli_vec","text":"","code":"cli_vec(x, style = list())"},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add custom cli style to a vector — cli_vec","text":"x Vector collapsed cli. style Style apply vector. used theme span element created vector. can set vec-sep vec-last modify separator last separator.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add custom cli style to a vector — cli_vec","text":"can use function change default parameters collapsing vector string, see example . style added attribute, operations remove attributes remove style well.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"custom-collapsing-separator","dir":"Reference","previous_headings":"","what":"Custom collapsing separator","title":"Add custom cli style to a vector — cli_vec","text":"","code":"v <- cli_vec( c(\"foo\", \"bar\", \"foobar\"), style = list(\"vec-sep\" = \" & \", \"vec-last\" = \" & \") ) cli_text(\"My list: {v}.\") #> My list: foo & bar & foobar."},{"path":"https://cli.r-lib.org/dev/reference/cli_vec.html","id":"custom-truncation","dir":"Reference","previous_headings":"","what":"Custom truncation","title":"Add custom cli style to a vector — cli_vec","text":"","code":"x <- cli_vec(names(mtcars), list(\"vec-trunc\" = 3)) cli_text(\"Column names: {x}.\") #> Column names: mpg, cyl, disp, …, gear, and carb."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":null,"dir":"Reference","previous_headings":"","what":"CLI verbatim text — cli_verbatim","title":"CLI verbatim text — cli_verbatim","text":"wrapped, printed . Long lines overflow. glue substitution performed verbatim text.","code":""},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CLI verbatim text — cli_verbatim","text":"","code":"cli_verbatim(..., .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CLI verbatim text — cli_verbatim","text":"... text show, character vectors. element printed new line. .envir Environment evaluate glue expressions .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"line-breaks","dir":"Reference","previous_headings":"","what":"Line breaks","title":"CLI verbatim text — cli_verbatim","text":"","code":"cli_verbatim(\"This has\\nthree\\nlines,\") #> This has #> three #> lines,"},{"path":"https://cli.r-lib.org/dev/reference/cli_verbatim.html","id":"special-characters","dir":"Reference","previous_headings":"","what":"Special characters","title":"CLI verbatim text — cli_verbatim","text":"glue substitution happens .","code":"cli_verbatim(\"No string {interpolation} or {.emph styling} here\") #> No string {interpolation} or {.emph styling} here"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":null,"dir":"Reference","previous_headings":"","what":"Syntax highlight R code — code_highlight","title":"Syntax highlight R code — code_highlight","text":"Syntax highlight R code","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Syntax highlight R code — code_highlight","text":"","code":"code_highlight(code, code_theme = NULL, envir = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Syntax highlight R code — code_highlight","text":"code Character vector, element one line code. code_theme Theme see code_theme_list(). envir Environment look function calls hyperlinks. NULL, global search path used.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Syntax highlight R code — code_highlight","text":"Character vector, highlighted code.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Syntax highlight R code — code_highlight","text":"See code_theme_list() default syntax highlighting theme change . code parse, returned unchanged cli_parse_failure condition thrown. Note error, condition ignored, unless explicitly caught.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/code_highlight.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Syntax highlight R code — code_highlight","text":"","code":"code_highlight(deparse(ls)) #> [1] \"\\033[38;5;142mfunction\\033[39m \\033[38;5;178m(\\033[39mname, pos = \\033[38;5;178m-\\033[39m\\033[38;5;169m1L\\033[39m, envir = \\033[1mas.environment\\033[22m\\033[33m(\\033[39mpos\\033[33m)\\033[39m, all.names = \\033[38;5;169mFALSE\\033[39m, \" #> [2] \" pattern, sorted = \\033[38;5;169mTRUE\\033[39m\\033[38;5;178m)\\033[39m \" #> [3] \"\\033[38;5;178m{\\033[39m\" #> [4] \" \\033[38;5;142mif\\033[39m \\033[33m(\\033[39m\\033[38;5;178m!\\033[39m\\033[1mmissing\\033[22m\\033[34m(\\033[39mname\\033[34m)\\033[39m\\033[33m)\\033[39m \\033[33m{\\033[39m\" #> [5] \" pos \\033[38;5;178m<-\\033[39m \\033[1mtryCatch\\033[22m\\033[34m(\\033[39mname, error = \\033[38;5;142mfunction\\033[39m\\033[36m(\\033[39me\\033[36m)\\033[39m e\\033[34m)\\033[39m\" #> [6] \" \\033[38;5;142mif\\033[39m \\033[34m(\\033[39m\\033[1minherits\\033[22m\\033[36m(\\033[39mpos, \\033[38;5;37m\\\"error\\\"\\033[39m\\033[36m)\\033[39m\\033[34m)\\033[39m \\033[34m{\\033[39m\" #> [7] \" name \\033[38;5;178m<-\\033[39m \\033[1msubstitute\\033[22m\\033[36m(\\033[39mname\\033[36m)\\033[39m\" #> [8] \" \\033[38;5;142mif\\033[39m \\033[36m(\\033[39m\\033[38;5;178m!\\033[39m\\033[1mis.character\\033[22m\\033[38;5;178m(\\033[39mname\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m \" #> [9] \" name \\033[38;5;178m<-\\033[39m \\033[1mdeparse\\033[22m\\033[36m(\\033[39mname\\033[36m)\\033[39m\" #> [10] \" \\033[1mwarning\\033[22m\\033[36m(\\033[39m\\033[1mgettextf\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"%s converted to character string\\\"\\033[39m, \" #> [11] \" \\033[1msQuote\\033[22m\\033[33m(\\033[39mname\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m, domain = \\033[38;5;169mNA\\033[39m\\033[36m)\\033[39m\" #> [12] \" pos \\033[38;5;178m<-\\033[39m name\" #> [13] \" \\033[34m}\\033[39m\" #> [14] \" \\033[33m}\\033[39m\" #> [15] \" all.names \\033[38;5;178m<-\\033[39m \\033[1m.Internal\\033[22m\\033[33m(\\033[39m\\033[1mls\\033[22m\\033[34m(\\033[39menvir, all.names, sorted\\033[34m)\\033[39m\\033[33m)\\033[39m\" #> [16] \" \\033[38;5;142mif\\033[39m \\033[33m(\\033[39m\\033[38;5;178m!\\033[39m\\033[1mmissing\\033[22m\\033[34m(\\033[39mpattern\\033[34m)\\033[39m\\033[33m)\\033[39m \\033[33m{\\033[39m\" #> [17] \" \\033[38;5;142mif\\033[39m \\033[34m(\\033[39m\\033[36m(\\033[39mll \\033[38;5;178m<-\\033[39m \\033[1mlength\\033[22m\\033[38;5;178m(\\033[39m\\033[1mgrep\\033[22m\\033[33m(\\033[39m\\033[38;5;37m\\\"[\\\"\\033[39m, pattern, fixed = \\033[38;5;169mTRUE\\033[39m\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m \\033[38;5;178m&&\\033[39m \" #> [18] \" ll != \\033[1mlength\\033[22m\\033[36m(\\033[39m\\033[1mgrep\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"]\\\"\\033[39m, pattern, fixed = \\033[38;5;169mTRUE\\033[39m\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m\\033[34m)\\033[39m \\033[34m{\\033[39m\" #> [19] \" \\033[38;5;142mif\\033[39m \\033[36m(\\033[39mpattern \\033[38;5;178m==\\033[39m \\033[38;5;37m\\\"[\\\"\\033[39m\\033[36m)\\033[39m \\033[36m{\\033[39m\" #> [20] \" pattern \\033[38;5;178m<-\\033[39m \\033[38;5;37m\\\"\\\\\\\\[\\\"\\033[39m\" #> [21] \" \\033[1mwarning\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"replaced regular expression pattern '[' by '\\\\\\\\\\\\\\\\['\\\"\\033[39m\\033[38;5;178m)\\033[39m\" #> [22] \" \\033[36m}\\033[39m\" #> [23] \" \\033[38;5;142melse\\033[39m \\033[38;5;142mif\\033[39m \\033[36m(\\033[39m\\033[1mlength\\033[22m\\033[38;5;178m(\\033[39m\\033[1mgrep\\033[22m\\033[33m(\\033[39m\\033[38;5;37m\\\"[^\\\\\\\\\\\\\\\\]\\\\\\\\[<-\\\"\\033[39m, pattern\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m\\033[36m)\\033[39m \\033[36m{\\033[39m\" #> [24] \" pattern \\033[38;5;178m<-\\033[39m \\033[1msub\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"\\\\\\\\[<-\\\"\\033[39m, \\033[38;5;37m\\\"\\\\\\\\\\\\\\\\\\\\\\\\[<-\\\"\\033[39m, pattern\\033[38;5;178m)\\033[39m\" #> [25] \" \\033[1mwarning\\033[22m\\033[38;5;178m(\\033[39m\\033[38;5;37m\\\"replaced '[<-' by '\\\\\\\\\\\\\\\\[<-' in regular expression pattern\\\"\\033[39m\\033[38;5;178m)\\033[39m\" #> [26] \" \\033[36m}\\033[39m\" #> [27] \" \\033[34m}\\033[39m\" #> [28] \" \\033[1mgrep\\033[22m\\033[34m(\\033[39mpattern, all.names, value = \\033[38;5;169mTRUE\\033[39m\\033[34m)\\033[39m\" #> [29] \" \\033[33m}\\033[39m\" #> [30] \" \\033[38;5;142melse\\033[39m all.names\" #> [31] \"\\033[38;5;178m}\\033[39m\" cat(code_highlight(deparse(ls)), sep = \"\\n\") #> function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE, #> pattern, sorted = TRUE) #> { #> if (!missing(name)) { #> pos <- tryCatch(name, error = function(e) e) #> if (inherits(pos, \"error\")) { #> name <- substitute(name) #> if (!is.character(name)) #> name <- deparse(name) #> warning(gettextf(\"%s converted to character string\", #> sQuote(name)), domain = NA) #> pos <- name #> } #> } #> all.names <- .Internal(ls(envir, all.names, sorted)) #> if (!missing(pattern)) { #> if ((ll <- length(grep(\"[\", pattern, fixed = TRUE))) && #> ll != length(grep(\"]\", pattern, fixed = TRUE))) { #> if (pattern == \"[\") { #> pattern <- \"\\\\[\" #> warning(\"replaced regular expression pattern '[' by '\\\\\\\\['\") #> } #> else if (length(grep(\"[^\\\\\\\\]\\\\[<-\", pattern))) { #> pattern <- sub(\"\\\\[<-\", \"\\\\\\\\\\\\[<-\", pattern) #> warning(\"replaced '[<-' by '\\\\\\\\[<-' in regular expression pattern\") #> } #> } #> grep(pattern, all.names, value = TRUE) #> } #> else all.names #> }"},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Syntax highlighting themes — code_theme_list","title":"Syntax highlighting themes — code_theme_list","text":"code_theme_list() lists built-code themes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Syntax highlighting themes — code_theme_list","text":"","code":"code_theme_list()"},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Syntax highlighting themes — code_theme_list","text":"Character vector built-code theme names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"code-themes","dir":"Reference","previous_headings":"","what":"Code themes","title":"Syntax highlighting themes — code_theme_list","text":"theme list character vectors, except bracket, see . character vector must contain RGB colors (e.g. \"#a9a9a9\"), cli styles, e.g. \"bold\". Entries list: reserved: reserved words number: numeric literals null: NULL constant operator: operators, including assignment call: function calls string: character literals comment: comments bracket: brackets: (){}[] list character vectors, create \"rainbow\" brackets. recycled deeply nested lists.","code":""},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"the-default-code-theme","dir":"Reference","previous_headings":"","what":"The default code theme","title":"Syntax highlighting themes — code_theme_list","text":"RStudio, matches current theme IDE. can use three options customize code theme: cli.code_theme set, used. Otherwise R running RStudio cli.code_theme_rstudio set, used. Otherwise T running RStudio cli.code_theme_terminal set, used. can set options name built-theme, list specifies custom theme. See code_theme_list() list built-themes.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/code_theme_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Syntax highlighting themes — code_theme_list","text":"","code":"code_theme_list() #> [1] \"Ambiance\" \"Chaos\" #> [3] \"Chrome\" \"Clouds\" #> [5] \"Clouds Midnight\" \"Cobalt\" #> [7] \"Crimson Editor\" \"Dawn\" #> [9] \"Dracula\" \"Dreamweaver\" #> [11] \"Eclipse\" \"Idle Fingers\" #> [13] \"Katzenmilch\" \"Kr Theme\" #> [15] \"Material\" \"Merbivore\" #> [17] \"Merbivore Soft\" \"Mono Industrial\" #> [19] \"Monokai\" \"Pastel On Dark\" #> [21] \"Solarized Dark\" \"Solarized Light\" #> [23] \"Textmate (default)\" \"Tomorrow\" #> [25] \"Tomorrow Night\" \"Tomorrow Night Blue\" #> [27] \"Tomorrow Night Bright\" \"Tomorrow Night 80s\" #> [29] \"Twilight\" \"Vibrant Ink\" #> [31] \"Xcode\" code_highlight(deparse(get), code_theme = \"Solarized Dark\") #> [1] \"\\033[38;5;142mfunction\\033[39m \\033[38;5;178m(\\033[39mx, pos = \\033[38;5;178m-\\033[39m\\033[38;5;169m1L\\033[39m, envir = \\033[1mas.environment\\033[22m\\033[33m(\\033[39mpos\\033[33m)\\033[39m, mode = \\033[38;5;37m\\\"any\\\"\\033[39m, \" #> [2] \" inherits = \\033[38;5;169mTRUE\\033[39m\\033[38;5;178m)\\033[39m \" #> [3] \"\\033[1m.Internal\\033[22m\\033[38;5;178m(\\033[39m\\033[1mget\\033[22m\\033[33m(\\033[39mx, envir, mode, inherits\\033[33m)\\033[39m\\033[38;5;178m)\\033[39m\""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine two or more ANSI styles — combine_ansi_styles","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"Combine two styles style functions new style function can called strings style .","code":""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"","code":"combine_ansi_styles(...)"},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"... styles combine. character strings, make_ansi_style() function used create style first. applied right left.","code":""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"combined style function.","code":""},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"usually make sense combine two foreground colors (two background colors), first one applied used. make sense combine different kind styles, e.g. background color, foreground color, bold font.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/combine_ansi_styles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine two or more ANSI styles — combine_ansi_styles","text":"","code":"## Use style names alert <- combine_ansi_styles(\"bold\", \"red4\") cat(alert(\"Warning!\"), \"\\n\") #> Warning! ## Or style functions alert <- combine_ansi_styles(style_bold, col_red, bg_cyan) cat(alert(\"Warning!\"), \"\\n\") #> Warning! ## Combine a composite style alert <- combine_ansi_styles( \"bold\", combine_ansi_styles(\"red\", bg_cyan)) cat(alert(\"Warning!\"), \"\\n\") #> Warning!"},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine the width of the console — console_width","title":"Determine the width of the console — console_width","text":"uses cli.width option, set. Otherwise tries determine size terminal console window.","code":""},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine the width of the console — console_width","text":"","code":"console_width()"},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine the width of the console — console_width","text":"Integer scalar, console , number characters.","code":""},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine the width of the console — console_width","text":"exact rules: cli.width option set positive integer, used. cli.width option set, positive integer, error thrown. try determine size terminal console window: RStudio, RStudio terminal, try use tty_size() function query terminal size. might fail R running terminal, failures ignored. RStudio build pane, RSTUDIO_CONSOLE_WIDTH environment variable used. build pane resized, environment variable accurate , output might get garbled. using RSTUDIO_CONSOLE_WIDTH environment variable RStudio console. determine size terminal console window, use width option. width option set, return 80L.","code":""},{"path":"https://cli.r-lib.org/dev/reference/console_width.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine the width of the console — console_width","text":"","code":"console_width() #> [1] 74"},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":null,"dir":"Reference","previous_headings":"","what":"About cli containers — containers","title":"About cli containers — containers","text":"Container elements may contain elements. Currently following commands create container elements: cli_div(), cli_par(), list elements: cli_ul(), cli_ol(), cli_dl(), list items containers well: cli_li().","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":"themes","dir":"Reference","previous_headings":"","what":"Themes","title":"About cli containers — containers","text":"container can add new theme, removed container exits.","code":"d <- cli_div(theme = list(h1 = list(color = \"blue\", \"font-weight\" = \"bold\"))) cli_h1(\"Custom title\") cli_end(d) #> #> Custom title"},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":"auto-closing","dir":"Reference","previous_headings":"","what":"Auto-closing","title":"About cli containers — containers","text":"Container elements closed cli_end(). convenience, default closed automatically function created terminated (either regularly error). default behavior can changed .auto_close argument.","code":"div <- function() { cli_div(class = \"tmp\", theme = list(.tmp = list(color = \"yellow\"))) cli_text(\"This is yellow\") } div() cli_text(\"This is not yellow any more\") #> This is yellow #> This is not yellow any more"},{"path":"https://cli.r-lib.org/dev/reference/containers.html","id":"debugging","dir":"Reference","previous_headings":"","what":"Debugging","title":"About cli containers — containers","text":"can use internal cli:::cli_debug_doc() function see currently open containers.","code":"fun <- function() { cli_div(id = \"mydiv\") cli_par(class = \"myclass\") cli:::cli_debug_doc() } fun() #> #> #> #>
          +theme #> "},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":null,"dir":"Reference","previous_headings":"","what":"Show a demo of some (by default all) spinners — demo_spinners","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"spinner shown 2-3 seconds.","code":""},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"","code":"demo_spinners(which = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"Character vector, spinners demo.","code":""},{"path":"https://cli.r-lib.org/dev/reference/demo_spinners.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Show a demo of some (by default all) spinners — demo_spinners","text":"","code":"demo_spinners(\"clock\")"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare two character vectors elementwise — diff_chr","title":"Compare two character vectors elementwise — diff_chr","text":"printed output similar calling diff -u command line.","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare two character vectors elementwise — diff_chr","text":"","code":"diff_chr(old, new, max_dist = Inf)"},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare two character vectors elementwise — diff_chr","text":"old First character vector. new Second character vector. max_dist Maximum distance consider, Inf limit. LCS edit distance larger , function throws error class \"cli_diff_max_dist\". (specify Inf real limit .Machine$integer.max reach function run long time.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare two character vectors elementwise — diff_chr","text":"list cli_diff_chr object, format() print() method. can also access members: old new original inputs, lcs data frame LCS edit transform old new. lcs data frame following columns: operation: one \"match\", \"delete\" \"insert\". offset: offset old matches deletions, offset new insertions. length: length operation, .e. number matching, deleted inserted elements. old_offset: offset old operation. new_offset: offset new operation.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/diff_chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare two character vectors elementwise — diff_chr","text":"","code":"letters2 <- c(\"P\", \"R\", \"E\", letters, \"P\", \"O\", \"S\", \"T\") letters2[11:16] <- c(\"M\", \"I\", \"D\", \"D\", \"L\", \"E\") diff_chr(letters, letters2) #> @@ -1,3 +1,6 @@ #> +P #> +R #> +E #> a #> b #> c #> @@ -5,12 +8,12 @@ #> e #> f #> g #> -h #> -i #> -j #> -k #> -l #> -m #> +M #> +I #> +D #> +D #> +L #> +E #> n #> o #> p #> @@ -24,3 +27,7 @@ #> x #> y #> z #> +P #> +O #> +S #> +T"},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare two character strings, character by character — diff_str","title":"Compare two character strings, character by character — diff_str","text":"Characters defined UTF-8 graphemes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare two character strings, character by character — diff_str","text":"","code":"diff_str(old, new, max_dist = Inf)"},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare two character strings, character by character — diff_str","text":"old First string, must NA. new Second string, must NA. max_dist Maximum distance consider, Inf limit. LCS edit distance larger , function throws error class \"cli_diff_max_dist\". (specify Inf real limit .Machine$integer.max reach function run long time.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare two character strings, character by character — diff_str","text":"list cli_diff_str object also cli_diff_chr object, see diff_str details structure.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/diff_str.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare two character strings, character by character — diff_str","text":"","code":"str1 <- \"abcdefghijklmnopqrstuvwxyz\" str2 <- \"PREabcdefgMIDDLEnopqrstuvwxyzPOST\" diff_str(str1, str2) #> PREabcdefghijklmMIDDLEnopqrstuvwxyzPOST"},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":null,"dir":"Reference","previous_headings":"","what":"Frequently Asked Questions — faq","title":"Frequently Asked Questions — faq","text":"Frequently Asked Questions","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"my-platform-supports-ansi-colors-why-does-cli-not-use-them-","dir":"Reference","previous_headings":"","what":"My platform supports ANSI colors, why does cli not use them?","title":"Frequently Asked Questions — faq","text":"probably mistake ANSI support detection algorithm. Please open issue https://github.com/r-lib/cli/issues forget tell us details platform terminal GUI.","code":""},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"how-do-i-turn-off-ansi-colors-and-styles-","dir":"Reference","previous_headings":"","what":"How do I turn off ANSI colors and styles?","title":"Frequently Asked Questions — faq","text":"Set NO_COLOR environment variable non-empty value. can .Renviron file (use usethis::edit_r_environ()). want testthat tests, consider using 3rd edition testthat, turn ANSI styling automatically inside test_that().","code":""},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"cli-does-not-show-the-output-before-file-choose-","dir":"Reference","previous_headings":"","what":"cli does not show the output before file.choose()","title":"Frequently Asked Questions — faq","text":"Try calling flush.console() flush console, file.choose(). flushing work RStudio, probably RStudio bug: https://github.com/rstudio/rstudio/issues/8040 See details https://github.com/r-lib/cli/issues/151","code":""},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"why-are-heading-separators-wider-than-my-screen-in-rstudio-","dir":"Reference","previous_headings":"","what":"Why are heading separators wider than my screen in RStudio?","title":"Frequently Asked Questions — faq","text":"display width Unicode characters ambiguous Unicode standard. software treats narrow (one column screen), wide (two columns). terminal emulators (example iTerm2), can configure preferred behavior. Unfortunately box drawing characters cli uses also ambiguous width. RStudio behavior depends font. particular, Consolas, Courier Inconsolata treats wide characters, cli output look great . good, modern fonts look good include Menlo, Fira Code Source Code Pro. want change font, can also turn Unicode output, setting cli.unicode option: related issue: https://github.com/r-lib/cli/issues/320","code":"options(cli.unicode = FALSE)"},{"path":"https://cli.r-lib.org/dev/reference/faq.html","id":"is-there-a-suggested-font-to-use-with-cli-","dir":"Reference","previous_headings":"","what":"Is there a suggested font to use with cli?","title":"Frequently Asked Questions — faq","text":"modern terminals, cli output usually looks good. see wide heading separators RStudio, see previous question: heading separators wider screen RStudio?. output garbled, cli probably misdetected Unicode support terminal font. can try choosing different font. experience output looks good Menlo, Fira Code Source Code Pro. Alternatively can turn Unicode output: think fault, please also file issue https://github.com/r-lib/cli/issues","code":"options(cli.unicode = FALSE)"},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":null,"dir":"Reference","previous_headings":"","what":"Format an error, warning or diagnostic message — format_error","title":"Format an error, warning or diagnostic message — format_error","text":"can throw message stop() rlang::abort().","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format an error, warning or diagnostic message — format_error","text":"","code":"format_error(message, .envir = parent.frame()) format_warning(message, .envir = parent.frame()) format_message(message, .envir = parent.frame())"},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format an error, warning or diagnostic message — format_error","text":"message formatted via call cli_bullets(). .envir Environment evaluate glue expressions .","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_error.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format an error, warning or diagnostic message — format_error","text":"messages can use inline styling, pluralization glue substitutions.","code":"n <- \"boo\" stop(format_error(c( \"{.var n} must be a numeric vector\", \"x\" = \"You've supplied a {.cls {class(n)}} vector.\" ))) #> Error: `n` must be a numeric vector #> ✖ You've supplied a vector. len <- 26 idx <- 100 stop(format_error(c( \"Must index an existing element:\", \"i\" = \"There {?is/are} {len} element{?s}.\", \"x\" = \"You've tried to subset element {idx}.\" ))) #> Error: Must index an existing element: #> ℹ There are 26 elements. #> ✖ You've tried to subset element 100."},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":null,"dir":"Reference","previous_headings":"","what":"Format and returns a line of text — format_inline","title":"Format and returns a line of text — format_inline","text":"can use function format line cli text, without emitting screen. uses cli_text() internally.","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format and returns a line of text — format_inline","text":"","code":"format_inline( ..., .envir = parent.frame(), collapse = TRUE, keep_whitespace = TRUE )"},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format and returns a line of text — format_inline","text":"... Passed cli_text(). .envir Environment evaluate expressions . collapse Whether collapse result multiple lines, e.g. \\f characters. keep_whitespace Whether keep whitepace (spaces, newlines form feeds) input.","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format and returns a line of text — format_inline","text":"Character scalar, formatted string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Format and returns a line of text — format_inline","text":"format_inline() performs width-wrapping.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/format_inline.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format and returns a line of text — format_inline","text":"","code":"format_inline(\"A message for {.emph later}, thanks {.fn format_inline}.\") #> [1] \"A message for \\033[3mlater\\033[23m, thanks `format_inline()`.\""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":null,"dir":"Reference","previous_headings":"","what":"Character vector to put a spinner on the screen — get_spinner","title":"Character vector to put a spinner on the screen — get_spinner","text":"cli contains many different spinners, choose one according taste.","code":""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Character vector to put a spinner on the screen — get_spinner","text":"","code":"get_spinner(which = NULL)"},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Character vector to put a spinner on the screen — get_spinner","text":"name chosen spinner. NULL, default used, can customized via cli.spinner_unicode, cli.spinner_ascii cli.spinner options. (latter applies Unicode ASCII displays. options can set name built-spinner, list entry called frames, character vector frames.","code":""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Character vector to put a spinner on the screen — get_spinner","text":"list entries: name, interval: suggested update interval milliseconds frames: character vector spinner's frames.","code":""},{"path":"https://cli.r-lib.org/dev/reference/get_spinner.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Character vector to put a spinner on the screen — get_spinner","text":"","code":"options(cli.spinner = \"hearts\") fun <- function() { cli_progress_bar(\"Spinning\") for (i in 1:100) { Sys.sleep(4/100) cli_progress_update() } } fun() options(cli.spinner = NULL)"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"Check current platform/terminal supports reading single keys.","code":""},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"","code":"has_keypress_support()"},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"Whether support waiting individual keypressses.","code":""},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"Supported platforms: Terminals Windows Unix. RStudio terminal. supported: RStudio (RStudio terminal). R.app macOS. Rgui Windows. Emacs ESS. Others.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/has_keypress_support.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if the current platform/terminal supports reading single keys. — has_keypress_support","text":"","code":"has_keypress_support() #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":null,"dir":"Reference","previous_headings":"","what":"Adjective-animal hash — hash_animal","title":"Adjective-animal hash — hash_animal","text":"Adjective-animal hash","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adjective-animal hash — hash_animal","text":"","code":"hash_animal(x, n_adj = 2) hash_raw_animal(x, n_adj = 2) hash_obj_animal(x, n_adj = 2, serialize_version = 2)"},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adjective-animal hash — hash_animal","text":"x Character vector. NA entries NA hash. n_adj Number adjectives use. must 0 3. serialize_version Workspace format version use, see base::serialize().","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adjective-animal hash — hash_animal","text":"data frame columns hash: hash value, string. words: list column adjectives animal name character vector. hash_raw_animal() hash_obj_animal() return list entries: hash: hash value, string, `words: adjectives animal name character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Adjective-animal hash — hash_animal","text":"uses first 13 hexadecimal characters (32) MD5 hash input, converts adjective-animal form create human readable hash. hash_raw_animal() calculates adjective-animal hash bytes raw vector. hash_obj_animal() calculates adjective-animal hash R object. object serialized binary vector first.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"number-of-possible-hash-values","dir":"Reference","previous_headings":"","what":"Number of possible hash values","title":"Adjective-animal hash — hash_animal","text":"hash_animal() uses 1748 animal names 8946 different adjectives. number different hashes can get different values n_adj:","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Adjective-animal hash — hash_animal","text":"list adjectives animals comes ids package, turn https://github.com/-type/adjective-adjective-animal, https://gfycat.com (now gone).","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_animal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Adjective-animal hash — hash_animal","text":"","code":"hash_animal(c(\"foo\", \"bar\")) #> hash words #> 1 sacrilegious diet lion sacrileg.... #> 2 uncitizenly agricultural amethystgemclam uncitize.... # if you increase `n_adj`, the shorter hash is a suffix of the longer: hash_animal(\"cli package\", 0)$hash #> [1] \"pullet\" hash_animal(\"cli package\", 1)$hash #> [1] \"pastyfaced pullet\" hash_animal(\"cli package\", 2)$hash #> [1] \"pregnant pastyfaced pullet\" hash_animal(\"cli package\", 3)$hash #> [1] \"unwelcome pregnant pastyfaced pullet\""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":null,"dir":"Reference","previous_headings":"","what":"Emoji hash — hash_emoji","title":"Emoji hash — hash_emoji","text":"Emoji hash","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Emoji hash — hash_emoji","text":"","code":"hash_emoji(x, size = 3) hash_raw_emoji(x, size = 3) hash_obj_emoji(x, size = 3, serialize_version = 2)"},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Emoji hash — hash_emoji","text":"x Character vector. NA entries NA hash. size Number emojis use hash. Currently 1 4. serialize_version Workspace format version use, see base::serialize().","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Emoji hash — hash_emoji","text":"hash_emoji() returns data frame columns hash: emoji hash, string requested size. emojis: list column emoji characters character vectors. Note emoji might multiple code points. text: text representation hash, comma separated. names: list column text representations emojis, character vectors. hash_raw_emoji() hash_obj_emoji() return list entries: hash: emoji hash, string requested size, emojis: individual emoji characters character vector, text: text representation hash, comma separated, names: names emojis, character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Emoji hash — hash_emoji","text":"uses first 13 hexadecimal characters (32) MD5 hash input, converts emoji representation. uses manually selected subset emojis, tend displayed correctly. hash_raw_emoji() calculates emoji hash bytes raw vector. hash_obj_emoji() calculates emoji hash R object. object serialized binary vector first.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"number-of-possible-hash-values","dir":"Reference","previous_headings":"","what":"Number of possible hash values","title":"Emoji hash — hash_emoji","text":"cli uses 2280 possible emojis. number different hashes can get different values size:","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_emoji.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Emoji hash — hash_emoji","text":"","code":"hash_emoji(c(\"foo\", NA, \"bar\", \"\"))$text #> [1] \"sun behind cloud, raised back of hand: dark skin tone, children crossing\" #> [2] NA #> [3] \"man pilot: medium-light skin tone, flag: Afghanistan, keycap: *\" #> [4] \"teacup without handle, rhinoceros, flushed face\" # if you increase `size`, the shorter hash is a prefix of the longer: hash_emoji(\"foobar\", 1)$text #> [1] \"fishing pole\" hash_emoji(\"foobar\", 2)$text #> [1] \"fishing pole, money with wings\" hash_emoji(\"foobar\", 3)$text #> [1] \"fishing pole, money with wings, eagle\" hash_emoji(\"foobar\", 4)$text #> [1] \"fishing pole, money with wings, eagle, dog face\""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":null,"dir":"Reference","previous_headings":"","what":"MD5 hash — hash_md5","title":"MD5 hash — hash_md5","text":"Calculate MD5 hash element character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MD5 hash — hash_md5","text":"","code":"hash_md5(x) hash_raw_md5(x) hash_obj_md5(x, serialize_version = 2) hash_file_md5(paths)"},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MD5 hash — hash_md5","text":"x Character vector. character vector, .character() used try coerce one. NA entries NA hash. serialize_version Workspace format version use, see base::serialize(). paths Character vector file names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MD5 hash — hash_md5","text":"hash_md5() returns character vector hexadecimal MD5 hashes. hash_raw_md5() returns character scalar. hash_obj_md5() returns character scalar.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"MD5 hash — hash_md5","text":"hash_raw_md5() calculates MD5 hash bytes raw vector. hash_obj_md5() calculates MD5 hash R object. object serialized binary vector first. hash_file_md5() calculates MD5 hash one files.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_md5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MD5 hash — hash_md5","text":"","code":"hash_md5(c(\"foo\", NA, \"bar\", \"\")) #> [1] \"acbd18db4cc2f85cedef654fccc4a4d8\" NA #> [3] \"37b51d194a7513e45b56f6524f2d51f2\" \"d41d8cd98f00b204e9800998ecf8427e\""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":null,"dir":"Reference","previous_headings":"","what":"SHA-1 hash — hash_sha1","title":"SHA-1 hash — hash_sha1","text":"Calculate SHA-1 hash element character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"SHA-1 hash — hash_sha1","text":"","code":"hash_sha1(x) hash_raw_sha1(x) hash_obj_sha1(x, serialize_version = 2) hash_file_sha1(paths)"},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"SHA-1 hash — hash_sha1","text":"x Character vector. character vector, .character() used try coerce one. NA entries NA hash. serialize_version Workspace format version use, see base::serialize(). paths Character vector file names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"SHA-1 hash — hash_sha1","text":"hash_sha1() returns character vector hexadecimal SHA-1 hashes. hash_raw_sha1() returns character scalar. hash_obj_sha1() returns character scalar. hash_file_sha1() returns character vector SHA-1 hashes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"SHA-1 hash — hash_sha1","text":"hash_raw_sha1() calculates SHA-1 hash bytes raw vector. hash_obj_sha1() calculates SHA-1 hash R object. object serialized binary vector first. hash_file_sha1() calculates SHA-1 hash one files.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_sha1.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"SHA-1 hash — hash_sha1","text":"","code":"hash_sha1(c(\"foo\", NA, \"bar\", \"\")) #> [1] \"0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33\" #> [2] NA #> [3] \"62cdb7020ff920e5aa642c3d4066950dd1f01f4d\" #> [4] \"da39a3ee5e6b4b0d3255bfef95601890afd80709\""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":null,"dir":"Reference","previous_headings":"","what":"SHA-256 hash — hash_sha256","title":"SHA-256 hash — hash_sha256","text":"Calculate SHA-256 hash element character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"SHA-256 hash — hash_sha256","text":"","code":"hash_sha256(x) hash_raw_sha256(x) hash_obj_sha256(x, serialize_version = 2) hash_file_sha256(paths)"},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"SHA-256 hash — hash_sha256","text":"x Character vector. character vector, .character() used try coerce one. NA entries NA hash. serialize_version Workspace format version use, see base::serialize(). paths Character vector file names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"SHA-256 hash — hash_sha256","text":"hash_sha256() returns character vector hexadecimal SHA-256 hashes. hash_raw_sha256() returns character scalar. hash_obj_sha256() returns character scalar. hash_file_sha256() returns character vector SHA-256 hashes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"SHA-256 hash — hash_sha256","text":"hash_raw_sha256() calculates SHA-256 hash bytes raw vector. hash_obj_sha256() calculates SHA-256 hash R object. object serialized binary vector first. hash_file_sha256() calculates SHA-256 hash one files.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/hash_sha256.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"SHA-256 hash — hash_sha256","text":"","code":"hash_sha256(c(\"foo\", NA, \"bar\", \"\")) #> [1] \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\" #> [2] NA #> [3] \"fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9\" #> [4] \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":null,"dir":"Reference","previous_headings":"","what":"About inline markup in the semantic cli — inline-markup","title":"About inline markup in the semantic cli — inline-markup","text":"learn use cli’s semantic markup, start ‘Building semantic CLI’ article https://cli.r-lib.org.","code":""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"command-substitution","dir":"Reference","previous_headings":"","what":"Command substitution","title":"About inline markup in the semantic cli — inline-markup","text":"text emitted cli supports glue interpolation. Expressions enclosed braces evaluated R code. See glue::glue() details. addition regular glue interpolation, cli can also add classes parts text, classes can used themes. example adds class \"important\" word, class \"emph\". Note case string within braces usually valid R expression. want mix classes interpolation, add another pair braces: inline class always create span element internally. themes, can use span.emph CSS selector change inline text emphasized:","code":"cli_text(\"This is {.emph important}.\") #> This is important. adjective <- \"great\" cli_text(\"This is {.emph {adjective}}.\") #> This is great. cli_div(theme = list(span.emph = list(color = \"red\"))) adjective <- \"nice and red\" cli_text(\"This is {.emph {adjective}}.\") #> This is nice and red."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"classes","dir":"Reference","previous_headings":"","what":"Classes","title":"About inline markup in the semantic cli — inline-markup","text":"default theme defines following inline classes: arg function argument. cls S3, S4, R6 class name. code piece code. dt used terms definition list (cli_dl()). dd used descriptions definition list (cli_dl()). email email address. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. emph emphasized text. envvar name environment variable. field generic field, e.g. named list. file file name. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link opens file RStudio default app file type. See links information cli hyperlinks. fn function name. package::function_name form, terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. fun fn. help help page function. terminal supports ANSI hyperlinks help pages (e.g. RStudio), cli creates clickable link. supports link text. See links information cli hyperlinks. href creates hyperlink, potentially link text. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. kbd keyboard key. key kbd. obj_type_friendly formats type R object readable way, used {}, see example . changes string separates last two elements collapsed vectors (see ) \"\" \"\". path path (file default theme). pkg package name. run R expression, potentially clickable terminal supports ANSI hyperlinks runnable code (e.g. RStudio). supports link text. See links information cli hyperlinks. str double quoted string escaped base::encodeString(). strong strong importance. topic help page topic. terminal supports ANSI hyperlinks help pages (e.g. RStudio), cli creates clickable link. supports link text. See links information cli hyperlinks. type formats type R object readable way, used {}, see example . url URL. terminal supports ANSI hyperlinks (e.g. RStudio, iTerm2, etc.), cli creates clickable link. See links information cli hyperlinks. var variable name. val generic \"value\". vignette vignette. terminal supports ANSI hyperlinks help pages (e.g. RStudio), cli creates clickable link. supports link text. See links information cli hyperlinks. can add new classes defining theme, using .","code":"ul <- cli_ul() cli_li(\"{.emph Emphasized} text.\") cli_li(\"{.strong Strong} importance.\") cli_li(\"A piece of code: {.code sum(a) / length(a)}.\") cli_li(\"A package name: {.pkg cli}.\") cli_li(\"A function name: {.fn cli_text}.\") cli_li(\"A keyboard key: press {.kbd ENTER}.\") cli_li(\"A file name: {.file /usr/bin/env}.\") cli_li(\"An email address: {.email bugs.bunny@acme.com}.\") cli_li(\"A URL: {.url https://example.com}.\") cli_li(\"An environment variable: {.envvar R_LIBS}.\") cli_li(\"`mtcars` is {.obj_type_friendly {mtcars}}\") cli_end(ul) #> • Emphasized text. #> • Strong importance. #> • A piece of code: `sum(a) / length(a)`. #> • A package name: cli. #> • A function name: `cli_text()`. #> • A keyboard key: press [ENTER]. #> • A file name: /usr/bin/env. #> • An email address: bugs.bunny@acme.com. #> • A URL: . #> • An environment variable: `R_LIBS`. #> • `mtcars` is a data frame cli_div(theme = list( span.myclass = list(color = \"lightgrey\"), \"span.myclass\" = list(before = \"<<\"), \"span.myclass\" = list(after = \">>\"))) cli_text(\"This is {.myclass in angle brackets}.\") cli_end() #> This is <>."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"highlighting-weird-looking-values","dir":"Reference","previous_headings":"","what":"Highlighting weird-looking values","title":"About inline markup in the semantic cli — inline-markup","text":"Often useful highlight weird file path name, e.g. one starts ends space characters. built-theme .file, .path .email default. can highlight string inline adding .q class . current highlighting algorithm adds single quotes string start end alphanumeric character, underscore, dot forward slash. Highlights background colors leading trailing spaces terminals support ANSI colors.","code":""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"collapsing-inline-vectors","dir":"Reference","previous_headings":"","what":"Collapsing inline vectors","title":"About inline markup in the semantic cli — inline-markup","text":"cli performs inline text formatting, automatically collapses glue substitutions, formatting. handy create lists files, packages, etc. Class names collapsed differently default default cli truncates long vectors. truncation limit default twenty elements, can change vec-trunc style.","code":"pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Packages: {pkgs}.\") cli_text(\"Packages: {.pkg {pkgs}}.\") #> Packages: pkg1, pkg2, and pkg3. #> Packages: pkg1, pkg2, and pkg3. x <- Sys.time() cli_text(\"Hey, {.var x} has class {.cls {class(x)}}.\") #> Hey, `x` has class . nms <- cli_vec(names(mtcars), list(\"vec-trunc\" = 5)) cli_text(\"Column names: {nms}.\") #> Column names: mpg, cyl, disp, …, gear, and carb."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"formatting-values","dir":"Reference","previous_headings":"","what":"Formatting values","title":"About inline markup in the semantic cli — inline-markup","text":"val inline class formats values. default (c.f. built-theme), calls cli_format() generic function, current style argument. See cli_format() examples. str formatting strings, uses base::encodeString() double quotes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"escaping-and-","dir":"Reference","previous_headings":"","what":"Escaping { and }","title":"About inline markup in the semantic cli — inline-markup","text":"might happen want pass string cli_* functions, want command substitution string, might contain { } characters. simplest solution refer string template: want explicitly escape { } characters, just double : See also examples .","code":"msg <- \"Error in if (ncol(dat$y)) {: argument is of length zero\" cli_alert_warning(\"{msg}\") #> ! Error in if (ncol(dat$y)) {: argument is of length zero cli_alert_warning(\"A warning with {{ braces }}.\") #> ! A warning with { braces }."},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"pluralization","dir":"Reference","previous_headings":"","what":"Pluralization","title":"About inline markup in the semantic cli — inline-markup","text":"cli commands emit text support pluralization. examples: See pluralization details.","code":"ndirs <- 1 nfiles <- 13 pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_alert_info(\"Found {ndirs} director{?y/ies} and {nfiles} file{?s}.\") cli_text(\"Will install {length(pkgs)} package{?s}: {.pkg {pkgs}}\") #> ℹ Found 1 directory and 13 files. #> Will install 3 packages: pkg1, pkg2, and pkg3"},{"path":"https://cli.r-lib.org/dev/reference/inline-markup.html","id":"wrapping","dir":"Reference","previous_headings":"","what":"Wrapping","title":"About inline markup in the semantic cli — inline-markup","text":"cli containers wrap text width container's width, observing margins requested theme. avoid line break, can use UTF_8 non-breaking space character: \\u00a0. cli break line . force line break, insert form feed character: \\f \\u000c. cli insert line break .","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect if a stream support ANSI escape characters — is_ansi_tty","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"check following hold: stream terminal. platform Unix. R running inside R.app (macOS GUI). R running inside RStudio. R running inside Emacs. terminal \"dumb\". stream either standard output standard error stream.","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"","code":"is_ansi_tty(stream = \"auto\")"},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"stream stream inspect manipulate, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr().","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"TRUE FALSE.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/is_ansi_tty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect if a stream support ANSI escape characters — is_ansi_tty","text":"","code":"is_ansi_tty() #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"terminal, \\\\r moves cursor first position line. also supported R IDEs. \\\\r typically used achieve dynamic, less cluttered user interface, e.g. create progress bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"","code":"is_dynamic_tty(stream = \"auto\")"},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"stream stream inspect manipulate, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr().","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"output directed file, \\\\r characters typically unwanted. function detects \\\\r can used given stream . detection mechanism follows: cli.dynamic option set TRUE, TRUE returned. cli.dynamic option set anything else, FALSE returned. R_CLI_DYNAMIC environment variable empty set string \"true\", \"TRUE\" \"True\", TRUE returned. R_CLI_DYNAMIC empty set anything else, FALSE returned. stream terminal, TRUE returned. stream standard output error within RStudio, macOS R app, RKWard IDE, TRUE returned. Otherwise FALSE returned.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/is_dynamic_tty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect whether a stream supports \\\\r (Carriage return) — is_dynamic_tty","text":"","code":"is_dynamic_tty() #> [1] FALSE is_dynamic_tty(stdout()) #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/is_utf8_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Whether cli is emitting UTF-8 characters — is_utf8_output","title":"Whether cli is emitting UTF-8 characters — is_utf8_output","text":"UTF-8 cli characters can turned setting cli.unicode option TRUE. can turned setting FALSE. option set, base::l10n_info() used detect UTF-8 support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/is_utf8_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Whether cli is emitting UTF-8 characters — is_utf8_output","text":"","code":"is_utf8_output()"},{"path":"https://cli.r-lib.org/dev/reference/is_utf8_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Whether cli is emitting UTF-8 characters — is_utf8_output","text":"Flag, whether cli uses UTF-8 characters.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a single keypress at the terminal — keypress","title":"Read a single keypress at the terminal — keypress","text":"currently works Linux/Unix OSX terminals, Windows command line. see has_keypress_support.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a single keypress at the terminal — keypress","text":"","code":"keypress(block = TRUE)"},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a single keypress at the terminal — keypress","text":"block Whether wait key press, none available now.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a single keypress at the terminal — keypress","text":"key pressed, character scalar. non-blocking reads NA returned keys available.","code":""},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read a single keypress at the terminal — keypress","text":"following special keys supported: Arrow keys: '', '', 'right', 'left'. Function keys: 'f1' 'f12'. Others: 'home', 'end', 'insert', 'delete', 'pageup', 'pagedown', 'tab', 'enter', 'backspace' ('delete' OSX keyboards), 'escape'. Control one following keys: '', 'b', 'c', 'd', 'e', 'f', 'h', 'k', 'l', 'n', 'p', 't', 'u', 'w'.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/keypress.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a single keypress at the terminal — keypress","text":"","code":"if (FALSE) { x <- keypress() cat(\"You pressed key\", x, \"\\n\") }"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":null,"dir":"Reference","previous_headings":"","what":"cli hyperlinks — links","title":"cli hyperlinks — links","text":"Certain cli styles create clickable links, IDE terminal supports .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"note-hyperlinks-are-currently-experimental","dir":"Reference","previous_headings":"","what":"Note: hyperlinks are currently experimental","title":"cli hyperlinks — links","text":"details styles create hyperlinks prrobably change near future, based user feedback.","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"about-the-links-in-this-manual-page","dir":"Reference","previous_headings":"","what":"About the links in this manual page","title":"cli hyperlinks — links","text":"hyperlinks included manual demonstrative , except https: links. look like hyperlink, can click , nothing. .e. .run link run linked expression click .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"hyperlink-support","dir":"Reference","previous_headings":"","what":"Hyperlink Support","title":"cli hyperlinks — links","text":"today, latest release RStudio (version v2022.07.0+548) supports hyperlink types discussed . Certain terminals, e.g. iTerm macOS, Linux terminals based VTE (GNOME terminal) support .href, .email .file links. can use ansi_has_hyperlink_support() check terminal IDE hyperlink support general, ansi_hyperlink_types() check various types hyperlinks supported. hyperlink support detected properly IDE terminal, please open cli issue https://github.com/r-lib/cli/issues.","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":"delve various types hyperlinks, general comment link texts. link styles support custom link text: .href .help .topic .vignette .run Others, .e. .email, .file, .fun .url support custom link text. generic syntax link text Markdown hyperlinks:","code":"{.style [link text](url)}"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"vectorization","dir":"Reference","previous_headings":"","what":"Vectorization","title":"cli hyperlinks — links","text":"Note possible add link text vector URLs. E.g. create list three URLs, clickable:","code":"urls <- paste0(\"https://httpbin.org/status/\", c(200, 403, 404)) cli::cli_text(\"Some httpbin URLs: {.url {urls}}.\") #> Some httpbin URLs: , #> , and #> ."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"what-if-hyperlinks-are-not-available-","dir":"Reference","previous_headings":"","what":"What if hyperlinks are not available?","title":"cli hyperlinks — links","text":"ANSI hyperlinks available, link text styles outputs link text URL (hopefully) helpful way. See examples .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"urls","dir":"Reference","previous_headings":"","what":"URLs","title":"cli hyperlinks — links","text":"two cli styles link generic URLs. .url allow custom link text, \\href .","code":"cli_text( \"See the cli homepage at {.url https://cli.r-lib.org} for details.\" ) #> See the cli homepage at for details. cli_text( \"See the {.href [cli homepage](https://cli.r-lib.org)} for details.\" ) #> See the cli homepage for details."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"without-hyperlink-support","dir":"Reference","previous_headings":"","what":"Without hyperlink support","title":"cli hyperlinks — links","text":"links look without hyperlink support:","code":"local({ withr::local_options(cli.hyperlink = FALSE) cli_text( \"See the cli homepage at {.url https://cli.r-lib.org} for details.\" ) cli_text( \"See the {.href [cli homepage](https://cli.r-lib.org)} for details.\" ) }) #> See the cli homepage at for details. #> See the cli homepage () for details."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"url-encoding","dir":"Reference","previous_headings":"","what":"URL encoding","title":"cli hyperlinks — links","text":"Note cli encode url, might need call utils::URLencode() , especially, substituted via {}.","code":"weirdurl <- utils::URLencode(\"https://example.com/has some spaces\") cli_text(\"See more at {.url {weirdurl}}.\") #> See more at ."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"files","dir":"Reference","previous_headings":"","what":"Files","title":"cli hyperlinks — links","text":".file style now automatically creates file: hyperlink. file: hyperlinks must contain absolute path, cli tries convert relative paths, paths starting ~ aboslute path.","code":"cli_text(\"... edit your {.file ~/.Rprofile} file.}\") #> ... edit your ~/.Rprofile file.}"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text-1","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":".file use custom link text. custom link text, can use .href file: URL.","code":"prof <- path.expand(\"~/.Rprofile\") cli_text(\"... edit your {.href [R profile](file://{prof})}.\") #> ... edit your R profile."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"line-and-column-numbers","dir":"Reference","previous_headings":"","what":"Line and column numbers","title":"cli hyperlinks — links","text":"may add line number file name, separated :. Handlers typically place cursor line opening file. may also add column number, line number, separated another :.","code":"cli_text(\"... see line 5 in {.file ~/.Rprofile:5}.\") #> ... see line 5 in ~/.Rprofile:5."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"default-handler","dir":"Reference","previous_headings":"","what":"Default handler","title":"cli hyperlinks — links","text":"RStudio file: URLs open within RStudio. click file link outside RStudio, typically operating system consulted application open .","code":""},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"without-hyperlink-support-1","dir":"Reference","previous_headings":"","what":"Without hyperlink support","title":"cli hyperlinks — links","text":"One issue using .href file files look great hyperlinks available. improved future:","code":"local({ withr::local_options(cli.hyperlink = FALSE) prof <- path.expand(\"~/.Rprofile\") cli_text(\"... edit your {.href [R profile](file://{prof})}.\") }) #> ... edit your R profile ()."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"links-to-the-manual","dir":"Reference","previous_headings":"","what":"Links to the manual","title":"cli hyperlinks — links","text":".fun automatically creates links manual page function, provided function name packagename::functionname form:","code":"cli::cli_text(\"... see {.fun stats::lm} to learn more.\") #> ... see `stats::lm()` to learn more."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text-2","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":"custom link text, use .help instead .fun.","code":"cli::cli_text(\"... see {.help [{.fun lm}](stats::lm)} to learn more.\") #> ... see `lm()` to learn more."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"without-hyperlink-support-2","dir":"Reference","previous_headings":"","what":"Without hyperlink support","title":"cli hyperlinks — links","text":"message without hyperlink support looks like :","code":"local({ withr::local_options(cli.hyperlink = FALSE) cli::cli_text(\"... see {.help [{.fun lm}](stats::lm)} to learn more.\") }) #> ... see `lm()` (`?stats::lm()`) to learn more."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"topics","dir":"Reference","previous_headings":"","what":"Topics","title":"cli hyperlinks — links","text":"link help topic function, use .topic: .topic support link text.","code":"cli::cli_text(\"... the tibble options at {.topic tibble::tibble_options}.\") #> ... the tibble options at tibble::tibble_options."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"vignettes","dir":"Reference","previous_headings":"","what":"Vignettes","title":"cli hyperlinks — links","text":"link vignette, use .vignette:","code":"cli::cli_text(\"... see the {.vignette tibble::types} vignette.\") #> ... see the tibble::types vignette."},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"click-to-run-code","dir":"Reference","previous_headings":"","what":"Click to run code","title":"cli hyperlinks — links","text":"RStudio also supports special link type runs R code current R session upon clicking. can create links .run:","code":"cli::cli_text(\"Run {.run testthat::snapshot_review()} to review\") #> Run testthat::snapshot_review() to review"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"link-text-3","dir":"Reference","previous_headings":"","what":"Link text","title":"cli hyperlinks — links","text":"Sometimes want show slightly different expression link, one evaluated. E.g. evaluated expression probably needs qualify packages ::, might want show :","code":"cli::cli_text( \"Run {.run [snapshot_review()](testthat::snapshot_review())} to review\" ) #> Run snapshot_review() to review"},{"path":"https://cli.r-lib.org/dev/reference/links.html","id":"security-considerations","dir":"Reference","previous_headings":"","what":"Security considerations","title":"cli hyperlinks — links","text":"make .run hyperlinks secure, RStudio run code pkg::fun(args) form, args contains (, ) ;, calls core package (base, stats, etc.), calls package loaded, one testthat, devtools, usethis, rlang, pkgload, pkgdown explicitly allowed. RStudio run .run hyperlink, shows code user can copy paste console, consider safe run. Note depending version RStudio, behavior can change.","code":""},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":null,"dir":"Reference","previous_headings":"","what":"List all available spinners — list_spinners","title":"List all available spinners — list_spinners","text":"List available spinners","code":""},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List all available spinners — list_spinners","text":"","code":"list_spinners()"},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List all available spinners — list_spinners","text":"Character vector available spinner names.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/list_spinners.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List all available spinners — list_spinners","text":"","code":"list_spinners() #> [1] \"dots\" \"dots2\" \"dots3\" #> [4] \"dots4\" \"dots5\" \"dots6\" #> [7] \"dots7\" \"dots8\" \"dots9\" #> [10] \"dots10\" \"dots11\" \"dots12\" #> [13] \"dots13\" \"dots8Bit\" \"sand\" #> [16] \"line\" \"line2\" \"pipe\" #> [19] \"simpleDots\" \"simpleDotsScrolling\" \"star\" #> [22] \"star2\" \"flip\" \"hamburger\" #> [25] \"growVertical\" \"growHorizontal\" \"balloon\" #> [28] \"balloon2\" \"noise\" \"bounce\" #> [31] \"boxBounce\" \"boxBounce2\" \"triangle\" #> [34] \"arc\" \"circle\" \"squareCorners\" #> [37] \"circleQuarters\" \"circleHalves\" \"squish\" #> [40] \"toggle\" \"toggle2\" \"toggle3\" #> [43] \"toggle4\" \"toggle5\" \"toggle6\" #> [46] \"toggle7\" \"toggle8\" \"toggle9\" #> [49] \"toggle10\" \"toggle11\" \"toggle12\" #> [52] \"toggle13\" \"arrow\" \"arrow2\" #> [55] \"arrow3\" \"bouncingBar\" \"bouncingBall\" #> [58] \"smiley\" \"monkey\" \"hearts\" #> [61] \"clock\" \"earth\" \"material\" #> [64] \"moon\" \"runner\" \"pong\" #> [67] \"shark\" \"dqpb\" \"weather\" #> [70] \"christmas\" \"grenade\" \"point\" #> [73] \"layer\" \"betaWave\" \"fingerDance\" #> [76] \"fistBump\" \"soccerHeader\" \"mindblown\" #> [79] \"speaker\" \"orangePulse\" \"bluePulse\" #> [82] \"orangeBluePulse\" \"timeTravel\" \"aesthetic\" #> [85] \"growVeriticalDotsLR\" \"growVeriticalDotsRL\" \"growVeriticalDotsLL\" #> [88] \"growVeriticalDotsRR\" get_spinner(list_spinners()[1]) #> $name #> [1] \"dots\" #> #> $interval #> [1] 80 #> #> $frames #> [1] \"⠋\" \"⠙\" \"⠹\" \"⠸\" \"⠼\" \"⠴\" \"⠦\" \"⠧\" \"⠇\" \"⠏\" #>"},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new ANSI style — make_ansi_style","title":"Create a new ANSI style — make_ansi_style","text":"Create function can used add ANSI styles text.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new ANSI style — make_ansi_style","text":"","code":"make_ansi_style(..., bg = FALSE, grey = FALSE, colors = num_ansi_colors())"},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new ANSI style — make_ansi_style","text":"... style create. See details examples . bg Whether color applies background. grey Whether specifically create grey color. flag included, ANSI 256 finer color scale greys, usual 0:5 scale red, green blue components. used RGB color specifications (either numerically via hexadecimal string), ignored eight color ANSI terminals. colors Number colors, detected automatically default.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new ANSI style — make_ansi_style","text":"function can used color (style) strings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new ANSI style — make_ansi_style","text":"... style argument can following: cli ANSI style function class cli_ansi_style. returned , without looking arguments. R color name, see grDevices::colors(). 6- 8-digit hexadecimal color string, e.g. #ff0000 means red. Transparency (alpha channel) values ignored. one-column matrix three rows red, green blue channels, returned grDevices::col2rgb(). make_ansi_style() detects number colors use automatically (can overridden using colors argument). number colors less 256 (detected given), falls back color ANSI eight color mode closest specified (RGB R) color.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/make_ansi_style.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new ANSI style — make_ansi_style","text":"","code":"make_ansi_style(\"orange\") #> #> Example output make_ansi_style(\"#123456\") #> #> Example output make_ansi_style(\"orange\", bg = TRUE) #> #> Example output orange <- make_ansi_style(\"orange\") orange(\"foobar\") #> #> [1] foobar cat(orange(\"foobar\")) #> foobar"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a spinner — make_spinner","title":"Create a spinner — make_spinner","text":"Create spinner","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a spinner — make_spinner","text":"","code":"make_spinner( which = NULL, stream = \"auto\", template = \"{spin}\", static = c(\"dots\", \"print\", \"print_line\", \"silent\") )"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a spinner — make_spinner","text":"name chosen spinner. NULL, default used, can customized via cli.spinner_unicode, cli.spinner_ascii cli.spinner options. (latter applies Unicode ASCII displays. options can set name built-spinner, list entry called frames, character vector frames. stream stream use spinner. Typically standard error, maybe standard output stream. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr(). template template string, contain spinner. spinner substituted {spin}. See example . static terminal support dynamic displays: \"dots\": show dot $spin() call. \"print\": just print frames spinner, one another. \"print_line\": print frames spinner, line. \"silent\" print anything, just template.","code":""},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a spinner — make_spinner","text":"cli_spinner object, list functions. See methods . cli_spinner methods: $spin(): output next frame spinner. $finish(): terminate spinner. Depending terminal capabilities removes spinner screen. Spinners can reused, can start calling $spin() method . methods return spinner object , invisibly. spinner automatically throttled ideal update frequency.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"default-spinner","dir":"Reference","previous_headings":"","what":"Default spinner","title":"Create a spinner — make_spinner","text":"","code":"sp1 <- make_spinner() fun_with_spinner <- function() { lapply(1:100, function(x) { sp1$spin(); Sys.sleep(0.05) }) sp1$finish() } ansi_with_hidden_cursor(fun_with_spinner())"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"spinner-with-a-template","dir":"Reference","previous_headings":"","what":"Spinner with a template","title":"Create a spinner — make_spinner","text":"","code":"sp2 <- make_spinner(template = \"Computing {spin}\") fun_with_spinner2 <- function() { lapply(1:100, function(x) { sp2$spin(); Sys.sleep(0.05) }) sp2$finish() } ansi_with_hidden_cursor(fun_with_spinner2())"},{"path":"https://cli.r-lib.org/dev/reference/make_spinner.html","id":"custom-spinner","dir":"Reference","previous_headings":"","what":"Custom spinner","title":"Create a spinner — make_spinner","text":"","code":"sp3 <- make_spinner(\"simpleDotsScrolling\", template = \"Downloading {spin}\") fun_with_spinner3 <- function() { lapply(1:100, function(x) { sp3$spin(); Sys.sleep(0.05) }) sp3$finish() } ansi_with_hidden_cursor(fun_with_spinner3())"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/match_selector.html","id":null,"dir":"Reference","previous_headings":"","what":"Match a selector to a container stack — match_selector","title":"Match a selector to a container stack — match_selector","text":"Match selector container stack","code":""},{"path":"https://cli.r-lib.org/dev/reference/match_selector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Match a selector to a container stack — match_selector","text":"","code":"match_selector(sels, cnts)"},{"path":"https://cli.r-lib.org/dev/reference/match_selector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Match a selector to a container stack — match_selector","text":"sels list selector nodes. cnts list container nodes. last selector list must match last container, matching back. use function calculate style newly encountered containers.","code":""},{"path":"https://cli.r-lib.org/dev/reference/match_selector_node.html","id":null,"dir":"Reference","previous_headings":"","what":"Match a selector node to a container — match_selector_node","title":"Match a selector node to a container — match_selector_node","text":"Match selector node container","code":""},{"path":"https://cli.r-lib.org/dev/reference/match_selector_node.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Match a selector node to a container — match_selector_node","text":"","code":"match_selector_node(node, cnt)"},{"path":"https://cli.r-lib.org/dev/reference/match_selector_node.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Match a selector node to a container — match_selector_node","text":"node Selector node, parsed parse_selector_node(). cnt Container node, elements tag, id, class. selector node matches container, hold: id selector missing unique. tag selector missing unique. id container missing unique. tag container unique. selector specifies id, matches id container. selector specifies tag, matches tag container. selector specifies class names, container classes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect the number of ANSI colors to use — num_ansi_colors","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"Certain Unix Windows terminals, also certain R GUIs, e.g. RStudio, support styling terminal output using special control sequences (ANSI sequences). num_ansi_colors() detects current R session supports ANSI sequences, many colors supported.","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"","code":"num_ansi_colors(stream = \"auto\") detect_tty_colors()"},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"stream stream used output, R connection object. can also string, one \"auto\", \"message\", \"stdout\", \"stderr\". \"auto\" select stdout() session interactive sinks, otherwise select stderr().","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"Integer, number ANSI colors current R session supports stream.","code":""},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"detection mechanism quite involved designed work box systems. work system, please report bug. Setting options environment variables turn ANSI support error prone, inherited environments, e.g. knitr, might ANSI support. want turn ANSI colors, set NO_COLOR environment variable non-empty value. exact detection mechanism follows: cli.num_colors options set, returned. R_CLI_NUM_COLORS environment variable set non-empty value, used. crayon.enabled option set FALSE, 1L returned. (compatibility code uses crayon package.) crayon.enabled option set TRUE crayon.colors option set, value cli.default_num_colors option, unset, 8L returned. crayon.enabled option set TRUE crayon.colors option also set, latter returned. (compatibility code uses crayon package.) NO_COLOR environment variable set, 1L returned. knitr, 1L returned, turn colors .Rmd chunks. stream \"auto\" (default) active sink (either \"output\" \"message\"), return 1L. (theory need check stream actually used, easy way tell .) stream \"auto\", stderr() active sink , 1L returned. (sink active \"output\", R changes stdout() stream, check needed.) cli.default_num_colors option set, use . R running inside RGui Windows, R.app macOS, return 1L. R running inside RStudio, color support, appropriate number colors returned, usually 256L. R running Windows, inside Emacs version recent enough support ANSI colors, value cli.default_num_colors option, unset 8L returned. (Windows, Emacs isatty(stdout()) == FALSE, need check dealing terminals.) stream standard output standard error terminal, 1L returned. Otherwise use cache result terminal color detection (see ). terminal color detection algorithm: COLORTERM environment variable set truecolor 24bit, return 16 million colors. COLORTERM environment variable set anything else, return value cli.num_default_colors option, 8L unset. R running Unix, inside Emacs version recent enough support ANSI colors, value cli.default_num_colors option returned, 8L unset. Windows RStudio terminal, apparently eight colors, cli.default_num_colors option can used override . recent enough Windows 10 terminal, either true color (build 14931) 256 color (build 10586) support. can also use cli.default_num_colors option override . Windows, ConEmu cmder, ANSICON loaded, value cli.default_num_colors, 8L unset, returned. Otherwise Windows, return 1L. Otherwise Unix try run tput colors determine number colors. succeeds, return return value. TERM environment variable xterm tput returned 8L, return 256L, xterm compatible terminals tend support 256 colors (https://github.com/r-lib/crayon/issues/17) can override cli.default_num_colors option. TERM set dumb, return 1L. TERM starts screen, xterm, vt100, return 8L. TERM contains color, ansi, cygwin linux, return 8L. Otherwise return 1L.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/num_ansi_colors.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect the number of ANSI colors to use — num_ansi_colors","text":"","code":"num_ansi_colors() #> [1] 256"},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse a CSS3-like selector — parse_selector","title":"Parse a CSS3-like selector — parse_selector","text":"rather small subset CSS3 supported:","code":""},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse a CSS3-like selector — parse_selector","text":"","code":"parse_selector(x)"},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse a CSS3-like selector — parse_selector","text":"x CSS3-like selector string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/parse_selector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Parse a CSS3-like selector — parse_selector","text":"Selectors: Type selectors, e.g. input selects elements. Class selectors, e.g. .index selects element class \"index\". ID selector. #toc match element ID \"toc\". Combinators: Descendant combinator, .e. space, combinator selects nodes descendants first element. E.g. div span match elements inside
          element.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Pluralization helper functions — no","title":"Pluralization helper functions — no","text":"Pluralization helper functions","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pluralization helper functions — no","text":"","code":"no(expr) qty(expr)"},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pluralization helper functions — no","text":"expr () expression printed \"\" cli expressions, interpreted zero quantity. qty() expression sets pluralization quantity without printing anything. See examples .","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralization-helpers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pluralization helper functions — no","text":"","code":"nfile <- 0; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found no files. #> Found no files. nfile <- 1; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. #> Found 1 file. nfile <- 2; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 2 files. #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":null,"dir":"Reference","previous_headings":"","what":"About cli pluralization — pluralization","title":"About cli pluralization — pluralization","text":"cli pluralization","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"introduction","dir":"Reference","previous_headings":"","what":"Introduction","title":"About cli pluralization — pluralization","text":"cli tools create messages printed correctly singular plural forms. usually requires minimal extra work, increases quality messages greatly. document first show pluralization examples can use guidelines. Hopefully intuitive enough, can used without knowing exact cli pluralization rules. need pluralization without semantic cli functions, see pluralize() function.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"pluralization-markup","dir":"Reference","previous_headings":"","what":"Pluralization markup","title":"About cli pluralization — pluralization","text":"simplest case message contains single {} glue substitution, specifies quantity used select singular plural forms. Pluralization uses markup similar glue, uses {? } delimiters: value nfile used decide whether singular plural form file used. common case English messages.","code":"library(cli) nfile <- 0; cli_text(\"Found {nfile} file{?s}.\") #> Found 0 files. nfile <- 1; cli_text(\"Found {nfile} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {nfile} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"irregular-plurals","dir":"Reference","previous_headings":"","what":"Irregular plurals","title":"About cli pluralization — pluralization","text":"plural form difficult simple s suffix, singular plural forms can given, separated forward slash:","code":"ndir <- 1; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 1 directory. ndir <- 5; cli_text(\"Found {ndir} director{?y/ies}.\") #> Found 5 directories."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"use-no-instead-of-zero","dir":"Reference","previous_headings":"","what":"Use \"no\" instead of zero","title":"About cli pluralization — pluralization","text":"readability, better use () helper function include count message. () prints word \"\" count zero, prints numeric count otherwise:","code":"nfile <- 0; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found no files. nfile <- 1; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. nfile <- 2; cli_text(\"Found {no(nfile)} file{?s}.\") #> Found 2 files."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"use-the-length-of-character-vectors","dir":"Reference","previous_headings":"","what":"Use the length of character vectors","title":"About cli pluralization — pluralization","text":"auto-collapsing feature cli easy include list objects message. cli interprets character vector pluralization quantity, takes length vector: Note length used non-numeric vectors (.numeric(x) return FALSE). want use length numeric vector, convert character via .character(). can combine collapsed vectors \"\", like : pluralization markup contains three alternatives, like , first one used zero, second one, third one larger quantities.","code":"pkgs <- \"pkg1\" cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1 package. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove the {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. pkgs <- character() cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove no packages. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") cli_text(\"Will remove {?no/the/the} {.pkg {pkgs}} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages."},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"choosing-the-right-quantity","dir":"Reference","previous_headings":"","what":"Choosing the right quantity","title":"About cli pluralization — pluralization","text":"text contains multiple glue {} substitutions, one right pluralization markup used. example: sometimes correct one. can explicitly specify correct quantity using qty() function. sets quantity without printing anything: Note message contains single {} substitution, may appear pluralization markup. message contains multiple {} substitutions pluralization markup, error thrown. Similarly, message contains {} substitutions , pluralization markup, error thrown.","code":"nfiles <- 3; ndirs <- 1 cli_text(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}\") #> Found 3 files and 1 directory nupd <- 3; ntotal <- 10 cli_text(\"{nupd}/{ntotal} {qty(nupd)} file{?s} {?needs/need} updates\") #> 3/10 files need updates"},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"rules","dir":"Reference","previous_headings":"","what":"Rules","title":"About cli pluralization — pluralization","text":"exact rules cli pluralization. two sets rules. first set specifies quantity associated {?} pluralization markup. second set describes {?} parsed interpreted.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"quantities","dir":"Reference","previous_headings":"","what":"Quantities","title":"About cli pluralization — pluralization","text":"{} substitutions define quantities. value {} substitution numeric (.numeric(x) holds), length one define quantity. enforced {} substitution used pluralization. quantity defined value {} , rounded .integer(). value {} numeric, quantity defined length. message {?} markup {} substitution, error thrown. message exactly one {} substitution, value used pluralization quantity {?} markup message. message multiple {} substitutions, {?} markup cli uses quantity {} substitution precedes . message multiple {} substitutions pluralization markup without preceding {} substitution, error thrown.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralization.html","id":"pluralization-markup-1","dir":"Reference","previous_headings":"","what":"Pluralization markup","title":"About cli pluralization — pluralization","text":"Pluralization markup starts {? ends }. may contain { } characters, may contain {} substitutions either. Alternative words suffixes separated /. single alternative, nothing used quantity == 1 single alternative used quantity != 1. two alternatives, first one used quantity == 1, second one quantity != 1 (including `quantity == 0). three alternatives, first one used quantity == 0, second one quantity == 1, third one otherwise.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":null,"dir":"Reference","previous_headings":"","what":"String templating with pluralization — pluralize","title":"String templating with pluralization — pluralize","text":"pluralize() similar glue::glue(), two differences: supports cli's pluralization syntax, using {?} markers. collapses substituted vectors comma separated string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"String templating with pluralization — pluralize","text":"","code":"pluralize( ..., .envir = parent.frame(), .transformer = glue::identity_transformer )"},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"String templating with pluralization — pluralize","text":"..., .envir, .transformer arguments passed glue::glue().","code":""},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"String templating with pluralization — pluralize","text":"See pluralization examples . need install glue package use function.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/pluralize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"String templating with pluralization — pluralize","text":"","code":"# Regular plurals nfile <- 0; pluralize(\"Found {nfile} file{?s}.\") #> Found 0 files. nfile <- 1; pluralize(\"Found {nfile} file{?s}.\") #> Found 1 file. nfile <- 2; pluralize(\"Found {nfile} file{?s}.\") #> Found 2 files. # Irregular plurals ndir <- 1; pluralize(\"Found {ndir} director{?y/ies}.\") #> Found 1 directory. ndir <- 5; pluralize(\"Found {ndir} director{?y/ies}.\") #> Found 5 directories. # Use 'no' instead of zero nfile <- 0; pluralize(\"Found {no(nfile)} file{?s}.\") #> Found no files. nfile <- 1; pluralize(\"Found {no(nfile)} file{?s}.\") #> Found 1 file. nfile <- 2; pluralize(\"Found {no(nfile)} file{?s}.\") #> Found 2 files. # Use the length of character vectors pkgs <- \"pkg1\" pluralize(\"Will remove the {pkgs} package{?s}.\") #> Will remove the pkg1 package. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") pluralize(\"Will remove the {pkgs} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. pkgs <- character() pluralize(\"Will remove {?no/the/the} {pkgs} package{?s}.\") #> Will remove no packages. pkgs <- c(\"pkg1\", \"pkg2\", \"pkg3\") pluralize(\"Will remove {?no/the/the} {pkgs} package{?s}.\") #> Will remove the pkg1, pkg2, and pkg3 packages. # Multiple quantities nfiles <- 3; ndirs <- 1 pluralize(\"Found {nfiles} file{?s} and {ndirs} director{?y/ies}\") #> Found 3 files and 1 directory # Explicit quantities nupd <- 3; ntotal <- 10 cli_text(\"{nupd}/{ntotal} {qty(nupd)} file{?s} {?needs/need} updates\") #> 3/10 files need updates"},{"path":"https://cli.r-lib.org/dev/reference/pretty_print_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn on pretty-printing functions at the R console — pretty_print_code","title":"Turn on pretty-printing functions at the R console — pretty_print_code","text":"Defines print method functions, current session, supports syntax highlighting.","code":""},{"path":"https://cli.r-lib.org/dev/reference/pretty_print_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn on pretty-printing functions at the R console — pretty_print_code","text":"","code":"pretty_print_code()"},{"path":"https://cli.r-lib.org/dev/reference/pretty_print_code.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Turn on pretty-printing functions at the R console — pretty_print_code","text":"new print method takes priority built-one. Use base::suppressMessages() suppress alert message.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":null,"dir":"Reference","previous_headings":"","what":"The cli progress C API — progress-c","title":"The cli progress C API — progress-c","text":"cli progress C API","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-should-tick","dir":"Reference","previous_headings":"","what":"CLI_SHOULD_TICK","title":"The cli progress C API — progress-c","text":"macro evaluates (int) 1 cli progress bar update due, (int) 0 otherwise. timer initialized compilation unit yet, always 0. initialize timer, call cli_progress_init_timer() create progress bar cli_progress_bar().","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-add-","dir":"Reference","previous_headings":"","what":"cli_progress_add()","title":"The cli progress C API — progress-c","text":"Add number progress units progress bar. also trigger update update due. bar: progress bar object. inc: progress increment.","code":"void cli_progress_add(SEXP bar, double inc);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-bar-","dir":"Reference","previous_headings":"","what":"cli_progress_bar()","title":"The cli progress C API — progress-c","text":"Create new progress bar object. returned progress bar object must PROTECT()-ed. total: Total number progress units. Use NA_REAL known. config: R named list object additional parameters. May NULL (C NULL~) R_NilValue(RNULL`) defaults. config may contain following entries: name: progress bar name. status: (initial) progress bar status. type: progress bar type. total: total number progress units. show_after: show progress bar specified number seconds. overrides global show_after option. format: format string, must specified custom progress bars. format_done: format string successful termination. format_failed: format string unsuccessful termination. clear: whether remove progress bar screen termination. auto_terminate: whether terminate progress bar number current units equals number total progress units.","code":"SEXP cli_progress_bar(double total, SEXP config);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"example","dir":"Reference","previous_headings":"","what":"Example","title":"The cli progress C API — progress-c","text":"","code":"#include SEXP progress_test1() { int i; SEXP bar = PROTECT(cli_progress_bar(1000, NULL)); for (i = 0; i < 1000; i++) { cli_progress_sleep(0, 4 * 1000 * 1000); if (CLI_SHOULD_TICK) cli_progress_set(bar, i); } cli_progress_done(bar); UNPROTECT(1); return Rf_ScalarInteger(i); }"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-done-","dir":"Reference","previous_headings":"","what":"cli_progress_done()","title":"The cli progress C API — progress-c","text":"Terminate progress bar. bar: progress bar object.","code":"void cli_progress_done(SEXP bar);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-init-timer-","dir":"Reference","previous_headings":"","what":"cli_progress_init_timer()","title":"The cli progress C API — progress-c","text":"Initialize cli timer without creating progress bar.","code":"void cli_progress_init_timer();"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-num-","dir":"Reference","previous_headings":"","what":"cli_progress_num()","title":"The cli progress C API — progress-c","text":"Returns number currently active progress bars.","code":"int cli_progress_num();"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-","dir":"Reference","previous_headings":"","what":"cli_progress_set()","title":"The cli progress C API — progress-c","text":"Set progress bar specified number progress units. bar: progress bar object. set: number current progress progress units.","code":"void cli_progress_set(SEXP bar, double set);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-clear-","dir":"Reference","previous_headings":"","what":"cli_progress_set_clear()","title":"The cli progress C API — progress-c","text":"Set whether remove progress bar screen. can call time cli_progress_done() called. bar: progress bar object. clear: whether remove progress bar screen, zero one.","code":"void cli_progress_set_clear(SEXP bar, int clear);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-format-","dir":"Reference","previous_headings":"","what":"cli_progress_set_format()","title":"The cli progress C API — progress-c","text":"Set custom format string progress bar. call try update progress bar. want request update, call cli_progress_add(), cli_progress_set() cli_progress_update(). bar: progress bar object. format: format string. ...: values substitute format. format ... passed vsnprintf() create format string. Format strings may contain glue substitutions, referring progress variables, pluralization, cli styling.","code":"void cli_progress_set_format(SEXP bar, const char *format, ...);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-name-","dir":"Reference","previous_headings":"","what":"cli_progress_set_name()","title":"The cli progress C API — progress-c","text":"Set name progress bar. bar; progress bar object. name: progress bar name.","code":"void cli_progress_set_name(SEXP bar, const char *name);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-status-","dir":"Reference","previous_headings":"","what":"cli_progress_set_status()","title":"The cli progress C API — progress-c","text":"Set status progress bar. bar: progress bar object. status : progress bar status.","code":"void cli_progress_set_status(SEXP bar, const char *status);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-set-type-","dir":"Reference","previous_headings":"","what":"cli_progress_set_type()","title":"The cli progress C API — progress-c","text":"Set progress bar type. Call function right creating progress bar cli_progress_bar(). Otherwise behavior undefined. bar: progress bar object. type: progress bar type. Possible progress bar types: iterator, tasks, download custom.","code":"void cli_progress_set_type(SEXP bar, const char *type);"},{"path":"https://cli.r-lib.org/dev/reference/progress-c.html","id":"cli-progress-update-","dir":"Reference","previous_headings":"","what":"cli_progress_update()","title":"The cli progress C API — progress-c","text":"Update progress bar. Unlike simpler cli_progress_add() cli_progress_set() function, can force update force set 1. bar: progress bar object. set: number current progress units. ignored negative. inc: increment add current number progress units. ignored set negative. force: whether force update, even update due. force update without changing current number progress units, supply set = -1, inc = 0 force = 1.","code":"void cli_progress_update(SEXP bar, double set, double inc, int force);"},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":null,"dir":"Reference","previous_headings":"","what":"Progress bar utility functions. — cli_progress_num","title":"Progress bar utility functions. — cli_progress_num","text":"Progress bar utility functions.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Progress bar utility functions. — cli_progress_num","text":"","code":"cli_progress_num() cli_progress_cleanup()"},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Progress bar utility functions. — cli_progress_num","text":"cli_progress_num() returns integer scalar. `cli_progress_cleanup() return anything.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-utils.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Progress bar utility functions. — cli_progress_num","text":"cli_progress_num() returns number currently active progress bars. (currently include progress bars created C/C++ code.) cli_progress_cleanup() terminates active progress bars. (currently ignores progress bars created C/C++ code.)","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Progress bar variables — progress-variables","title":"Progress bar variables — progress-variables","text":"Progress bar variables","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Progress bar variables — progress-variables","text":"variables can used cli progress bar format strings. calculated demand. use variable, e.g. pb_bar package, either need import pb_bar cli, use qualified form format string: cli::pb_bar. Similarly, R scripts, can use pb_bar library(cli), cli::pb_bar attach cli package.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-bar","dir":"Reference","previous_headings":"","what":"pb_bar","title":"Progress bar variables — progress-variables","text":"Creates visual progress bar. number total units unknown, return empty string.","code":"cli_progress_bar( total = 100, format = \"Fitting model {cli::pb_bar} {cli::pb_percent}\" ) #> Fitting model ███████████████████████████████ 66%"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-current","dir":"Reference","previous_headings":"","what":"pb_current","title":"Progress bar variables — progress-variables","text":"number current progress units.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_spin} Reading file {cli::pb_current}/{cli::pb_total}\" ) #> ⠙ Reading file 66/100"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-current-bytes","dir":"Reference","previous_headings":"","what":"pb_current_bytes","title":"Progress bar variables — progress-variables","text":"number current progress units formatted bytes. output constant width six characters.","code":"cli_progress_bar( format = \"Got {cli::pb_current_bytes} in {cli::pb_elapsed}\" ) #> Got 524 kB in 5s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-elapsed","dir":"Reference","previous_headings":"","what":"pb_elapsed","title":"Progress bar variables — progress-variables","text":"elapsed time since start progress bar. time measured since progress bar created cli_progress_bar() similar.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} [{cli::pb_elapsed}]\" ) #> ███████████████████████████████ 66% [5s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-elapsed-clock","dir":"Reference","previous_headings":"","what":"pb_elapsed_clock","title":"Progress bar variables — progress-variables","text":"elapsed time, hh::mm::ss format.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} [{cli::pb_elapsed_clock}]\" ) #> ███████████████████████████████ 66% [00:00:05]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-elapsed-raw","dir":"Reference","previous_headings":"","what":"pb_elapsed_raw","title":"Progress bar variables — progress-variables","text":"number seconds since start progress bar.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} [{round(cli::pb_elapsed_raw)}s]\" ) #> ███████████████████████████████ 66% [5s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-eta","dir":"Reference","previous_headings":"","what":"pb_eta","title":"Progress bar variables — progress-variables","text":"estimated time end progress bar, human readable form.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} | ETA: {cli::pb_eta}\" ) #> ███████████████████████████████ 66% | ETA: 3s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-eta-raw","dir":"Reference","previous_headings":"","what":"pb_eta_raw","title":"Progress bar variables — progress-variables","text":"estimated time end progress bar, seconds. useful want adjust default pb_eta display.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} | ETA: {round(cli::pb_eta_raw)}s\" ) #> ███████████████████████████████ 66% | ETA: 3s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-eta-str","dir":"Reference","previous_headings":"","what":"pb_eta_str","title":"Progress bar variables — progress-variables","text":"estimated time end progress bar. includes \"ETA:\" prefix. shown time can estimated, otherwise empty string.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent} | {cli::pb_eta_str}\" ) #> ███████████████████████████████ 66% | ETA: 3s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-extra","dir":"Reference","previous_headings":"","what":"pb_extra","title":"Progress bar variables — progress-variables","text":"pb_extra can used access extra data, see extra argument cli_progress_bar() cli_progress_update().","code":"cli_progress_bar( total = 100, extra = list(user = whoami::username()), format = \"Cleaning cache for user '{cli::pb_extra$user}': {cli::pb_current_bytes}\" ) #> Cleaning cache for user 'gaborcsardi': 161 MB"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-id","dir":"Reference","previous_headings":"","what":"pb_id","title":"Progress bar variables — progress-variables","text":"id progress bar. id format cli-- process id, integer counter incremented every time cli needs new unique id. useful debugging progress bars.","code":"cli_progress_bar( format = \"Progress bar '{cli::pb_id}' is at {cli::pb_current}\" ) #> Progress bar 'cli-82040-1814' is at 64"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-name","dir":"Reference","previous_headings":"","what":"pb_name","title":"Progress bar variables — progress-variables","text":"name progress bar. supplied developer, default empty string. space character added non-empty names.","code":"cli_progress_bar( name = \"Loading training data\", total = 100, format = \"{cli::pb_name} {cli::pb_bar} {cli::pb_percent}\" ) #> Loading training data ███████████████████████████████ 66%"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-percent","dir":"Reference","previous_headings":"","what":"pb_percent","title":"Progress bar variables — progress-variables","text":"percentage progress bar, always formatted three characters plus percentage sign. total number units unknown, \" NA%\".","code":"cli_progress_bar( total = 100, format = \"{cli::pb_bar} {cli::pb_percent}\" ) #> ███████████████████████████████ 66%"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-pid","dir":"Reference","previous_headings":"","what":"pb_pid","title":"Progress bar variables — progress-variables","text":"integer process id progress bar. useful aggregating logging output progress results multiple processes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-rate","dir":"Reference","previous_headings":"","what":"pb_rate","title":"Progress bar variables — progress-variables","text":"progress rate, number units per second, formatted string.","code":"cli_progress_bar( total = 156, format = \"Reading input files {pb_current}/{pb_total} [{pb_rate}]\" ) #> Reading input files 68/156 [14/s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-rate-raw","dir":"Reference","previous_headings":"","what":"pb_rate_raw","title":"Progress bar variables — progress-variables","text":"raw progress rate, number units per second.","code":"cli_progress_bar( total = 156, format = \"Reading input files {pb_current}/{pb_total} [{round(pb_rate_raw)}/s]\" ) #> Reading input files 68/156 [14/s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-rate-bytes","dir":"Reference","previous_headings":"","what":"pb_rate_bytes","title":"Progress bar variables — progress-variables","text":"progress rate, formatted bytes per second, human readable form.","code":"cli_progress_bar( total = 256 * 1024 * 1014, format = paste0( \"Reading data {pb_current_bytes}/{pb_total_bytes} \", \"[{ansi_trimws(pb_rate_bytes)}]\" ) #> Reading data 70 MB/266 MB [14 MB/s]"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-spin","dir":"Reference","previous_headings":"","what":"pb_spin","title":"Progress bar variables — progress-variables","text":"spinner. default spinner selected via get_spinner() call.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_spin} Reading file {cli::pb_current}/{cli::pb_total}\" ) #> ⠙ Reading file 66/100"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-status","dir":"Reference","previous_headings":"","what":"pb_status","title":"Progress bar variables — progress-variables","text":"status string progress bar. default empty string, possible set cli_progress_bar() `cli_progress_update()].","code":"cli_progress_bar(status = \"Connecting...\") #> ⠙ Connecting... 0 done (0/s) | 1s"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-timestamp","dir":"Reference","previous_headings":"","what":"pb_timestamp","title":"Progress bar variables — progress-variables","text":"time stamp current time ISO 8601 format.","code":"cli_progress_bar( \"Loading training data files\", format = \"{pb_timestamp} {pb_current} ({pb_rate})\" #> 2022-09-07T11:27:50+00:00 125 (25/s)"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-total","dir":"Reference","previous_headings":"","what":"pb_total","title":"Progress bar variables — progress-variables","text":"total number progress units, NA number units unknown.","code":"cli_progress_bar( total = 100, format = \"{cli::pb_spin} Reading file {cli::pb_current}/{cli::pb_total}\" ) #> ⠙ Reading file 66/100"},{"path":"https://cli.r-lib.org/dev/reference/progress-variables.html","id":"pb-total-bytes","dir":"Reference","previous_headings":"","what":"pb_total_bytes","title":"Progress bar variables — progress-variables","text":"total number progress units, formatted bytes, human readable format.","code":"cli_progress_bar( total = 256 * 1024 * 1014, format = paste0( \"Reading data {pb_current_bytes}/{pb_total_bytes} \", \"[{ansi_trimws(pb_rate_bytes)}]\" ) #> Reading data 70 MB/266 MB [14 MB/s]"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a rule with one or two text labels — rule","title":"Make a rule with one or two text labels — rule","text":"rule can include either centered text label, labels left right side. color labels, use functions col_*, bg_* style_* functions, see ANSI styles, examples . color line, either functions directly, line_col option.","code":""},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a rule with one or two text labels — rule","text":"","code":"rule( left = \"\", center = \"\", right = \"\", line = 1, col = NULL, line_col = col, background_col = NULL, width = console_width() )"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a rule with one or two text labels — rule","text":"left Label show left. interferes center label, one can present. center Label show center. interferes left right labels. right Label show right. interferes center label, one can present. line character string used draw line. can also 1 2, request single line (Unicode, available), double line. strings interpreted specially, see Line styles . col Color text, default line color. Either ANSI style function (see ANSI styles), color name passed make_ansi_style(). line_col, background_col Either color name (used make_ansi_style()), style function (see ANSI styles), color line background. width Width rule. Defaults width option, see base::options().","code":""},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a rule with one or two text labels — rule","text":"Character scalar, rule.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"simple-rule","dir":"Reference","previous_headings":"","what":"Simple rule","title":"Make a rule with one or two text labels — rule","text":"","code":"rule() #> ──────────────────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"line-styles","dir":"Reference","previous_headings":"","what":"Line styles","title":"Make a rule with one or two text labels — rule","text":"strings line argument interpreted specially: \"single\": (1), single line, \"double\": (2), double line, \"bar1\", \"bar2\", \"bar3\", etc., \"bar8\" uses varying height bars.","code":""},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"double-rule","dir":"Reference","previous_headings":"","what":"Double rule","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(line = 2) #> ══════════════════════════════════════════════════════════════════════"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"bars","dir":"Reference","previous_headings":"","what":"Bars","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(line = \"bar2\") rule(line = \"bar5\") #> ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ #> ▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"custom-lines","dir":"Reference","previous_headings":"","what":"Custom lines","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = \"TITLE\", line = \"~\") #> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TITLE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rule(center = \"TITLE\", line = col_blue(\"~-\")) #> ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- TITLE ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ rule(center = bg_red(\" \", symbol$star, \"TITLE\", symbol$star, \" \"), line = \"\\u2582\", line_col = \"orange\") #> ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ ★TITLE★ ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"left-label","dir":"Reference","previous_headings":"","what":"Left label","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(left = \"Results\") #> ── Results ───────────────────────────────────────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"centered-label","dir":"Reference","previous_headings":"","what":"Centered label","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = \" * RESULTS * \") #> ──────────────────────────── * RESULTS * ───────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"colored-labels","dir":"Reference","previous_headings":"","what":"Colored labels","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = col_red(\" * RESULTS * \")) #> ──────────────────────────── * RESULTS * ───────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/rule.html","id":"colored-line","dir":"Reference","previous_headings":"","what":"Colored line","title":"Make a rule with one or two text labels — rule","text":"","code":"rule(center = col_red(\" * RESULTS * \"), line_col = \"red\") #> ──────────────────────────── * RESULTS * ───────────────────────────"},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":null,"dir":"Reference","previous_headings":"","what":"Print the helpful ruler to the screen — ruler","title":"Print the helpful ruler to the screen — ruler","text":"Print helpful ruler screen","code":""},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print the helpful ruler to the screen — ruler","text":"","code":"ruler(width = console_width())"},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print the helpful ruler to the screen — ruler","text":"width Ruler width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/ruler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print the helpful ruler to the screen — ruler","text":"","code":"ruler() #> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7---- #> 12345678901234567890123456789012345678901234567890123456789012345678901234"},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":null,"dir":"Reference","previous_headings":"","what":"A simple CLI theme — simple_theme","title":"A simple CLI theme — simple_theme","text":"use theme, can set cli.theme option. Note addition builtin theme, still effect.","code":""},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A simple CLI theme — simple_theme","text":"","code":"simple_theme(dark = getOption(\"cli.theme_dark\", \"auto\"))"},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A simple CLI theme — simple_theme","text":"dark Whether theme optimized dark background. \"auto\", cli try detect . Detection usually works recent RStudio versions, iTerm macOS, platforms.","code":""},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"A simple CLI theme — simple_theme","text":"CLI apps started use default theme. can also use temporarily, div element:","code":"options(cli.theme = cli::simple_theme()) cli_div(theme = cli::simple_theme())"},{"path":"https://cli.r-lib.org/dev/reference/simple_theme.html","id":"showcase","dir":"Reference","previous_headings":"","what":"Showcase","title":"A simple CLI theme — simple_theme","text":"","code":"show <- cli_div(theme = cli::simple_theme()) cli_h1(\"Heading 1\") cli_h2(\"Heading 2\") cli_h3(\"Heading 3\") cli_par() cli_alert_danger(\"Danger alert\") cli_alert_warning(\"Warning alert\") cli_alert_info(\"Info alert\") cli_alert_success(\"Success alert\") cli_alert(\"Alert for starting a process or computation\", class = \"alert-start\") cli_end() cli_text(\"Packages and versions: {.pkg cli} {.version 1.0.0}.\") cli_text(\"Time intervals: {.timestamp 3.4s}\") cli_text(\"{.emph Emphasis} and {.strong strong emphasis}\") cli_text(\"This is a piece of code: {.code sum(x) / length(x)}\") cli_text(\"Function names: {.fn cli::simple_theme}\") cli_text(\"Files: {.file /usr/bin/env}\") cli_text(\"URLs: {.url https://r-project.org}\") cli_h2(\"Longer code chunk\") cli_par(class = \"code R\") cli_verbatim( '# window functions are useful for grouped mutates', 'mtcars %>%', ' group_by(cyl) %>%', ' mutate(rank = min_rank(desc(mpg)))') cli_end(show) #> #> ── Heading 1 ───────────────────────────────────────────────────────── #> #> ─ Heading 2 ── #> #> Heading 3 #> ✖ Danger alert #> ! Warning alert #> ℹ Info alert #> ✔ Success alert #> → Alert for starting a process or computation #> #> Packages and versions: cli 1.0.0. #> Time intervals: [3.4s] #> Emphasis and strong emphasis #> This is a piece of code: `sum(x) / length(x)` #> Function names: `cli::simple_theme()`() #> Files: /usr/bin/env #> URLs: #> #> ─ Longer code chunk ── #> # window functions are useful for grouped mutates #> mtcars %>% #> group_by(cyl) %>% #> mutate(rank = min_rank(desc(mpg))) #>"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a sparkline bar graph with unicode block characters — spark_bar","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"Rendered using block elements. common fixed width fonts rendered wider regular characters means suitable need precise alignment. might want avoid sparklines non-UTF-8 systems, look good. can use is_utf8_output() test support .","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"","code":"spark_bar(x)"},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"x numeric vector 0 1","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_bar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a sparkline bar graph with unicode block characters — spark_bar","text":"NAs left :","code":"x <- seq(0, 1, length = 6) spark_bar(x) #> ▁▂▄▅▇█ x <- seq(0, 1, length = 6) spark_bar(sample(x)) #> ▅▁█▄▇▂ spark_bar(seq(0, 1, length = 8)) #> ▁▂▃▄▅▆▇█ spark_bar(c(0, NA, 0.5, NA, 1)) #> ▁ ▄ █"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a sparkline line graph with Braille characters. — spark_line","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"might want avoid sparklines non-UTF-8 systems, look good. can use is_utf8_output() test support .","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"","code":"spark_line(x)"},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"x numeric vector 0 1","code":""},{"path":"https://cli.r-lib.org/dev/reference/spark_line.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a sparkline line graph with Braille characters. — spark_line","text":"","code":"x <- seq(0, 1, length = 10) spark_line(x) #> ⣀⡠⠔⠊⠉"},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":null,"dir":"Reference","previous_headings":"","what":"Start, stop, query the default cli application — start_app","title":"Start, stop, query the default cli application — start_app","text":"start_app creates app, places top app stack.","code":""},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Start, stop, query the default cli application — start_app","text":"","code":"start_app( theme = getOption(\"cli.theme\"), output = c(\"auto\", \"message\", \"stdout\", \"stderr\"), .auto_close = TRUE, .envir = parent.frame() ) stop_app(app = NULL) default_app()"},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Start, stop, query the default cli application — start_app","text":"theme Theme use. output print output. .auto_close Whether stop app, calling frame destroyed. .envir environment use, instead calling frame, trigger stop app. app App stop. NULL, current default app stopped. Otherwise find supplied app app stack, remote , together apps .","code":""},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Start, stop, query the default cli application — start_app","text":"start_app returns new app, default_app returns default app. stop_app return anything.","code":""},{"path":"https://cli.r-lib.org/dev/reference/start_app.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Start, stop, query the default cli application — start_app","text":"stop_app removes top app, multiple apps app stack. default_app returns default app, one top stack.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":null,"dir":"Reference","previous_headings":"","what":"Terminal Hyperlinks — style_hyperlink","title":"Terminal Hyperlinks — style_hyperlink","text":"ansi_hyperlink() creates ANSI hyperlink.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Terminal Hyperlinks — style_hyperlink","text":"","code":"style_hyperlink(text, url, params = NULL) ansi_has_hyperlink_support() ansi_hyperlink_types()"},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Terminal Hyperlinks — style_hyperlink","text":"text Text show. text url recycled match length, via paste0() call. url URL link . params named character vector additional parameters, NULL.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Terminal Hyperlinks — style_hyperlink","text":"Styled cli_ansi_string style_hyperlink(). Logical scalar ansi_has_hyperlink_support().","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Terminal Hyperlinks — style_hyperlink","text":"function currently experimental. particular, many ansi_*() functions support properly. ansi_has_hyperlink_support() checks current stdout() supports hyperlinks. See also https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. ansi_hyperlink_types() checks current stdout() supports various types hyperlinks. returns list entries href, run, help vignettes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/style_hyperlink.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Terminal Hyperlinks — style_hyperlink","text":"","code":"cat(\"This is an\", style_hyperlink(\"R\", \"https://r-project.org\"), \"link.\\n\") #> This is an R link. ansi_has_hyperlink_support() #> [1] FALSE"},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Various handy symbols to use in a command line UI — symbol","title":"Various handy symbols to use in a command line UI — symbol","text":"Various handy symbols use command line UI","code":""},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Various handy symbols to use in a command line UI — symbol","text":"","code":"symbol list_symbols()"},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Various handy symbols to use in a command line UI — symbol","text":"named list, see names(symbol) sign names.","code":""},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Various handy symbols to use in a command line UI — symbol","text":"Windows fallback less fancy symbols. list_symbols() prints table symbols screen.","code":""},{"path":"https://cli.r-lib.org/dev/reference/symbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Various handy symbols to use in a command line UI — symbol","text":"","code":"cat(symbol$tick, \" SUCCESS\\n\", symbol$cross, \" FAILURE\\n\", sep = \"\") #> ✔ SUCCESS #> ✖ FAILURE ## All symbols cat(paste(format(names(symbol), width = 20), unlist(symbol)), sep = \"\\n\") #> tick ✔ #> cross ✖ #> star ★ #> square ▇ #> square_small ◻ #> square_small_filled ◼ #> circle ◯ #> circle_filled ◉ #> circle_dotted ◌ #> circle_double ◎ #> circle_circle ⓞ #> circle_cross ⓧ #> circle_pipe Ⓘ #> circle_question_mark ?⃝ #> bullet • #> dot ․ #> line ─ #> double_line ═ #> ellipsis … #> continue … #> pointer ❯ #> info ℹ #> warning ⚠ #> menu ☰ #> smiley ☺ #> mustache ෴ #> heart ♥ #> arrow_up ↑ #> arrow_down ↓ #> arrow_left ← #> arrow_right → #> radio_on ◉ #> radio_off ◯ #> checkbox_on ☒ #> checkbox_off ☐ #> checkbox_circle_on ⓧ #> checkbox_circle_off Ⓘ #> fancy_question_mark ❓ #> neq ≠ #> geq ≥ #> leq ≤ #> times × #> upper_block_1 ▔ #> upper_block_4 ▀ #> lower_block_1 ▁ #> lower_block_2 ▂ #> lower_block_3 ▃ #> lower_block_4 ▄ #> lower_block_5 ▅ #> lower_block_6 ▆ #> lower_block_7 ▇ #> lower_block_8 █ #> full_block █ #> sup_0 ⁰ #> sup_1 ¹ #> sup_2 ² #> sup_3 ³ #> sup_4 ⁴ #> sup_5 ⁵ #> sup_6 ⁶ #> sup_7 ⁷ #> sup_8 ⁸ #> sup_9 ⁹ #> sup_minus ⁻ #> sup_plus ⁺ #> play ▶ #> stop ■ #> record ● #> figure_dash ‒ #> en_dash – #> em_dash — #> dquote_left “ #> dquote_right ” #> squote_left ‘ #> squote_right ’"},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":null,"dir":"Reference","previous_headings":"","what":"Test cli output with testthat — test_that_cli","title":"Test cli output with testthat — test_that_cli","text":"Use function testthat test files, test cli output. requires testthat edition 3, works best snapshot tests.","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test cli output with testthat — test_that_cli","text":"","code":"test_that_cli( desc, code, configs = c(\"plain\", \"ansi\", \"unicode\", \"fancy\"), links = NULL )"},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test cli output with testthat — test_that_cli","text":"desc Test description, passed testthat::test_that(), appending name cli configuration . code Test code, modified set cli config, passed testthat::test_that() configs cli configurations test code . default NULL, includes possible configurations. can also character vector, restrict tests configurations . See available configurations . links Whether run code various hyperlinks allowed. NULL hyperlinks turned . Otherwise can character vector possible hyperlink configurations: \"\": turn hyperlinks, \"none\": turn hyperlinks.","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Test cli output with testthat — test_that_cli","text":"test_that_cli() calls testthat::test_that() multiple times, different cli configurations. makes simple test cli output without ANSI colors, without Unicode characters. Currently available configurations: plain: ANSI colors, ASCII characters . ansi: ANSI colors, ASCII characters . unicode: ANSI colors, Unicode characters. fancy; ANSI colors, Unicode characters. See examples cli's tests, e.g. https://github.com/r-lib/cli/tree/main/tests/testthat corresponding snapshots https://github.com/r-lib/cli/tree/main/tests/testthat/_snaps","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"important-note-regarding-windows","dir":"Reference","previous_headings":"","what":"Important note regarding Windows","title":"Test cli output with testthat — test_that_cli","text":"base R's limitation record Unicode characters Windows, suggest record snapshots Unix, restrict tests ASCII configurations. Unicode tests Windows automatically skipped testthat currently.","code":""},{"path":"https://cli.r-lib.org/dev/reference/test_that_cli.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Test cli output with testthat — test_that_cli","text":"","code":"# testthat cannot record or compare snapshots when you run these # examples interactively, so you might want to copy them into a test # file # Default configurations cli::test_that_cli(\"success\", { testthat::local_edition(3) testthat::expect_snapshot({ cli::cli_alert_success(\"wow\") }) }) #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> v wow #> -- Skip: success [plain] ------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> v wow #> -- Skip: success [ansi] -------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> ✔ wow #> -- Skip: success [unicode] ----------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cli_alert_success(\"wow\") #> Message #> ✔ wow #> -- Skip: success [fancy] ------------------------------------------------------- #> Reason: empty test #> #> [[1]] #> [1] FALSE #> #> [[2]] #> [1] FALSE #> #> [[3]] #> [1] FALSE #> #> [[4]] #> [1] FALSE #> #> [[5]] #> NULL #> #> [[6]] #> NULL #> #> [[7]] #> NULL #> #> [[8]] #> NULL #> #> [[9]] #> NULL #> #> [[10]] #> NULL #> #> [[11]] #> NULL #> #> [[12]] #> NULL #> # Only use two configurations, because this output does not have colors cli::test_that_cli(configs = c(\"plain\", \"unicode\"), \"cat_bullet\", { testthat::local_edition(3) testthat::expect_snapshot({ cli::cat_bullet(letters[1:5]) }) }) #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cat_bullet(letters[1:5]) #> Output #> * a #> * b #> * c #> * d #> * e #> -- Skip: cat_bullet [plain] ---------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> cli::cat_bullet(letters[1:5]) #> Output #> • a #> • b #> • c #> • d #> • e #> -- Skip: cat_bullet [unicode] -------------------------------------------------- #> Reason: empty test #> #> [[1]] #> [1] FALSE #> #> [[2]] #> NULL #> #> [[3]] #> [1] FALSE #> #> [[4]] #> NULL #> #> [[5]] #> NULL #> #> [[6]] #> NULL #> #> [[7]] #> NULL #> #> [[8]] #> NULL #> #> [[9]] #> NULL #> #> [[10]] #> NULL #> #> [[11]] #> NULL #> #> [[12]] #> NULL #> # You often need to evaluate all cli calls of a test case in the same # environment. Use `local()` to do that: cli::test_that_cli(\"theming\", { testthat::local_edition(3) testthat::expect_snapshot(local({ cli::cli_div(theme = list(\".alert\" = list(before = \"!!! \"))) cli::cli_alert(\"wow\") })) }) #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [plain] ------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> i Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [ansi] -------------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [unicode] ----------------------------------------------------- #> Reason: empty test #> #> Can't compare snapshot to reference when testing interactively. #> ℹ Run `devtools::test()` or `testthat::test_file()` to see changes. #> Current value: #> Code #> local({ #> cli::cli_div(theme = list(.alert = list(before = \"!!! \"))) #> cli::cli_alert(\"wow\") #> }) #> Message #> !!! wow #> -- Skip: theming [fancy] ------------------------------------------------------- #> Reason: empty test #> #> [[1]] #> [1] FALSE #> #> [[2]] #> [1] FALSE #> #> [[3]] #> [1] FALSE #> #> [[4]] #> [1] FALSE #> #> [[5]] #> NULL #> #> [[6]] #> NULL #> #> [[7]] #> NULL #> #> [[8]] #> NULL #> #> [[9]] #> NULL #> #> [[10]] #> NULL #> #> [[11]] #> NULL #> #> [[12]] #> NULL #>"},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":null,"dir":"Reference","previous_headings":"","what":"About cli themes — themes","title":"About cli themes — themes","text":"CLI elements can styled via CSS-like language selectors properties. small subset CSS3 supported, lot visual properties implemented terminal, ignored well.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"adding-themes","dir":"Reference","previous_headings":"","what":"Adding themes","title":"About cli themes — themes","text":"style element calculated themes four sources. form stack, themes top stack take precedence, themes bottom. cli package built-theme. always active. See builtin_theme(). app object created via start_app(), caller can specify theme, added theme stack. theme specified start_app(), content cli.theme option used. Removed corresponding app stops. user may specify theme cli.user_theme option. added stack app's theme (step 2.), can override settings. Removed app added stops. Themes specified explicitly cli_div() elements. removed theme stack, corresponding cli_div() elements closed.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"writing-themes","dir":"Reference","previous_headings":"","what":"Writing themes","title":"About cli themes — themes","text":"theme named list lists. name entry CSS selector. subset CSS supported: Type selectors, e.g. input selects elements. Class selectors, e.g. .index selects element class \"index\". ID selector. #toc match element ID \"toc\". descendant combinator, .e. space, selects nodes descendants first element. E.g. div span match elements inside
          element. content theme list entry another named list, names CSS properties, e.g. color, font-weight margin-left, list entries define values properties. See builtin_theme() simple_theme() examples.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"formatter-callbacks","dir":"Reference","previous_headings":"","what":"Formatter callbacks","title":"About cli themes — themes","text":"flexibility, themes may also define formatter functions, property name fmt. called styles applied element. called elements produce output, .e. container elements.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"supported-properties","dir":"Reference","previous_headings":"","what":"Supported properties","title":"About cli themes — themes","text":"Right now limited set properties supported. include left, right, top bottom margins, background foreground colors, bold italic fonts, underlined text. properties supported insert text content element. current list properties: : string literal insert element. can also function returns string literal. Supported inline elements, list items, alerts rules. background-color: R color name, HTML hexadecimal color. can applied elements (inline elements, rules, text, etc.), background containers colored properly currently. : string literal insert element. can also function returns string literal. Supported inline elements, list items, alerts rules. class-map: value can named list, specifies R (S3) class names mapped cli class names. E.g. list(fs_path = \"file\") specifies fs_path objects (fs package) always print .file objects cli. color: Text color, R color name HTML hexadecimal color. can applied elements printed. collapse: Specifies collapse vector, applying styling. character string, used separator. function, called, vector argument. digits: Number digits decimal point numeric inline element class .val. fmt: Generic formatter function takes input text returns formatted text. Can applied elements. colors use, input text provided fmt already includes ANSI sequences. font-style: \"italic\" text printed cursive. font-weight: \"bold\", text printed boldface. line-type: Line type cli_rule(). list-style-type: String literal functions returns string literal, used list item marker un-ordered lists. margin-bottom, margin-left, margin-right, margin-top: Margins. padding-left, padding-right: currently used way margins, might change later. start: Integer number, first element ordered list. string-quote: Quoting character inline elements class .val. text-decoration: \"underline\", underlined text created. text-exdent: Amount indentation second line wrapped text. transform: function call glue substitutions, collapsing . Note transform applied prior implementing color via ANSI sequences. vec-last: last separator collapsing vectors. vec-sep: separator use collapsing vectors. vec-sep2: separator use two elements collapsing vectors. set, vec-sep used well. vec-trunc: Vectors longer truncated. Defaults 100. vec-trunc-style: Select two ways collapsing vectors: \"-ends\" current default shows beginning end vector. \"head\" shows beginning vector. properties might added later. think property applied properly element, please open issue cli issue tracker.","code":""},{"path":"https://cli.r-lib.org/dev/reference/themes.html","id":"examples","dir":"Reference","previous_headings":"","what":"Examples","title":"About cli themes — themes","text":"Color headings, active paragraphs 'output' class: Create custom alert type:","code":"list( \"par.output h1\" = list(\"background-color\" = \"red\", color = \"#e0e0e0\"), \"par.output h2\" = list(\"background-color\" = \"orange\", color = \"#e0e0e0\"), \"par.output h3\" = list(\"background-color\" = \"blue\", color = \"#e0e0e0\") ) list( \".alert-start\" = list(before = symbol$play), \".alert-stop\" = list(before = symbol$stop) )"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw a tree — tree","title":"Draw a tree — tree","text":"Draw tree using box drawing characters. Unicode characters used available. (Set cli.unicode option auto-detection fails.)","code":""},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw a tree — tree","text":"","code":"tree( data, root = data[[1]][[1]], style = NULL, width = console_width(), trim = FALSE )"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw a tree — tree","text":"data Data frame contains tree structure. first column id, second column list column, contains ids child nodes. optional third column may contain text print annotate node. root name root node. style Optional box style list. width Maximum width output. Defaults width option, see base::options(). trim Whether avoid traversing nodes multiple times. TRUE data trimmed column, used printing repeated nodes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Draw a tree — tree","text":"Character vector, lines tree drawing.","code":""},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Draw a tree — tree","text":"node might appear multiple times tree, might appear .","code":"data <- data.frame( stringsAsFactors = FALSE, package = c(\"processx\", \"backports\", \"assertthat\", \"Matrix\", \"magrittr\", \"rprojroot\", \"clisymbols\", \"prettyunits\", \"withr\", \"desc\", \"igraph\", \"R6\", \"crayon\", \"debugme\", \"digest\", \"irlba\", \"rcmdcheck\", \"callr\", \"pkgconfig\", \"lattice\"), dependencies = I(list( c(\"assertthat\", \"crayon\", \"debugme\", \"R6\"), character(0), character(0), \"lattice\", character(0), \"backports\", character(0), c(\"magrittr\", \"assertthat\"), character(0), c(\"assertthat\", \"R6\", \"crayon\", \"rprojroot\"), c(\"irlba\", \"magrittr\", \"Matrix\", \"pkgconfig\"), character(0), character(0), \"crayon\", character(0), \"Matrix\", c(\"callr\", \"clisymbols\", \"crayon\", \"desc\", \"digest\", \"prettyunits\", \"R6\", \"rprojroot\", \"withr\"), c(\"processx\", \"R6\"), character(0), character(0) )) ) tree(data) #> processx #> ├─assertthat #> ├─crayon #> ├─debugme #> │ └─crayon #> └─R6 tree(data, root = \"rcmdcheck\") #> rcmdcheck #> ├─callr #> │ ├─processx #> │ │ ├─assertthat #> │ │ ├─crayon #> │ │ ├─debugme #> │ │ │ └─crayon #> │ │ └─R6 #> │ └─R6 #> ├─clisymbols #> ├─crayon #> ├─desc #> │ ├─assertthat #> │ ├─R6 #> │ ├─crayon #> │ └─rprojroot #> │ └─backports #> ├─digest #> ├─prettyunits #> │ ├─magrittr #> │ └─assertthat #> ├─R6 #> ├─rprojroot #> │ └─backports #> └─withr"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"colored-nodes","dir":"Reference","previous_headings":"","what":"Colored nodes","title":"Draw a tree — tree","text":"","code":"data$label <- paste(data$package, style_dim(paste0(\"(\", c(\"2.0.0.1\", \"1.1.1\", \"0.2.0\", \"1.2-11\", \"1.5\", \"1.2\", \"1.2.0\", \"1.0.2\", \"2.0.0\", \"1.1.1.9000\", \"1.1.2\", \"2.2.2\", \"1.3.4\", \"1.0.2\", \"0.6.12\", \"2.2.1\", \"1.2.1.9002\", \"1.0.0.9000\", \"2.0.1\", \"0.20-35\"), \")\")) ) roots <- ! data$package %in% unlist(data$dependencies) data$label[roots] <- col_cyan(style_italic(data$label[roots])) tree(data, root = \"rcmdcheck\") #> rcmdcheck (1.2.1.9002) #> ├─callr (1.0.0.9000) #> │ ├─processx (2.0.0.1) #> │ │ ├─assertthat (0.2.0) #> │ │ ├─crayon (1.3.4) #> │ │ ├─debugme (1.0.2) #> │ │ │ └─crayon (1.3.4) #> │ │ └─R6 (2.2.2) #> │ └─R6 (2.2.2) #> ├─clisymbols (1.2.0) #> ├─crayon (1.3.4) #> ├─desc (1.1.1.9000) #> │ ├─assertthat (0.2.0) #> │ ├─R6 (2.2.2) #> │ ├─crayon (1.3.4) #> │ └─rprojroot (1.2) #> │ └─backports (1.1.1) #> ├─digest (0.6.12) #> ├─prettyunits (1.0.2) #> │ ├─magrittr (1.5) #> │ └─assertthat (0.2.0) #> ├─R6 (2.2.2) #> ├─rprojroot (1.2) #> │ └─backports (1.1.1) #> └─withr (2.0.0)"},{"path":"https://cli.r-lib.org/dev/reference/tree.html","id":"trimming","dir":"Reference","previous_headings":"","what":"Trimming","title":"Draw a tree — tree","text":"","code":"pkgdeps <- list( \"dplyr@0.8.3\" = c(\"assertthat@0.2.1\", \"glue@1.3.1\", \"magrittr@1.5\", \"R6@2.4.0\", \"Rcpp@1.0.2\", \"rlang@0.4.0\", \"tibble@2.1.3\", \"tidyselect@0.2.5\"), \"assertthat@0.2.1\" = character(), \"glue@1.3.1\" = character(), \"magrittr@1.5\" = character(), \"pkgconfig@2.0.3\" = character(), \"R6@2.4.0\" = character(), \"Rcpp@1.0.2\" = character(), \"rlang@0.4.0\" = character(), \"tibble@2.1.3\" = c(\"cli@1.1.0\", \"crayon@1.3.4\", \"fansi@0.4.0\", \"pillar@1.4.2\", \"pkgconfig@2.0.3\", \"rlang@0.4.0\"), \"cli@1.1.0\" = c(\"assertthat@0.2.1\", \"crayon@1.3.4\"), \"crayon@1.3.4\" = character(), \"fansi@0.4.0\" = character(), \"pillar@1.4.2\" = c(\"cli@1.1.0\", \"crayon@1.3.4\", \"fansi@0.4.0\", \"rlang@0.4.0\", \"utf8@1.1.4\", \"vctrs@0.2.0\"), \"utf8@1.1.4\" = character(), \"vctrs@0.2.0\" = c(\"backports@1.1.5\", \"ellipsis@0.3.0\", \"digest@0.6.21\", \"glue@1.3.1\", \"rlang@0.4.0\", \"zeallot@0.1.0\"), \"backports@1.1.5\" = character(), \"ellipsis@0.3.0\" = c(\"rlang@0.4.0\"), \"digest@0.6.21\" = character(), \"glue@1.3.1\" = character(), \"zeallot@0.1.0\" = character(), \"tidyselect@0.2.5\" = c(\"glue@1.3.1\", \"purrr@1.3.1\", \"rlang@0.4.0\", \"Rcpp@1.0.2\"), \"purrr@0.3.3\" = c(\"magrittr@1.5\", \"rlang@0.4.0\") ) pkgs <- data.frame( stringsAsFactors = FALSE, name = names(pkgdeps), deps = I(unname(pkgdeps)) ) tree(pkgs, trim = TRUE) #> dplyr@0.8.3 #> ├─assertthat@0.2.1 #> ├─glue@1.3.1 #> ├─magrittr@1.5 #> ├─R6@2.4.0 #> ├─Rcpp@1.0.2 #> ├─rlang@0.4.0 #> ├─tibble@2.1.3 #> │ ├─cli@1.1.0 #> │ │ ├─assertthat@0.2.1 #> │ │ └─crayon@1.3.4 #> │ ├─crayon@1.3.4 #> │ ├─fansi@0.4.0 #> │ ├─pillar@1.4.2 #> │ │ ├─cli@1.1.0 #> │ │ ├─crayon@1.3.4 #> │ │ ├─fansi@0.4.0 #> │ │ ├─rlang@0.4.0 #> │ │ ├─utf8@1.1.4 #> │ │ └─vctrs@0.2.0 #> │ │ ├─backports@1.1.5 #> │ │ ├─ellipsis@0.3.0 #> │ │ │ └─rlang@0.4.0 #> │ │ ├─digest@0.6.21 #> │ │ ├─glue@1.3.1 #> │ │ ├─rlang@0.4.0 #> │ │ └─zeallot@0.1.0 #> │ ├─pkgconfig@2.0.3 #> │ └─rlang@0.4.0 #> └─tidyselect@0.2.5 #> ├─glue@1.3.1 #> ├─rlang@0.4.0 #> └─Rcpp@1.0.2 # Mark the trimmed nodes pkgs$label <- pkgs$name pkgs$trimmed <- paste(pkgs$name, \" (trimmed)\") tree(pkgs, trim = TRUE) #> dplyr@0.8.3 #> ├─assertthat@0.2.1 #> ├─glue@1.3.1 #> ├─magrittr@1.5 #> ├─R6@2.4.0 #> ├─Rcpp@1.0.2 #> ├─rlang@0.4.0 #> ├─tibble@2.1.3 #> │ ├─cli@1.1.0 #> │ │ ├─assertthat@0.2.1 (trimmed) #> │ │ └─crayon@1.3.4 #> │ ├─crayon@1.3.4 (trimmed) #> │ ├─fansi@0.4.0 #> │ ├─pillar@1.4.2 #> │ │ ├─cli@1.1.0 (trimmed) #> │ │ ├─crayon@1.3.4 (trimmed) #> │ │ ├─fansi@0.4.0 (trimmed) #> │ │ ├─rlang@0.4.0 (trimmed) #> │ │ ├─utf8@1.1.4 #> │ │ └─vctrs@0.2.0 #> │ │ ├─backports@1.1.5 #> │ │ ├─ellipsis@0.3.0 #> │ │ │ └─rlang@0.4.0 (trimmed) #> │ │ ├─digest@0.6.21 #> │ │ ├─glue@1.3.1 (trimmed) #> │ │ ├─rlang@0.4.0 (trimmed) #> │ │ └─zeallot@0.1.0 #> │ ├─pkgconfig@2.0.3 #> │ └─rlang@0.4.0 (trimmed) #> └─tidyselect@0.2.5 #> ├─glue@1.3.1 (trimmed) #> ├─rlang@0.4.0 (trimmed) #> └─Rcpp@1.0.2 (trimmed)"},{"path":"https://cli.r-lib.org/dev/reference/unicode-width-workaround.html","id":null,"dir":"Reference","previous_headings":"","what":"Working around the bad Unicode character widths — unicode-width-workaround","title":"Working around the bad Unicode character widths — unicode-width-workaround","text":"R 3.6.2 also coming 3.6.3 4.0.0 versions use Unicode 8 standard calculate display width Unicode characters. Unfortunately widths emojis incorrect standard, width 1 reported instead correct 2 value.","code":""},{"path":"https://cli.r-lib.org/dev/reference/unicode-width-workaround.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Working around the bad Unicode character widths — unicode-width-workaround","text":"cli implements workaround . package contains table contains Unicode ranges wide characters (display width 2). first use one workaround wrappers (ansi_nchar(), etc.) check current version R thinks width characters, create regex matches ones R wrong (re_bad_char_width). use regex duplicate problematic characters input string wrapper function, calling real string manipulation function (nchar(), strwrap()) etc. end undo duplication return result. workaround fine nchar() strwrap(), consequently ansi_align() ansi_strtrim() well. rest ansi_*() functions work characters, deal character width.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":null,"dir":"Reference","previous_headings":"","what":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"Break UTF-8 character vector grapheme clusters","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"","code":"utf8_graphemes(x)"},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"x Character vector.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"List characters vectors, grapheme clusters input string.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/utf8_graphemes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Break an UTF-8 character vector into grapheme clusters — utf8_graphemes","text":"","code":"# Five grapheme clusters str <- paste0( \"\\U0001f477\\U0001f3ff\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3ff\", \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\U0001f3ff\") cat(str, \"\\n\") #> 👷🏿‍♀️👷🏿👷‍♀️👷🏻👷🏿 chrs <- utf8_graphemes(str)"},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":null,"dir":"Reference","previous_headings":"","what":"Count the number of characters in a character vector — utf8_nchar","title":"Count the number of characters in a character vector — utf8_nchar","text":"default counts Unicode grapheme clusters, instead code points.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count the number of characters in a character vector — utf8_nchar","text":"","code":"utf8_nchar(x, type = c(\"chars\", \"bytes\", \"width\", \"graphemes\", \"codepoints\"))"},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count the number of characters in a character vector — utf8_nchar","text":"x Character vector, converted UTF-8. type Whether count graphemes (characters), code points, bytes, calculate display width string.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count the number of characters in a character vector — utf8_nchar","text":"Numeric vector, length strings character vector.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/utf8_nchar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count the number of characters in a character vector — utf8_nchar","text":"","code":"# Grapheme example, emoji with combining characters. This is a single # grapheme, consisting of five Unicode code points: # * `\\U0001f477` is the construction worker emoji # * `\\U0001f3fb` is emoji modifier that changes the skin color # * `\\u200d` is the zero width joiner # * `\\u2640` is the female sign # * `\\ufe0f` is variation selector 16, requesting an emoji style glyph emo <- \"\\U0001f477\\U0001f3fb\\u200d\\u2640\\ufe0f\" cat(emo) #> 👷🏻‍♀️ utf8_nchar(emo, \"chars\") # = graphemes #> [1] 1 utf8_nchar(emo, \"bytes\") #> [1] 17 utf8_nchar(emo, \"width\") #> [1] 2 utf8_nchar(emo, \"codepoints\") #> [1] 5 # For comparision, the output for width depends on the R version used: nchar(emo, \"chars\") #> [1] 5 nchar(emo, \"bytes\") #> [1] 17 nchar(emo, \"width\") #> [1] 5"},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":null,"dir":"Reference","previous_headings":"","what":"Substring of an UTF-8 string — utf8_substr","title":"Substring of an UTF-8 string — utf8_substr","text":"function uses grapheme clusters instead Unicode code points UTF-8 strings.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Substring of an UTF-8 string — utf8_substr","text":"","code":"utf8_substr(x, start, stop)"},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Substring of an UTF-8 string — utf8_substr","text":"x Character vector. start Starting index indices, recycled match length x. stop Ending index indices, recycled match length x.","code":""},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Substring of an UTF-8 string — utf8_substr","text":"Character vector length x, containing requested substrings.","code":""},{"path":[]},{"path":"https://cli.r-lib.org/dev/reference/utf8_substr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Substring of an UTF-8 string — utf8_substr","text":"","code":"# Five grapheme clusters, select the middle three str <- paste0( \"\\U0001f477\\U0001f3ff\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3ff\", \"\\U0001f477\\u200d\\u2640\\ufe0f\", \"\\U0001f477\\U0001f3fb\", \"\\U0001f477\\U0001f3ff\") cat(str) #> 👷🏿‍♀️👷🏿👷‍♀️👷🏻👷🏿 str24 <- utf8_substr(str, 2, 4) cat(str24) #> 👷🏿👷‍♀️👷🏻"},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"utility function calculates state VT-5xx screen certain set output.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"","code":"vt_output(output, width = 80L, height = 25L)"},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"output Character vector raw vector. Character vectors collapsed (without separater), converted raw vector using base::charToRaw(). width Terminal width. height Terminal height.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"Data frame columns lineno, segmentno, segment, attributes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"Currently supports: configurable terminal width height ASCII printable characters. \\n, \\r. ANSI SGR colors, 8 color mode, 256 color mode true color mode. ANSI SGR features: bold, italic, underline, strikethrough, blink, inverse. currently supports features, mode notably: ANSI control sequences features. control sequences silently ignored. Wide Unicode characters. width taken account correctly. Unicode graphemes.","code":""},{"path":"https://cli.r-lib.org/dev/reference/vt_output.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Simulate (a subset of) a VT-5xx ANSI terminal — vt_output","text":"function experimental, virtual temrinal API likely change future versions cli.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-development-version","dir":"Changelog","previous_headings":"","what":"cli (development version)","title":"cli (development version)","text":"cli_progress_bar() now accepts total = Inf -Inf mimics behavior total NA. num_ansi_colors() now warn Emacs INSIDE_EMACS environment variable proper version number (@rundel, #689). ansi_collapse() inline collapsing now uses last separator (without serial comma) two-element vectors sep2 given (@rundel, #681). ansi_collapse() now correct length-1 vectors style “head” width specified (@rundel, #590).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-363","dir":"Changelog","previous_headings":"","what":"cli 3.6.3","title":"cli 3.6.3","text":"CRAN release: 2024-06-21 cli now builds ARM Windows. “Solarized Dark” now default syntax highlighting theme terminals. {.obj_type_friendly} inline style now shows first class name (#669 @olivroy). Syntax highlighting now fail RStudio rstudioapi package installed (#697).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-362","dir":"Changelog","previous_headings":"","what":"cli 3.6.2","title":"cli 3.6.2","text":"CRAN release: 2023-12-11 ansi_collapse(x, trunc = 1, style = \"head\") now indeed shows one element length(x) == 2, documented (@salim-b, #572). ansi_collapse() gains sep2 argument specify seperate separator length-two inputs. defaults \" \" , conjunction defaults, produces collapsed string fully adheres serial comma rules. (@salim-b, #569) ansi_string() now exported function (@multimeric, #573).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-361","dir":"Changelog","previous_headings":"","what":"cli 3.6.1","title":"cli 3.6.1","text":"CRAN release: 2023-03-23 ANSI hyperlinks now turned RStudio render plane (#581).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-360","dir":"Changelog","previous_headings":"","what":"cli 3.6.0","title":"cli 3.6.0","text":"CRAN release: 2023-01-09 progressr progress handler now reports progress correctly (@HenrikBengtsson, #558). New hash_*sha1() functions calculate SHA-1 hash strings, objects, files. cli now shows progress bars one second default, less half way point. (two seconds, unconditionally, .) See cli.progress_show_after option ?cli-config details (#542). format_inline() now new argument keep_whitespace, keeps whitespace, including newline form feed characters default.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-350","dir":"Changelog","previous_headings":"","what":"cli 3.5.0","title":"cli 3.5.0","text":"CRAN release: 2022-12-20 New keypress() function read single key press terminal. New function pretty_print_code() print function objects syntax highlighting R console. col_* bg_* functions handle zero-length input correctly (#532). New function ansi_collapse() collapse character vectors single string. ansi_strtrim() now handles edge cases better, ellipsis length zero, wider width. New hash_file_md5() function calculate MD5 hash one files.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-341","dir":"Changelog","previous_headings":"","what":"cli 3.4.1","title":"cli 3.4.1","text":"CRAN release: 2022-09-23 cli better error messages now. New format_inline() argument: collapse, collapse multi-line output, potentially \\f characters.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-340","dir":"Changelog","previous_headings":"","what":"cli 3.4.0","title":"cli 3.4.0","text":"CRAN release: 2022-09-08 New experimental styles create ANSI hyperlinks RStudio terminals support . See ?cli::links details (#513). Expressions start end {} substitution now styled correctly. E.g. {.code {var1} + {var2}} (#517). New {.obj_type_friendly} inline style format type R object user friendly way (#463). Improved vector collapsing behavior. cli now shows beginning end collapsed vector, default (#419). Nested cli() calls work now (#497). Return values now work within cli() calls (#496). Style attributes underscores new names dashes instead: vec_sep, vec_last, vec_trunc, string-quote. old names still work, new ones take precedence (#483). cli now crash end R session Arm Windows (#494; @kevinushey) Vectors truncated 20 elements now default, instead 100 (#430). 20 new spinners awesome cli-spinners package, @HenrikBengtsson #469. Run demo , need UTF-8 emoji support: cli exit handlers now compatible withr package (#437). cli functions now keep trailing \\f characters newlines. also keep multiple consecutive \\f multiple newlinees (#491). {} substitutions within inline styles now formatted correctly. E.g. {.code download({url})} add backticks url, {.val pre-{x}-post} format whole value instead x. (#422, #474). cli now replaces newline characters within {.class ... } inline styles spaces. cli.warn_inline_newlines option set TRUE, also throws warning. (#417). code_highlight now falls back default theme (instead theme) unknown RStudio themes (#482, @rossellhayes). cli_abort() now supplies .frame abort(). fixes issue .internal = TRUE argument (r-lib/rlang#1386). cli now better job detecting RStudio build pane, job pane render pane, capabilities w.r.t. ANSI colors hyperlinks. Note requires daily build RStudio (#465). New functions ANSI strings: ansi_grep(), ansi_grepl(), ansi_nzchar(). work like corresponding base R functions, handle ANSI markup. style_hyperlink() (really) longer breaks env variable VTE_VERSION form \\d{4}, .e., 4 consecutive numbers (#441, @michaelchirico) cli_dl() corresponding cli_li() can now style labels. behavior cli’s inline styling expressions now predictable. cli try evaluate styled string R expression . E.g. meaning \"{.emph +1}\" now always “+1”, style .emph, even .emph variable available .emph + 1 expression can evaluated. Functions apply bright background colors (e.g. bg_br_yellow()) now close . longer format text end function (#484, @rossellhayes).","code":"new <- c(\"dots13\", \"dots8Bit\", \"sand\", \"material\", \"weather\", \"christmas\", \"grenade\", \"point\", \"layer\", \"betaWave\", \"fingerDance\", \"fistBump\", \"soccerHeader\", \"mindblown\", \"speaker\", \"orangePulse\", \"bluePulse\", \"orangeBluePulse\", \"timeTravel\", \"aesthetic\", \"growVeriticalDotsLR\", \"growVeriticalDotsRL\", \"growVeriticalDotsLL\", \"growVeriticalDotsRR\") demo_spinners(new)"},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-330","dir":"Changelog","previous_headings":"","what":"cli 3.3.0","title":"cli 3.3.0","text":"CRAN release: 2022-04-25 style_hyperlink() longer breaks env variable VTE_VERSION form \\d{4}, .e., 4 consecutive numbers (#441, @michaelchirico) ansi_*() functions support ANSI hyperlinks (#444). Turning ANSI colors via cli.num_colors option R_CLI_NUM_COLORS NO_COLOR environment variable now also turns ANSI hyperlinks (#447). symbol now two variants: UTF-8 ASCII. special variants RStudio Windows RGui (#424).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-320","dir":"Changelog","previous_headings":"","what":"cli 3.2.0","title":"cli 3.2.0","text":"CRAN release: 2022-02-14","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"breaking-change-3-2-0","dir":"Changelog","previous_headings":"","what":"Breaking change","title":"cli 3.2.0","text":"cli_theme_dark option now known cli.theme_dark, consistent cli option names (#380).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"other-changes-3-2-0","dir":"Changelog","previous_headings":"","what":"Other changes","title":"cli 3.2.0","text":"preferred names S3 classes ansi_string, ansi_style, boxx, rule tree now cli_ prefix: cli_ansi_string, etc. help avoiding name conflicts packages eventually, now old names kept well, compatibility. cli_abort() updated work nicely rlang 1.0. default call backtrace soft-truncation set .envir (set immediate caller cli_abort() default). Line formatting now happens lazily display time via rlang::cnd_message() (called conditionMessage() method rlang errors). New hash_sha256() function calculate SHA-256 hashes. New hash_raw_*(), hash_obj_*() hash_file_*() functions calculate various hashes raw vectors, R objects files. can use new cli.default_num_colors option set default number ANSI colors, ANSI support otherwise detected. See details manual num_ansi_colors(). can set new ESS_BACKGROUND_MODE environment variable dark indicate dark mode. cli now handles quotes comment characters better semantion cli_*() functions perform glue string interpolation (#370).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-311","dir":"Changelog","previous_headings":"","what":"cli 3.1.1","title":"cli 3.1.1","text":"CRAN release: 2022-01-20 style_hyperlink() gains params= argument (#384).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-310","dir":"Changelog","previous_headings":"","what":"cli 3.1.0","title":"cli 3.1.0","text":"CRAN release: 2021-10-27","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"breaking-changes-3-1-0","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"cli 3.1.0","text":"C progress bar API now uses double instead int data type progress units (#335).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"new-features-3-1-0","dir":"Changelog","previous_headings":"","what":"New features","title":"cli 3.1.0","text":"Several improvements changes ansi_*() functions: ansi_*() functions now implemented C much faster (#316). handle NA values better. many functions now use UTF-8 graphemes default instead code points. E.g. ansi_nchar() counts graphemes, etc. convert input UTF-8 always return UTF-8 encoded strings. new function ansi_simplify() remove superfluous ANSI tags. new function ansi_html() convert ANSI-highlighted strings HTML. ansi_has_any() ansi_strip() now sgr csi arguments look SGR tags, CSI tags, . New functions handle UTF-8 encoded strings correctly: utf8_graphemes(), utf8_nchar(), utf8_substr(). Support palettes, including colorblind friendly palette. See ?ansi_palettes details. True color support: num_ansi_colors() now detects terminals 24 bit color support, make_ansi_style() uses exact RGB colors terminals (#208). new col_br_*() bg_br_() functions create bright versions eight base ANSI colors (#327). New function code_highlight() syntax highlight R code. supports several themes box, see code_theme_list() (#348). New functions hashing: hash_animal(), hash_emoji() hash_md5(). New diff_chr() diff_str() functions calculate difference character vectors letters strings.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"smaller-improvements-3-1-0","dir":"Changelog","previous_headings":"","what":"Smaller improvements","title":"cli 3.1.0","text":"Progress bars clear = FALSE now print last, completed, state properly. progress bar Shiny apps now handles output cli_progress_output(). Progress variables C format_done strings work correctly now (#337). cli_dl() now works empty description, gives better error invalid input (#347). rule() now works better labels ANSI markup. cli_spark objects now format() print() methods. cli_process_done() now error without process (#351). ANSI markup now supported RStudio jobs (#353). lack ANSI support now correctly detected active sink() (#366).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-301","dir":"Changelog","previous_headings":"","what":"cli 3.0.1","title":"cli 3.0.1","text":"CRAN release: 2021-07-17 ansi_strtrim() now correctly keeps NA values (#309). format_inline() now uses correct environment (@rundel, #314).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-300","dir":"Changelog","previous_headings":"","what":"cli 3.0.0","title":"cli 3.0.0","text":"CRAN release: 2021-06-30 New functions progress bars, please see new articles https://cli.r-lib.org/articles/ details. New cli_abort(), cli_warn() cli_inform() functions, throw errors cli pluralization styling. New format_inline() function format cli string without emitting (#278).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-250","dir":"Changelog","previous_headings":"","what":"cli 2.5.0","title":"cli 2.5.0","text":"CRAN release: 2021-04-26 New style_no_*() functions locally undo styling. New col_none() bg_none() functions locally undo text color background color. now possible undo text background color theme, setting NULL \"none\". cli_memo() renamed cli_bullets(), default formatted bullet list (#250). New ansi_toupper(), ansi_tolower ansi_chartr() functions, ANSI styling aware variants toupper(), tolower() chartr() (#248). New test_that_cli() helper function write testthat tests cli output. tree() now produce warnings tibbles (#238). New inline style: .cls format class names, e.g. \"{.var fit} must {.cls lm} object\".","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-240","dir":"Changelog","previous_headings":"","what":"cli 2.4.0","title":"cli 2.4.0","text":"CRAN release: 2021-04-05 New cli_memo() function create list items tasks. New cli::cli() function create single cli message multiple cli calls (#170). cli now highlights weird names, e.g. path names leading trailing space (#227). Styling fixed several places. particular, nested lists now formatted better (#221). New spark_bar() spark_line() functions draw small bar line charts.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-231","dir":"Changelog","previous_headings":"","what":"cli 2.3.1","title":"cli 2.3.1","text":"CRAN release: 2021-02-23 ANSI color support detection works correctly now older RStudio, also older R versions. cli_h1(), cli_h2() cli_h3() now work multiple glue substitutions (#218).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-230","dir":"Changelog","previous_headings":"","what":"cli 2.3.0","title":"cli 2.3.0","text":"CRAN release: 2021-01-31 boxx() now correctly calculates width box non-ASCII characters. New ansi_trimws() ansi_strwrap() functions, similar trimws() strwrap() work ANSI strings. New ansi_columns() function format ANSI strings multiple columns. ansi_substr(), ansi_substring(), ansi_strsplit(), ansi_align() now always return cli_ansi_string objects. ansi_nchar(), ansi_align(), ansi_strtrim() new ansi_strwrap() well handle wide Unicode correctly, according display width. boxx() can now add headers footers boxes.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-220","dir":"Changelog","previous_headings":"","what":"cli 2.2.0","title":"cli 2.2.0","text":"CRAN release: 2020-11-20 New style_hyperlink() function add hyperlinks, terminals support . cli_format_method() now works properly knitr, environments catch message conditions (#159). ANSI strings created col_*, bg_* style_* now also add character class result. fixes issues code expect character objects. New functions manipulate ANSI strings: ansi_aling(), ansi_has_any(), ansi_nchar(), ansi_regex(), ansi_strip(), ansi_strsplit(), ansi_substr(), ansi_substring().","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-210","dir":"Changelog","previous_headings":"","what":"cli 2.1.0","title":"cli 2.1.0","text":"CRAN release: 2020-10-12 New cli_vec() function allow easier formatting collapsed vectors. now also possible use styling set collapsing parameters (#129). New pluralize() function perform pluralization without generating cli output (#155). console_width() works better now RStudio, also terminals. Styling verbatim text work properly now (#147, @tzakharko). Messages (.e. message conditions) coming cli now cliMessage class, can easily suppress without suppressing messages (#156). cli prints output stderr() now, output message sink. make interactive non-interactive sessions consistent (#153). Pluralization works correctly now last alternative empty string (#158). cli now caches result dark background detection iTerm macOS. Reload cli delete cache (#131). is_dynamic_tty(), is_ansi_tty() ansi_hide_cursor() related functions now default \"auto\" stream, automatically selected either stdout() stderr(). See manual details (#144). default theme now quotes file names, paths, email addresses don’t start end alphanumeric character slash. make easier spot names start end space (#167). make_spinner() clears line properly now (@tzakharko, #164). Semantic cli functions now automatically replace Unicode non-breaking space characters (\\u00a0) regular space characters, right output. still used calculate line breaks, outputted (#161). Progress bars now respect is_dynamic_tty() output \\r false (@jimhester, #177)","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-202","dir":"Changelog","previous_headings":"","what":"cli 2.0.2","title":"cli 2.0.2","text":"CRAN release: 2020-02-28 status bar now simplify multiple spaces single space. cli now crash fails detect whether RStudio theme dark theme (#138). cli now works better wide Unicode characters, example emojis. particular, status bar containing emojis cleared properly (#133). status bar now flicker updated, terminals (#135).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-201","dir":"Changelog","previous_headings":"","what":"cli 2.0.1","title":"cli 2.0.1","text":"CRAN release: 2020-01-08 Symbols (symbol$*) now correctly printed RStudio Windows (#124). default theme cli_code() output looks better now, especially RStudio (#123). Remove spurious newline cli_process_start() cleared manually, also end function. Use Oxford comma listing 3 items (@jonocarroll, #128).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-200","dir":"Changelog","previous_headings":"","what":"cli 2.0.0","title":"cli 2.0.0","text":"CRAN release: 2019-12-09","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"semantic-command-line-interface-tools-2-0-0","dir":"Changelog","previous_headings":"","what":"Semantic command line interface tools","title":"cli 2.0.0","text":"cli 2.0.0 new set functions help creating CLI using set higher level elements: headings, paragraphs, lists, alerts, code blocks, etc. formatting elements can customized via themes. See “Building semantic CLI” article package web site: https://cli.r-lib.org","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"bug-fixes-2-0-0","dir":"Changelog","previous_headings":"","what":"Bug fixes:","title":"cli 2.0.0","text":"Fix bug is_dynamic_tty(), setting R_CLI_DYNAMIC=\"FALSE\" now properly turns dynamic tty (#70).","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-110","dir":"Changelog","previous_headings":"","what":"cli 1.1.0","title":"cli 1.1.0","text":"CRAN release: 2019-03-19 cli now functions add ANSI styles text. use crayon package internally, provide simpler interface. See col_*, bg_*, style_* also make_ansi_style() combine_ansi_styles() functions (#51). New is_dynamic_tty() function detects \\r used stream (#62). New is_ansi_tty() function detects ANSI control sequences can used stream. New ansi_hide_cursor(), ansi_show_cursor() ansi_with_hidden_cursor() functions hide show cursor terminals. New make_spinner() function helps integrating spinners functions. Now symbol always uses ASCII symbols cli.unicode option set FALSE.","code":""},{"path":"https://cli.r-lib.org/dev/news/index.html","id":"cli-100","dir":"Changelog","previous_headings":"","what":"cli 1.0.0","title":"cli 1.0.0","text":"CRAN release: 2017-11-05 First public release.","code":""}]