diff options
| author | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
| commit | bb8d79eadbba1942dbdb9f9cee5c47833afe269f (patch) | |
| tree | b8c517e9ca895d60d7227aef7177b6291df5e2cd /coreutils | |
| parent | 9fa1e4990e655a85025c9d270a1606983e375e47 (diff) | |
| parent | 7d877fc9312a742b06125927bb1d34bd35398c6c (diff) | |
| download | busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.gz busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.bz2 busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
76 files changed, 970 insertions, 900 deletions
diff --git a/coreutils/Config.src b/coreutils/Config.src index b9dde1209..c056320f8 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src | |||
| @@ -7,656 +7,6 @@ menu "Coreutils" | |||
| 7 | 7 | ||
| 8 | INSERT | 8 | INSERT |
| 9 | 9 | ||
| 10 | config CAL | ||
| 11 | bool "cal" | ||
| 12 | default y | ||
| 13 | help | ||
| 14 | cal is used to display a monthly calendar. | ||
| 15 | |||
| 16 | config CATV | ||
| 17 | bool "catv" | ||
| 18 | default y | ||
| 19 | help | ||
| 20 | Display nonprinting characters as escape sequences (like some | ||
| 21 | implementations' cat -v option). | ||
| 22 | |||
| 23 | config CHGRP | ||
| 24 | bool "chgrp" | ||
| 25 | default y | ||
| 26 | help | ||
| 27 | chgrp is used to change the group ownership of files. | ||
| 28 | |||
| 29 | config CHMOD | ||
| 30 | bool "chmod" | ||
| 31 | default y | ||
| 32 | help | ||
| 33 | chmod is used to change the access permission of files. | ||
| 34 | |||
| 35 | config CHOWN | ||
| 36 | bool "chown" | ||
| 37 | default y | ||
| 38 | help | ||
| 39 | chown is used to change the user and/or group ownership | ||
| 40 | of files. | ||
| 41 | |||
| 42 | config FEATURE_CHOWN_LONG_OPTIONS | ||
| 43 | bool "Enable long options" | ||
| 44 | default y | ||
| 45 | depends on CHOWN && LONG_OPTS | ||
| 46 | help | ||
| 47 | Enable use of long options | ||
| 48 | |||
| 49 | config CHROOT | ||
| 50 | bool "chroot" | ||
| 51 | default y | ||
| 52 | help | ||
| 53 | chroot is used to change the root directory and run a command. | ||
| 54 | The default command is `/bin/sh'. | ||
| 55 | |||
| 56 | config CKSUM | ||
| 57 | bool "cksum" | ||
| 58 | default y | ||
| 59 | help | ||
| 60 | cksum is used to calculate the CRC32 checksum of a file. | ||
| 61 | |||
| 62 | config COMM | ||
| 63 | bool "comm" | ||
| 64 | default y | ||
| 65 | help | ||
| 66 | comm is used to compare two files line by line and return | ||
| 67 | a three-column output. | ||
| 68 | |||
| 69 | config CP | ||
| 70 | bool "cp" | ||
| 71 | default y | ||
| 72 | help | ||
| 73 | cp is used to copy files and directories. | ||
| 74 | |||
| 75 | config FEATURE_CP_LONG_OPTIONS | ||
| 76 | bool "Enable long options for cp" | ||
| 77 | default y | ||
| 78 | depends on CP && LONG_OPTS | ||
| 79 | help | ||
| 80 | Enable long options for cp. | ||
| 81 | Also add support for --parents option. | ||
| 82 | |||
| 83 | config CUT | ||
| 84 | bool "cut" | ||
| 85 | default y | ||
| 86 | help | ||
| 87 | cut is used to print selected parts of lines from | ||
| 88 | each file to stdout. | ||
| 89 | |||
| 90 | config DF | ||
| 91 | bool "df" | ||
| 92 | default y | ||
| 93 | help | ||
| 94 | df reports the amount of disk space used and available | ||
| 95 | on filesystems. | ||
| 96 | |||
| 97 | config FEATURE_DF_FANCY | ||
| 98 | bool "Enable -a, -i, -B" | ||
| 99 | default y | ||
| 100 | depends on DF | ||
| 101 | help | ||
| 102 | This option enables -a, -i and -B. | ||
| 103 | |||
| 104 | -a Show all filesystems | ||
| 105 | -i Inodes | ||
| 106 | -B <SIZE> Blocksize | ||
| 107 | |||
| 108 | config DIRNAME | ||
| 109 | bool "dirname" | ||
| 110 | default y | ||
| 111 | help | ||
| 112 | dirname is used to strip a non-directory suffix from | ||
| 113 | a file name. | ||
| 114 | |||
| 115 | config DOS2UNIX | ||
| 116 | bool "dos2unix/unix2dos" | ||
| 117 | default y | ||
| 118 | help | ||
| 119 | dos2unix is used to convert a text file from DOS format to | ||
| 120 | UNIX format, and vice versa. | ||
| 121 | |||
| 122 | config UNIX2DOS | ||
| 123 | bool | ||
| 124 | default y | ||
| 125 | depends on DOS2UNIX | ||
| 126 | help | ||
| 127 | unix2dos is used to convert a text file from UNIX format to | ||
| 128 | DOS format, and vice versa. | ||
| 129 | |||
| 130 | config DU | ||
| 131 | bool "du (default blocksize of 512 bytes)" | ||
| 132 | default y | ||
| 133 | help | ||
| 134 | du is used to report the amount of disk space used | ||
| 135 | for specified files. | ||
| 136 | |||
| 137 | config FEATURE_DU_DEFAULT_BLOCKSIZE_1K | ||
| 138 | bool "Use a default blocksize of 1024 bytes (1K)" | ||
| 139 | default y | ||
| 140 | depends on DU | ||
| 141 | help | ||
| 142 | Use a blocksize of (1K) instead of the default 512b. | ||
| 143 | |||
| 144 | config ECHO | ||
| 145 | bool "echo (basic SuSv3 version taking no options)" | ||
| 146 | default y | ||
| 147 | help | ||
| 148 | echo is used to print a specified string to stdout. | ||
| 149 | |||
| 150 | # this entry also appears in shell/Config.in, next to the echo builtin | ||
| 151 | config FEATURE_FANCY_ECHO | ||
| 152 | bool "Enable echo options (-n and -e)" | ||
| 153 | default y | ||
| 154 | depends on ECHO || ASH_BUILTIN_ECHO || HUSH | ||
| 155 | help | ||
| 156 | This adds options (-n and -e) to echo. | ||
| 157 | |||
| 158 | config ENV | ||
| 159 | bool "env" | ||
| 160 | default y | ||
| 161 | help | ||
| 162 | env is used to set an environment variable and run | ||
| 163 | a command; without options it displays the current | ||
| 164 | environment. | ||
| 165 | |||
| 166 | config FEATURE_ENV_LONG_OPTIONS | ||
| 167 | bool "Enable long options" | ||
| 168 | default y | ||
| 169 | depends on ENV && LONG_OPTS | ||
| 170 | help | ||
| 171 | Support long options for the env applet. | ||
| 172 | |||
| 173 | config EXPAND | ||
| 174 | bool "expand" | ||
| 175 | default y | ||
| 176 | help | ||
| 177 | By default, convert all tabs to spaces. | ||
| 178 | |||
| 179 | config FEATURE_EXPAND_LONG_OPTIONS | ||
| 180 | bool "Enable long options" | ||
| 181 | default y | ||
| 182 | depends on EXPAND && LONG_OPTS | ||
| 183 | help | ||
| 184 | Support long options for the expand applet. | ||
| 185 | |||
| 186 | config EXPR | ||
| 187 | bool "expr" | ||
| 188 | default y | ||
| 189 | help | ||
| 190 | expr is used to calculate numbers and print the result | ||
| 191 | to standard output. | ||
| 192 | |||
| 193 | config EXPR_MATH_SUPPORT_64 | ||
| 194 | bool "Extend Posix numbers support to 64 bit" | ||
| 195 | default y | ||
| 196 | depends on EXPR | ||
| 197 | help | ||
| 198 | Enable 64-bit math support in the expr applet. This will make | ||
| 199 | the applet slightly larger, but will allow computation with very | ||
| 200 | large numbers. | ||
| 201 | |||
| 202 | config FALSE | ||
| 203 | bool "false" | ||
| 204 | default y | ||
| 205 | help | ||
| 206 | false returns an exit code of FALSE (1). | ||
| 207 | |||
| 208 | config FOLD | ||
| 209 | bool "fold" | ||
| 210 | default y | ||
| 211 | help | ||
| 212 | Wrap text to fit a specific width. | ||
| 213 | |||
| 214 | config FSYNC | ||
| 215 | bool "fsync" | ||
| 216 | default y | ||
| 217 | help | ||
| 218 | fsync is used to flush file-related cached blocks to disk. | ||
| 219 | |||
| 220 | config HEAD | ||
| 221 | bool "head" | ||
| 222 | default y | ||
| 223 | help | ||
| 224 | head is used to print the first specified number of lines | ||
| 225 | from files. | ||
| 226 | |||
| 227 | config FEATURE_FANCY_HEAD | ||
| 228 | bool "Enable head options (-c, -q, and -v)" | ||
| 229 | default y | ||
| 230 | depends on HEAD | ||
| 231 | help | ||
| 232 | This enables the head options (-c, -q, and -v). | ||
| 233 | |||
| 234 | config INSTALL | ||
| 235 | bool "install" | ||
| 236 | default y | ||
| 237 | help | ||
| 238 | Copy files and set attributes. | ||
| 239 | |||
| 240 | config FEATURE_INSTALL_LONG_OPTIONS | ||
| 241 | bool "Enable long options" | ||
| 242 | default y | ||
| 243 | depends on INSTALL && LONG_OPTS | ||
| 244 | help | ||
| 245 | Support long options for the install applet. | ||
| 246 | |||
| 247 | ####config LENGTH | ||
| 248 | #### bool "length" | ||
| 249 | #### default y | ||
| 250 | #### help | ||
| 251 | #### length is used to print out the length of a specified string. | ||
| 252 | |||
| 253 | config LN | ||
| 254 | bool "ln" | ||
| 255 | default y | ||
| 256 | help | ||
| 257 | ln is used to create hard or soft links between files. | ||
| 258 | |||
| 259 | config LOGNAME | ||
| 260 | bool "logname" | ||
| 261 | default y | ||
| 262 | help | ||
| 263 | logname is used to print the current user's login name. | ||
| 264 | |||
| 265 | config LS | ||
| 266 | bool "ls" | ||
| 267 | default y | ||
| 268 | help | ||
| 269 | ls is used to list the contents of directories. | ||
| 270 | |||
| 271 | config FEATURE_LS_FILETYPES | ||
| 272 | bool "Enable filetyping options (-p and -F)" | ||
| 273 | default y | ||
| 274 | depends on LS | ||
| 275 | help | ||
| 276 | Enable the ls options (-p and -F). | ||
| 277 | |||
| 278 | config FEATURE_LS_FOLLOWLINKS | ||
| 279 | bool "Enable symlinks dereferencing (-L)" | ||
| 280 | default y | ||
| 281 | depends on LS | ||
| 282 | help | ||
| 283 | Enable the ls option (-L). | ||
| 284 | |||
| 285 | config FEATURE_LS_RECURSIVE | ||
| 286 | bool "Enable recursion (-R)" | ||
| 287 | default y | ||
| 288 | depends on LS | ||
| 289 | help | ||
| 290 | Enable the ls option (-R). | ||
| 291 | |||
| 292 | config FEATURE_LS_SORTFILES | ||
| 293 | bool "Sort the file names" | ||
| 294 | default y | ||
| 295 | depends on LS | ||
| 296 | help | ||
| 297 | Allow ls to sort file names alphabetically. | ||
| 298 | |||
| 299 | config FEATURE_LS_TIMESTAMPS | ||
| 300 | bool "Show file timestamps" | ||
| 301 | default y | ||
| 302 | depends on LS | ||
| 303 | help | ||
| 304 | Allow ls to display timestamps for files. | ||
| 305 | |||
| 306 | config FEATURE_LS_USERNAME | ||
| 307 | bool "Show username/groupnames" | ||
| 308 | default y | ||
| 309 | depends on LS | ||
| 310 | help | ||
| 311 | Allow ls to display username/groupname for files. | ||
| 312 | |||
| 313 | config FEATURE_LS_COLOR | ||
| 314 | bool "Allow use of color to identify file types" | ||
| 315 | default y | ||
| 316 | depends on LS && LONG_OPTS | ||
| 317 | help | ||
| 318 | This enables the --color option to ls. | ||
| 319 | |||
| 320 | config FEATURE_LS_COLOR_IS_DEFAULT | ||
| 321 | bool "Produce colored ls output by default" | ||
| 322 | default y | ||
| 323 | depends on FEATURE_LS_COLOR | ||
| 324 | help | ||
| 325 | Saying yes here will turn coloring on by default, | ||
| 326 | even if no "--color" option is given to the ls command. | ||
| 327 | This is not recommended, since the colors are not | ||
| 328 | configurable, and the output may not be legible on | ||
| 329 | many output screens. | ||
| 330 | |||
| 331 | config MKDIR | ||
| 332 | bool "mkdir" | ||
| 333 | default y | ||
| 334 | help | ||
| 335 | mkdir is used to create directories with the specified names. | ||
| 336 | |||
| 337 | config FEATURE_MKDIR_LONG_OPTIONS | ||
| 338 | bool "Enable long options" | ||
| 339 | default y | ||
| 340 | depends on MKDIR && LONG_OPTS | ||
| 341 | help | ||
| 342 | Support long options for the mkdir applet. | ||
| 343 | |||
| 344 | config MKFIFO | ||
| 345 | bool "mkfifo" | ||
| 346 | default y | ||
| 347 | help | ||
| 348 | mkfifo is used to create FIFOs (named pipes). | ||
| 349 | The `mknod' program can also create FIFOs. | ||
| 350 | |||
| 351 | config MKNOD | ||
| 352 | bool "mknod" | ||
| 353 | default y | ||
| 354 | help | ||
| 355 | mknod is used to create FIFOs or block/character special | ||
| 356 | files with the specified names. | ||
| 357 | |||
| 358 | config MV | ||
| 359 | bool "mv" | ||
| 360 | default y | ||
| 361 | help | ||
| 362 | mv is used to move or rename files or directories. | ||
| 363 | |||
| 364 | config FEATURE_MV_LONG_OPTIONS | ||
| 365 | bool "Enable long options" | ||
| 366 | default y | ||
| 367 | depends on MV && LONG_OPTS | ||
| 368 | help | ||
| 369 | Support long options for the mv applet. | ||
| 370 | |||
| 371 | config NICE | ||
| 372 | bool "nice" | ||
| 373 | default y | ||
| 374 | help | ||
| 375 | nice runs a program with modified scheduling priority. | ||
| 376 | |||
| 377 | config NOHUP | ||
| 378 | bool "nohup" | ||
| 379 | default y | ||
| 380 | help | ||
| 381 | run a command immune to hangups, with output to a non-tty. | ||
| 382 | |||
| 383 | config OD | ||
| 384 | bool "od" | ||
| 385 | default y | ||
| 386 | help | ||
| 387 | od is used to dump binary files in octal and other formats. | ||
| 388 | |||
| 389 | config PRINTENV | ||
| 390 | bool "printenv" | ||
| 391 | default y | ||
| 392 | help | ||
| 393 | printenv is used to print all or part of environment. | ||
| 394 | |||
| 395 | config PRINTF | ||
| 396 | bool "printf" | ||
| 397 | default y | ||
| 398 | help | ||
| 399 | printf is used to format and print specified strings. | ||
| 400 | It's similar to `echo' except it has more options. | ||
| 401 | |||
| 402 | config PWD | ||
| 403 | bool "pwd" | ||
| 404 | default y | ||
| 405 | help | ||
| 406 | pwd is used to print the current directory. | ||
| 407 | |||
| 408 | config READLINK | ||
| 409 | bool "readlink" | ||
| 410 | default y | ||
| 411 | help | ||
| 412 | This program reads a symbolic link and returns the name | ||
| 413 | of the file it points to | ||
| 414 | |||
| 415 | config FEATURE_READLINK_FOLLOW | ||
| 416 | bool "Enable canonicalization by following all symlinks (-f)" | ||
| 417 | default y | ||
| 418 | depends on READLINK | ||
| 419 | help | ||
| 420 | Enable the readlink option (-f). | ||
| 421 | |||
| 422 | config REALPATH | ||
| 423 | bool "realpath" | ||
| 424 | default y | ||
| 425 | help | ||
| 426 | Return the canonicalized absolute pathname. | ||
| 427 | This isn't provided by GNU shellutils, but where else does it belong. | ||
| 428 | |||
| 429 | config RM | ||
| 430 | bool "rm" | ||
| 431 | default y | ||
| 432 | help | ||
| 433 | rm is used to remove files or directories. | ||
| 434 | |||
| 435 | config RMDIR | ||
| 436 | bool "rmdir" | ||
| 437 | default y | ||
| 438 | help | ||
| 439 | rmdir is used to remove empty directories. | ||
| 440 | |||
| 441 | config FEATURE_RMDIR_LONG_OPTIONS | ||
| 442 | bool "Enable long options" | ||
| 443 | default y | ||
| 444 | depends on RMDIR && LONG_OPTS | ||
| 445 | help | ||
| 446 | Support long options for the rmdir applet, including | ||
| 447 | --ignore-fail-on-non-empty for compatibility with GNU rmdir. | ||
| 448 | |||
| 449 | config SEQ | ||
| 450 | bool "seq" | ||
| 451 | default y | ||
| 452 | help | ||
| 453 | print a sequence of numbers | ||
| 454 | |||
| 455 | config SLEEP | ||
| 456 | bool "sleep" | ||
| 457 | default y | ||
| 458 | help | ||
| 459 | sleep is used to pause for a specified number of seconds. | ||
| 460 | It comes in 3 versions: | ||
| 461 | - small: takes one integer parameter | ||
| 462 | - fancy: takes multiple integer arguments with suffixes: | ||
| 463 | sleep 1d 2h 3m 15s | ||
| 464 | - fancy with fractional numbers: | ||
| 465 | sleep 2.3s 4.5h sleeps for 16202.3 seconds | ||
| 466 | Last one is "the most compatible" with coreutils sleep, | ||
| 467 | but it adds around 1k of code. | ||
| 468 | |||
| 469 | config FEATURE_FANCY_SLEEP | ||
| 470 | bool "Enable multiple arguments and s/m/h/d suffixes" | ||
| 471 | default y | ||
| 472 | depends on SLEEP | ||
| 473 | help | ||
| 474 | Allow sleep to pause for specified minutes, hours, and days. | ||
| 475 | |||
| 476 | config FEATURE_FLOAT_SLEEP | ||
| 477 | bool "Enable fractional arguments" | ||
| 478 | default y | ||
| 479 | depends on FEATURE_FANCY_SLEEP | ||
| 480 | help | ||
| 481 | Allow for fractional numeric parameters. | ||
| 482 | |||
| 483 | config SORT | ||
| 484 | bool "sort" | ||
| 485 | default y | ||
| 486 | help | ||
| 487 | sort is used to sort lines of text in specified files. | ||
| 488 | |||
| 489 | config FEATURE_SORT_BIG | ||
| 490 | bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" | ||
| 491 | default y | ||
| 492 | depends on SORT | ||
| 493 | help | ||
| 494 | Without this, sort only supports -r, -u, and an integer version | ||
| 495 | of -n. Selecting this adds sort keys, floating point support, and | ||
| 496 | more. This adds a little over 3k to a nonstatic build on x86. | ||
| 497 | |||
| 498 | The SuSv3 sort standard is available at: | ||
| 499 | http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html | ||
| 500 | |||
| 501 | config SPLIT | ||
| 502 | bool "split" | ||
| 503 | default y | ||
| 504 | help | ||
| 505 | split a file into pieces. | ||
| 506 | |||
| 507 | config FEATURE_SPLIT_FANCY | ||
| 508 | bool "Fancy extensions" | ||
| 509 | default y | ||
| 510 | depends on SPLIT | ||
| 511 | help | ||
| 512 | Add support for features not required by SUSv3. | ||
| 513 | Supports additional suffixes 'b' for 512 bytes, | ||
| 514 | 'g' for 1GiB for the -b option. | ||
| 515 | |||
| 516 | config STTY | ||
| 517 | bool "stty" | ||
| 518 | default y | ||
| 519 | help | ||
| 520 | stty is used to change and print terminal line settings. | ||
| 521 | |||
| 522 | config SUM | ||
| 523 | bool "sum" | ||
| 524 | default y | ||
| 525 | help | ||
| 526 | checksum and count the blocks in a file | ||
| 527 | |||
| 528 | config TAC | ||
| 529 | bool "tac" | ||
| 530 | default y | ||
| 531 | help | ||
| 532 | tac is used to concatenate and print files in reverse. | ||
| 533 | |||
| 534 | config TAIL | ||
| 535 | bool "tail" | ||
| 536 | default y | ||
| 537 | help | ||
| 538 | tail is used to print the last specified number of lines | ||
| 539 | from files. | ||
| 540 | |||
| 541 | config FEATURE_FANCY_TAIL | ||
| 542 | bool "Enable extra tail options (-q, -s, -v, and -F)" | ||
| 543 | default y | ||
| 544 | depends on TAIL | ||
| 545 | help | ||
| 546 | The options (-q, -s, -v and -F) are provided by GNU tail, but | ||
| 547 | are not specific in the SUSv3 standard. | ||
| 548 | |||
| 549 | -q Never output headers giving file names | ||
| 550 | -s SEC Wait SEC seconds between reads with -f | ||
| 551 | -v Always output headers giving file names | ||
| 552 | -F Same as -f, but keep retrying | ||
| 553 | |||
| 554 | config TEE | ||
| 555 | bool "tee" | ||
| 556 | default y | ||
| 557 | help | ||
| 558 | tee is used to read from standard input and write | ||
| 559 | to standard output and files. | ||
| 560 | |||
| 561 | config FEATURE_TEE_USE_BLOCK_IO | ||
| 562 | bool "Enable block I/O (larger/faster) instead of byte I/O" | ||
| 563 | default y | ||
| 564 | depends on TEE | ||
| 565 | help | ||
| 566 | Enable this option for a faster tee, at expense of size. | ||
| 567 | |||
| 568 | config TRUE | ||
| 569 | bool "true" | ||
| 570 | default y | ||
| 571 | help | ||
| 572 | true returns an exit code of TRUE (0). | ||
| 573 | |||
| 574 | config TTY | ||
| 575 | bool "tty" | ||
| 576 | default y | ||
| 577 | help | ||
| 578 | tty is used to print the name of the current terminal to | ||
| 579 | standard output. | ||
| 580 | |||
| 581 | config UNAME | ||
| 582 | bool "uname" | ||
| 583 | default y | ||
| 584 | help | ||
| 585 | uname is used to print system information. | ||
| 586 | |||
| 587 | config UNAME_OSNAME | ||
| 588 | string "Operating system name" | ||
| 589 | default "GNU/Linux" | ||
| 590 | depends on UNAME | ||
| 591 | help | ||
| 592 | Sets the operating system name reported by uname -o. The | ||
| 593 | default is "GNU/Linux". | ||
| 594 | |||
| 595 | config UNEXPAND | ||
| 596 | bool "unexpand" | ||
| 597 | default y | ||
| 598 | help | ||
| 599 | By default, convert only leading sequences of blanks to tabs. | ||
| 600 | |||
| 601 | config FEATURE_UNEXPAND_LONG_OPTIONS | ||
| 602 | bool "Enable long options" | ||
| 603 | default y | ||
| 604 | depends on UNEXPAND && LONG_OPTS | ||
| 605 | help | ||
| 606 | Support long options for the unexpand applet. | ||
| 607 | |||
| 608 | config UNIQ | ||
| 609 | bool "uniq" | ||
| 610 | default y | ||
| 611 | help | ||
| 612 | uniq is used to remove duplicate lines from a sorted file. | ||
| 613 | |||
| 614 | config USLEEP | ||
| 615 | bool "usleep" | ||
| 616 | default y | ||
| 617 | help | ||
| 618 | usleep is used to pause for a specified number of microseconds. | ||
| 619 | |||
| 620 | config UUDECODE | ||
| 621 | bool "uudecode" | ||
| 622 | default y | ||
| 623 | help | ||
| 624 | uudecode is used to decode a uuencoded file. | ||
| 625 | |||
| 626 | config UUENCODE | ||
| 627 | bool "uuencode" | ||
| 628 | default y | ||
| 629 | help | ||
| 630 | uuencode is used to uuencode a file. | ||
| 631 | |||
| 632 | config WC | ||
| 633 | bool "wc" | ||
| 634 | default y | ||
| 635 | help | ||
| 636 | wc is used to print the number of bytes, words, and lines, | ||
| 637 | in specified files. | ||
| 638 | |||
| 639 | config FEATURE_WC_LARGE | ||
| 640 | bool "Support very large files in wc" | ||
| 641 | default y | ||
| 642 | depends on WC | ||
| 643 | help | ||
| 644 | Use "unsigned long long" in wc for counter variables. | ||
| 645 | |||
| 646 | config WHOAMI | ||
| 647 | bool "whoami" | ||
| 648 | default y | ||
| 649 | help | ||
| 650 | whoami is used to print the username of the current | ||
| 651 | user id (same as id -un). | ||
| 652 | |||
| 653 | config YES | ||
| 654 | bool "yes" | ||
| 655 | default y | ||
| 656 | help | ||
| 657 | yes is used to repeatedly output a specific string, or | ||
| 658 | the default string `y'. | ||
| 659 | |||
| 660 | comment "Common options" | 10 | comment "Common options" |
| 661 | 11 | ||
| 662 | config FEATURE_VERBOSE | 12 | config FEATURE_VERBOSE |
diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src index 5a64fee35..8e2c097a3 100644 --- a/coreutils/Kbuild.src +++ b/coreutils/Kbuild.src | |||
| @@ -9,70 +9,13 @@ libs-y += libcoreutils/ | |||
| 9 | lib-y:= | 9 | lib-y:= |
| 10 | 10 | ||
| 11 | INSERT | 11 | INSERT |
| 12 | lib-$(CONFIG_CAL) += cal.o | 12 | |
| 13 | lib-$(CONFIG_CATV) += catv.o | 13 | lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty |
| 14 | lib-$(CONFIG_CHGRP) += chgrp.o chown.o | 14 | lib-$(CONFIG_LESS) += cat.o # less too |
| 15 | lib-$(CONFIG_CHMOD) += chmod.o | 15 | lib-$(CONFIG_CRONTAB) += cat.o # crontab -l |
| 16 | lib-$(CONFIG_CHOWN) += chown.o | ||
| 17 | lib-$(CONFIG_ADDUSER) += chown.o # used by adduser | 16 | lib-$(CONFIG_ADDUSER) += chown.o # used by adduser |
| 18 | lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser | 17 | lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser |
| 19 | lib-$(CONFIG_CHROOT) += chroot.o | 18 | lib-$(CONFIG_ASH) += echo.o # used by ash |
| 20 | lib-$(CONFIG_CKSUM) += cksum.o | 19 | lib-$(CONFIG_HUSH) += echo.o # used by hush |
| 21 | lib-$(CONFIG_COMM) += comm.o | 20 | lib-$(CONFIG_FTPD) += ls.o # used by ftpd |
| 22 | lib-$(CONFIG_CP) += cp.o | ||
| 23 | lib-$(CONFIG_CUT) += cut.o | ||
| 24 | lib-$(CONFIG_DD) += dd.o | ||
| 25 | lib-$(CONFIG_DF) += df.o | ||
| 26 | lib-$(CONFIG_DIRNAME) += dirname.o | ||
| 27 | lib-$(CONFIG_DOS2UNIX) += dos2unix.o | ||
| 28 | lib-$(CONFIG_DU) += du.o | ||
| 29 | lib-$(CONFIG_ECHO) += echo.o | ||
| 30 | lib-$(CONFIG_ASH) += echo.o # used by ash | ||
| 31 | lib-$(CONFIG_HUSH) += echo.o # used by hush | ||
| 32 | lib-$(CONFIG_ENV) += env.o | ||
| 33 | lib-$(CONFIG_EXPR) += expr.o | ||
| 34 | lib-$(CONFIG_EXPAND) += expand.o | ||
| 35 | lib-$(CONFIG_FALSE) += false.o | ||
| 36 | lib-$(CONFIG_FOLD) += fold.o | ||
| 37 | lib-$(CONFIG_FSYNC) += fsync.o | ||
| 38 | lib-$(CONFIG_INSTALL) += install.o | ||
| 39 | #lib-$(CONFIG_LENGTH) += length.o | ||
| 40 | lib-$(CONFIG_LN) += ln.o | ||
| 41 | lib-$(CONFIG_LOGNAME) += logname.o | ||
| 42 | lib-$(CONFIG_LS) += ls.o | ||
| 43 | lib-$(CONFIG_FTPD) += ls.o | ||
| 44 | lib-$(CONFIG_MKDIR) += mkdir.o | ||
| 45 | lib-$(CONFIG_MKFIFO) += mkfifo.o | ||
| 46 | lib-$(CONFIG_MKNOD) += mknod.o | ||
| 47 | lib-$(CONFIG_MV) += mv.o | ||
| 48 | lib-$(CONFIG_NICE) += nice.o | ||
| 49 | lib-$(CONFIG_NOHUP) += nohup.o | ||
| 50 | lib-$(CONFIG_OD) += od.o | ||
| 51 | lib-$(CONFIG_PRINTENV) += printenv.o | ||
| 52 | lib-$(CONFIG_PRINTF) += printf.o | ||
| 53 | lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o | 21 | lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o |
| 54 | lib-$(CONFIG_PWD) += pwd.o | ||
| 55 | lib-$(CONFIG_READLINK) += readlink.o | ||
| 56 | lib-$(CONFIG_REALPATH) += realpath.o | ||
| 57 | lib-$(CONFIG_RM) += rm.o | ||
| 58 | lib-$(CONFIG_RMDIR) += rmdir.o | ||
| 59 | lib-$(CONFIG_SEQ) += seq.o | ||
| 60 | lib-$(CONFIG_SLEEP) += sleep.o | ||
| 61 | lib-$(CONFIG_SPLIT) += split.o | ||
| 62 | lib-$(CONFIG_SORT) += sort.o | ||
| 63 | lib-$(CONFIG_STAT) += stat.o | ||
| 64 | lib-$(CONFIG_STTY) += stty.o | ||
| 65 | lib-$(CONFIG_SUM) += sum.o | ||
| 66 | lib-$(CONFIG_TAC) += tac.o | ||
| 67 | lib-$(CONFIG_TEE) += tee.o | ||
| 68 | lib-$(CONFIG_TRUE) += true.o | ||
| 69 | lib-$(CONFIG_TTY) += tty.o | ||
| 70 | lib-$(CONFIG_UNAME) += uname.o | ||
| 71 | lib-$(CONFIG_UNEXPAND) += expand.o | ||
| 72 | lib-$(CONFIG_UNIQ) += uniq.o | ||
| 73 | lib-$(CONFIG_USLEEP) += usleep.o | ||
| 74 | lib-$(CONFIG_UUDECODE) += uudecode.o | ||
| 75 | lib-$(CONFIG_UUENCODE) += uuencode.o | ||
| 76 | lib-$(CONFIG_WC) += wc.o | ||
| 77 | lib-$(CONFIG_WHOAMI) += whoami.o | ||
| 78 | lib-$(CONFIG_YES) += yes.o | ||
diff --git a/coreutils/basename.c b/coreutils/basename.c index ab0c972ed..ace0148c0 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c | |||
| @@ -14,12 +14,6 @@ | |||
| 14 | * 2) Don't check for options, as per SUSv3. | 14 | * 2) Don't check for options, as per SUSv3. |
| 15 | * 3) Save some space by using strcmp(). Calling strncmp() here was silly. | 15 | * 3) Save some space by using strcmp(). Calling strncmp() here was silly. |
| 16 | */ | 16 | */ |
| 17 | |||
| 18 | /* BB_AUDIT SUSv3 compliant */ | ||
| 19 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/basename.html */ | ||
| 20 | |||
| 21 | //kbuild:lib-$(CONFIG_BASENAME) += basename.o | ||
| 22 | |||
| 23 | //config:config BASENAME | 17 | //config:config BASENAME |
| 24 | //config: bool "basename" | 18 | //config: bool "basename" |
| 25 | //config: default y | 19 | //config: default y |
| @@ -28,6 +22,13 @@ | |||
| 28 | //config: leaving just the filename itself. Enable this option if you wish | 22 | //config: leaving just the filename itself. Enable this option if you wish |
| 29 | //config: to enable the 'basename' utility. | 23 | //config: to enable the 'basename' utility. |
| 30 | 24 | ||
| 25 | //applet:IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) | ||
| 26 | |||
| 27 | //kbuild:lib-$(CONFIG_BASENAME) += basename.o | ||
| 28 | |||
| 29 | /* BB_AUDIT SUSv3 compliant */ | ||
| 30 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/basename.html */ | ||
| 31 | |||
| 31 | //usage:#define basename_trivial_usage | 32 | //usage:#define basename_trivial_usage |
| 32 | //usage: "FILE [SUFFIX]" | 33 | //usage: "FILE [SUFFIX]" |
| 33 | //usage:#define basename_full_usage "\n\n" | 34 | //usage:#define basename_full_usage "\n\n" |
diff --git a/coreutils/cal.c b/coreutils/cal.c index 12c46b14f..af02608f0 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c | |||
| @@ -6,17 +6,25 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | ||
| 10 | * | ||
| 11 | * Major size reduction... over 50% (>1.5k) on i386. | ||
| 12 | */ | ||
| 13 | //config:config CAL | ||
| 14 | //config: bool "cal" | ||
| 15 | //config: default y | ||
| 16 | //config: help | ||
| 17 | //config: cal is used to display a monthly calendar. | ||
| 18 | |||
| 19 | //applet:IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 20 | |||
| 21 | //kbuild:lib-$(CONFIG_CAL) += cal.o | ||
| 9 | 22 | ||
| 10 | /* BB_AUDIT SUSv3 compliant with -j and -y extensions (from util-linux). */ | 23 | /* BB_AUDIT SUSv3 compliant with -j and -y extensions (from util-linux). */ |
| 11 | /* BB_AUDIT BUG: The output of 'cal -j 1752' is incorrect. The upstream | 24 | /* BB_AUDIT BUG: The output of 'cal -j 1752' is incorrect. The upstream |
| 12 | * BB_AUDIT BUG: version in util-linux seems to be broken as well. */ | 25 | * BB_AUDIT BUG: version in util-linux seems to be broken as well. */ |
| 13 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cal.html */ | 26 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cal.html */ |
| 14 | 27 | ||
| 15 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | ||
| 16 | * | ||
| 17 | * Major size reduction... over 50% (>1.5k) on i386. | ||
| 18 | */ | ||
| 19 | |||
| 20 | //usage:#define cal_trivial_usage | 28 | //usage:#define cal_trivial_usage |
| 21 | //usage: "[-jy] [[MONTH] YEAR]" | 29 | //usage: "[-jy] [[MONTH] YEAR]" |
| 22 | //usage:#define cal_full_usage "\n\n" | 30 | //usage:#define cal_full_usage "\n\n" |
diff --git a/coreutils/cat.c b/coreutils/cat.c index 00c38d486..65978887e 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c | |||
| @@ -6,15 +6,6 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 compliant */ | ||
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ | ||
| 12 | |||
| 13 | //kbuild:lib-$(CONFIG_CAT) += cat.o | ||
| 14 | //kbuild:lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty | ||
| 15 | //kbuild:lib-$(CONFIG_LESS) += cat.o # less too | ||
| 16 | //kbuild:lib-$(CONFIG_CRONTAB) += cat.o # crontab -l | ||
| 17 | |||
| 18 | //config:config CAT | 9 | //config:config CAT |
| 19 | //config: bool "cat" | 10 | //config: bool "cat" |
| 20 | //config: default y | 11 | //config: default y |
| @@ -22,6 +13,13 @@ | |||
| 22 | //config: cat is used to concatenate files and print them to the standard | 13 | //config: cat is used to concatenate files and print them to the standard |
| 23 | //config: output. Enable this option if you wish to enable the 'cat' utility. | 14 | //config: output. Enable this option if you wish to enable the 'cat' utility. |
| 24 | 15 | ||
| 16 | //applet:IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_CAT) += cat.o | ||
| 19 | |||
| 20 | /* BB_AUDIT SUSv3 compliant */ | ||
| 21 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ | ||
| 22 | |||
| 25 | //usage:#define cat_trivial_usage | 23 | //usage:#define cat_trivial_usage |
| 26 | //usage: "[FILE]..." | 24 | //usage: "[FILE]..." |
| 27 | //usage:#define cat_full_usage "\n\n" | 25 | //usage:#define cat_full_usage "\n\n" |
diff --git a/coreutils/catv.c b/coreutils/catv.c index 0e71368a5..1aeebe1d9 100644 --- a/coreutils/catv.c +++ b/coreutils/catv.c | |||
| @@ -10,6 +10,17 @@ | |||
| 10 | /* See "Cat -v considered harmful" at | 10 | /* See "Cat -v considered harmful" at |
| 11 | * http://cm.bell-labs.com/cm/cs/doc/84/kp.ps.gz */ | 11 | * http://cm.bell-labs.com/cm/cs/doc/84/kp.ps.gz */ |
| 12 | 12 | ||
| 13 | //config:config CATV | ||
| 14 | //config: bool "catv" | ||
| 15 | //config: default y | ||
| 16 | //config: help | ||
| 17 | //config: Display nonprinting characters as escape sequences (like some | ||
| 18 | //config: implementations' cat -v option). | ||
| 19 | |||
| 20 | //applet:IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 21 | |||
| 22 | //kbuild:lib-$(CONFIG_CATV) += catv.o | ||
| 23 | |||
| 13 | //usage:#define catv_trivial_usage | 24 | //usage:#define catv_trivial_usage |
| 14 | //usage: "[-etv] [FILE]..." | 25 | //usage: "[-etv] [FILE]..." |
| 15 | //usage:#define catv_full_usage "\n\n" | 26 | //usage:#define catv_full_usage "\n\n" |
diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c index 7076db62f..8dca63cf7 100644 --- a/coreutils/chgrp.c +++ b/coreutils/chgrp.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config CHGRP | ||
| 10 | //config: bool "chgrp" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: chgrp is used to change the group ownership of files. | ||
| 14 | |||
| 15 | //applet:IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_CHGRP) += chgrp.o chown.o | ||
| 9 | 18 | ||
| 10 | /* BB_AUDIT SUSv3 defects - none? */ | 19 | /* BB_AUDIT SUSv3 defects - none? */ |
| 11 | /* BB_AUDIT GNU defects - unsupported long options. */ | 20 | /* BB_AUDIT GNU defects - unsupported long options. */ |
diff --git a/coreutils/chmod.c b/coreutils/chmod.c index a21c6d501..80913f542 100644 --- a/coreutils/chmod.c +++ b/coreutils/chmod.c | |||
| @@ -9,6 +9,15 @@ | |||
| 9 | * | 9 | * |
| 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 11 | */ | 11 | */ |
| 12 | //config:config CHMOD | ||
| 13 | //config: bool "chmod" | ||
| 14 | //config: default y | ||
| 15 | //config: help | ||
| 16 | //config: chmod is used to change the access permission of files. | ||
| 17 | |||
| 18 | //applet:IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) | ||
| 19 | |||
| 20 | //kbuild:lib-$(CONFIG_CHMOD) += chmod.o | ||
| 12 | 21 | ||
| 13 | /* BB_AUDIT SUSv3 compliant */ | 22 | /* BB_AUDIT SUSv3 compliant */ |
| 14 | /* BB_AUDIT GNU defects - unsupported long options. */ | 23 | /* BB_AUDIT GNU defects - unsupported long options. */ |
diff --git a/coreutils/chown.c b/coreutils/chown.c index 247aa3bf1..50b06d73a 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c | |||
| @@ -6,6 +6,23 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config CHOWN | ||
| 10 | //config: bool "chown" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: chown is used to change the user and/or group ownership | ||
| 14 | //config: of files. | ||
| 15 | //config: | ||
| 16 | //config:config FEATURE_CHOWN_LONG_OPTIONS | ||
| 17 | //config: bool "Enable long options" | ||
| 18 | //config: default y | ||
| 19 | //config: depends on CHOWN && LONG_OPTS | ||
| 20 | //config: help | ||
| 21 | //config: Enable use of long options | ||
| 22 | |||
| 23 | //applet:IF_CHOWN(APPLET_NOEXEC(chown, chown, BB_DIR_BIN, BB_SUID_DROP, chown)) | ||
| 24 | |||
| 25 | //kbuild:lib-$(CONFIG_CHOWN) += chown.o | ||
| 9 | 26 | ||
| 10 | /* BB_AUDIT SUSv3 defects - none? */ | 27 | /* BB_AUDIT SUSv3 defects - none? */ |
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */ | 28 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */ |
diff --git a/coreutils/chroot.c b/coreutils/chroot.c index 633e66b38..5c067c1bd 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c | |||
| @@ -6,6 +6,16 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config CHROOT | ||
| 10 | //config: bool "chroot" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: chroot is used to change the root directory and run a command. | ||
| 14 | //config: The default command is `/bin/sh'. | ||
| 15 | |||
| 16 | //applet:IF_CHROOT(APPLET(chroot, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_CHROOT) += chroot.o | ||
| 9 | 19 | ||
| 10 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | 20 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ |
| 11 | 21 | ||
diff --git a/coreutils/cksum.c b/coreutils/cksum.c index 8a8a39f68..aeec0188d 100644 --- a/coreutils/cksum.c +++ b/coreutils/cksum.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config CKSUM | ||
| 10 | //config: bool "cksum" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: cksum is used to calculate the CRC32 checksum of a file. | ||
| 14 | |||
| 15 | //applet:IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_CKSUM) += cksum.o | ||
| 9 | 18 | ||
| 10 | //usage:#define cksum_trivial_usage | 19 | //usage:#define cksum_trivial_usage |
| 11 | //usage: "FILES..." | 20 | //usage: "FILES..." |
diff --git a/coreutils/comm.c b/coreutils/comm.c index cd450950b..b6a127809 100644 --- a/coreutils/comm.c +++ b/coreutils/comm.c | |||
| @@ -6,6 +6,16 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config COMM | ||
| 10 | //config: bool "comm" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: comm is used to compare two files line by line and return | ||
| 14 | //config: a three-column output. | ||
| 15 | |||
| 16 | //applet:IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_COMM) += comm.o | ||
| 9 | 19 | ||
| 10 | //usage:#define comm_trivial_usage | 20 | //usage:#define comm_trivial_usage |
| 11 | //usage: "[-123] FILE1 FILE2" | 21 | //usage: "[-123] FILE1 FILE2" |
diff --git a/coreutils/cp.c b/coreutils/cp.c index 2630c0d59..4ecdaafda 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c | |||
| @@ -7,13 +7,29 @@ | |||
| 7 | * | 7 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 9 | */ |
| 10 | |||
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cp.html */ | ||
| 12 | |||
| 13 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 10 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 14 | * | 11 | * |
| 15 | * Size reduction. | 12 | * Size reduction. |
| 16 | */ | 13 | */ |
| 14 | //config:config CP | ||
| 15 | //config: bool "cp" | ||
| 16 | //config: default y | ||
| 17 | //config: help | ||
| 18 | //config: cp is used to copy files and directories. | ||
| 19 | //config: | ||
| 20 | //config:config FEATURE_CP_LONG_OPTIONS | ||
| 21 | //config: bool "Enable long options for cp" | ||
| 22 | //config: default y | ||
| 23 | //config: depends on CP && LONG_OPTS | ||
| 24 | //config: help | ||
| 25 | //config: Enable long options for cp. | ||
| 26 | //config: Also add support for --parents option. | ||
| 27 | |||
| 28 | //applet:IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) | ||
| 29 | |||
| 30 | //kbuild:lib-$(CONFIG_CP) += cp.o | ||
| 31 | |||
| 32 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cp.html */ | ||
| 17 | 33 | ||
| 18 | //usage:#define cp_trivial_usage | 34 | //usage:#define cp_trivial_usage |
| 19 | //usage: "[OPTIONS] SOURCE... DEST" | 35 | //usage: "[OPTIONS] SOURCE... DEST" |
diff --git a/coreutils/cut.c b/coreutils/cut.c index 84449c775..a33a825f8 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
| @@ -8,6 +8,16 @@ | |||
| 8 | * | 8 | * |
| 9 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 9 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 10 | */ | 10 | */ |
| 11 | //config:config CUT | ||
| 12 | //config: bool "cut" | ||
| 13 | //config: default y | ||
| 14 | //config: help | ||
| 15 | //config: cut is used to print selected parts of lines from | ||
| 16 | //config: each file to stdout. | ||
| 17 | |||
| 18 | //applet:IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut)) | ||
| 19 | |||
| 20 | //kbuild:lib-$(CONFIG_CUT) += cut.o | ||
| 11 | 21 | ||
| 12 | //usage:#define cut_trivial_usage | 22 | //usage:#define cut_trivial_usage |
| 13 | //usage: "[OPTIONS] [FILE]..." | 23 | //usage: "[OPTIONS] [FILE]..." |
diff --git a/coreutils/date.c b/coreutils/date.c index ff3214d85..9d4a7dfea 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
| @@ -8,8 +8,7 @@ | |||
| 8 | * bugfixes and cleanup by Bernhard Reutner-Fischer | 8 | * bugfixes and cleanup by Bernhard Reutner-Fischer |
| 9 | * | 9 | * |
| 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 11 | */ | 11 | */ |
| 12 | |||
| 13 | /* This 'date' command supports only 2 time setting formats, | 12 | /* This 'date' command supports only 2 time setting formats, |
| 14 | all the GNU strftime stuff (its in libc, lets use it), | 13 | all the GNU strftime stuff (its in libc, lets use it), |
| 15 | setting time using UTC and displaying it, as well as | 14 | setting time using UTC and displaying it, as well as |
| @@ -19,10 +18,6 @@ | |||
| 19 | /* Input parsing code is always bulky - used heavy duty libc stuff as | 18 | /* Input parsing code is always bulky - used heavy duty libc stuff as |
| 20 | much as possible, missed out a lot of bounds checking */ | 19 | much as possible, missed out a lot of bounds checking */ |
| 21 | 20 | ||
| 22 | //applet:IF_DATE(APPLET(date, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 23 | |||
| 24 | //kbuild:lib-$(CONFIG_DATE) += date.o | ||
| 25 | |||
| 26 | //config:config DATE | 21 | //config:config DATE |
| 27 | //config: bool "date" | 22 | //config: bool "date" |
| 28 | //config: default y | 23 | //config: default y |
| @@ -63,6 +58,10 @@ | |||
| 63 | //config: the same format. With it on, 'date DATE' additionally supports | 58 | //config: the same format. With it on, 'date DATE' additionally supports |
| 64 | //config: MMDDhhmm[[YY]YY][.ss] format. | 59 | //config: MMDDhhmm[[YY]YY][.ss] format. |
| 65 | 60 | ||
| 61 | //applet:IF_DATE(APPLET(date, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 62 | |||
| 63 | //kbuild:lib-$(CONFIG_DATE) += date.o | ||
| 64 | |||
| 66 | /* GNU coreutils 6.9 man page: | 65 | /* GNU coreutils 6.9 man page: |
| 67 | * date [OPTION]... [+FORMAT] | 66 | * date [OPTION]... [+FORMAT] |
| 68 | * date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]] | 67 | * date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]] |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 00139773e..8c144cfd2 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
| @@ -2,12 +2,10 @@ | |||
| 2 | /* | 2 | /* |
| 3 | * Mini dd implementation for busybox | 3 | * Mini dd implementation for busybox |
| 4 | * | 4 | * |
| 5 | * | ||
| 6 | * Copyright (C) 2000,2001 Matt Kraai | 5 | * Copyright (C) 2000,2001 Matt Kraai |
| 7 | * | 6 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 8 | */ |
| 10 | |||
| 11 | //config:config DD | 9 | //config:config DD |
| 12 | //config: bool "dd" | 10 | //config: bool "dd" |
| 13 | //config: default y | 11 | //config: default y |
| @@ -53,6 +51,10 @@ | |||
| 53 | //config: help | 51 | //config: help |
| 54 | //config: Enables support for status=noxfer/none option. | 52 | //config: Enables support for status=noxfer/none option. |
| 55 | 53 | ||
| 54 | //applet:IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) | ||
| 55 | |||
| 56 | //kbuild:lib-$(CONFIG_DD) += dd.o | ||
| 57 | |||
| 56 | //usage:#define dd_trivial_usage | 58 | //usage:#define dd_trivial_usage |
| 57 | //usage: "[if=FILE] [of=FILE] " IF_FEATURE_DD_IBS_OBS("[ibs=N] [obs=N] ") "[bs=N] [count=N] [skip=N]\n" | 59 | //usage: "[if=FILE] [of=FILE] " IF_FEATURE_DD_IBS_OBS("[ibs=N] [obs=N] ") "[bs=N] [count=N] [skip=N]\n" |
| 58 | //usage: " [seek=N]" IF_FEATURE_DD_IBS_OBS(" [conv=notrunc|noerror|sync|fsync] [iflag=skip_bytes]") | 60 | //usage: " [seek=N]" IF_FEATURE_DD_IBS_OBS(" [conv=notrunc|noerror|sync|fsync] [iflag=skip_bytes]") |
diff --git a/coreutils/df.c b/coreutils/df.c index 06b292018..fdcdae675 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
| @@ -7,10 +7,6 @@ | |||
| 7 | * | 7 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 9 | */ |
| 10 | |||
| 11 | /* BB_AUDIT SUSv3 _NOT_ compliant -- option -t missing. */ | ||
| 12 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/df.html */ | ||
| 13 | |||
| 14 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 10 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 15 | * | 11 | * |
| 16 | * Size reduction. Removed floating point dependency. Added error checking | 12 | * Size reduction. Removed floating point dependency. Added error checking |
| @@ -21,6 +17,30 @@ | |||
| 21 | * | 17 | * |
| 22 | * Implement -P and -B; better coreutils compat; cleanup | 18 | * Implement -P and -B; better coreutils compat; cleanup |
| 23 | */ | 19 | */ |
| 20 | //config:config DF | ||
| 21 | //config: bool "df" | ||
| 22 | //config: default y | ||
| 23 | //config: help | ||
| 24 | //config: df reports the amount of disk space used and available | ||
| 25 | //config: on filesystems. | ||
| 26 | //config: | ||
| 27 | //config:config FEATURE_DF_FANCY | ||
| 28 | //config: bool "Enable -a, -i, -B" | ||
| 29 | //config: default y | ||
| 30 | //config: depends on DF | ||
| 31 | //config: help | ||
| 32 | //config: This option enables -a, -i and -B. | ||
| 33 | //config: | ||
| 34 | //config: -a Show all filesystems | ||
| 35 | //config: -i Inodes | ||
| 36 | //config: -B <SIZE> Blocksize | ||
| 37 | |||
| 38 | //applet:IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 39 | |||
| 40 | //kbuild:lib-$(CONFIG_DF) += df.o | ||
| 41 | |||
| 42 | /* BB_AUDIT SUSv3 _NOT_ compliant -- option -t missing. */ | ||
| 43 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/df.html */ | ||
| 24 | 44 | ||
| 25 | //usage:#define df_trivial_usage | 45 | //usage:#define df_trivial_usage |
| 26 | //usage: "[-Pk" | 46 | //usage: "[-Pk" |
diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 101067c90..659381886 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c | |||
| @@ -6,6 +6,16 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config DIRNAME | ||
| 10 | //config: bool "dirname" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: dirname is used to strip a non-directory suffix from | ||
| 14 | //config: a file name. | ||
| 15 | |||
| 16 | //applet:IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_DIRNAME) += dirname.o | ||
| 9 | 19 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 20 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */ | 21 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */ |
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index ccb74a113..6d2347163 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c | |||
| @@ -10,7 +10,26 @@ | |||
| 10 | * dos2unix filters reading input from stdin and writing output to stdout. | 10 | * dos2unix filters reading input from stdin and writing output to stdout. |
| 11 | * | 11 | * |
| 12 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 12 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 13 | */ | 13 | */ |
| 14 | //config:config DOS2UNIX | ||
| 15 | //config: bool "dos2unix" | ||
| 16 | //config: default y | ||
| 17 | //config: help | ||
| 18 | //config: dos2unix is used to convert a text file from DOS format to | ||
| 19 | //config: UNIX format, and vice versa. | ||
| 20 | //config: | ||
| 21 | //config:config UNIX2DOS | ||
| 22 | //config: bool "unix2dos" | ||
| 23 | //config: default y | ||
| 24 | //config: help | ||
| 25 | //config: unix2dos is used to convert a text file from UNIX format to | ||
| 26 | //config: DOS format, and vice versa. | ||
| 27 | |||
| 28 | //applet:IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) | ||
| 29 | //applet:IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) | ||
| 30 | |||
| 31 | //kbuild:lib-$(CONFIG_DOS2UNIX) += dos2unix.o | ||
| 32 | //kbuild:lib-$(CONFIG_UNIX2DOS) += dos2unix.o | ||
| 14 | 33 | ||
| 15 | //usage:#define dos2unix_trivial_usage | 34 | //usage:#define dos2unix_trivial_usage |
| 16 | //usage: "[-ud] [FILE]" | 35 | //usage: "[-ud] [FILE]" |
| @@ -92,9 +111,12 @@ int dos2unix_main(int argc UNUSED_PARAM, char **argv) | |||
| 92 | int o, conv_type; | 111 | int o, conv_type; |
| 93 | 112 | ||
| 94 | /* See if we are supposed to be doing dos2unix or unix2dos */ | 113 | /* See if we are supposed to be doing dos2unix or unix2dos */ |
| 95 | conv_type = CT_UNIX2DOS; | 114 | if (ENABLE_DOS2UNIX |
| 96 | if (applet_name[0] == 'd') { | 115 | && (!ENABLE_UNIX2DOS || applet_name[0] == 'd') |
| 116 | ) { | ||
| 97 | conv_type = CT_DOS2UNIX; | 117 | conv_type = CT_DOS2UNIX; |
| 118 | } else { | ||
| 119 | conv_type = CT_UNIX2DOS; | ||
| 98 | } | 120 | } |
| 99 | 121 | ||
| 100 | /* -u convert to unix, -d convert to dos */ | 122 | /* -u convert to unix, -d convert to dos */ |
diff --git a/coreutils/du.c b/coreutils/du.c index 5f104736b..03e31a0e4 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
| @@ -8,10 +8,6 @@ | |||
| 8 | * | 8 | * |
| 9 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 9 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 10 | */ | 10 | */ |
| 11 | |||
| 12 | /* BB_AUDIT SUSv3 compliant (unless default blocksize set to 1k) */ | ||
| 13 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/du.html */ | ||
| 14 | |||
| 15 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 11 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 16 | * | 12 | * |
| 17 | * Mostly rewritten for SUSv3 compliance and to fix bugs/defects. | 13 | * Mostly rewritten for SUSv3 compliance and to fix bugs/defects. |
| @@ -22,6 +18,26 @@ | |||
| 22 | * 3) Added error checking of output. | 18 | * 3) Added error checking of output. |
| 23 | * 4) Fixed busybox bug #1284 involving long overflow with human_readable. | 19 | * 4) Fixed busybox bug #1284 involving long overflow with human_readable. |
| 24 | */ | 20 | */ |
| 21 | //config:config DU | ||
| 22 | //config: bool "du (default blocksize of 512 bytes)" | ||
| 23 | //config: default y | ||
| 24 | //config: help | ||
| 25 | //config: du is used to report the amount of disk space used | ||
| 26 | //config: for specified files. | ||
| 27 | //config: | ||
| 28 | //config:config FEATURE_DU_DEFAULT_BLOCKSIZE_1K | ||
| 29 | //config: bool "Use a default blocksize of 1024 bytes (1K)" | ||
| 30 | //config: default y | ||
| 31 | //config: depends on DU | ||
| 32 | //config: help | ||
| 33 | //config: Use a blocksize of (1K) instead of the default 512b. | ||
| 34 | |||
| 35 | //applet:IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 36 | |||
| 37 | //kbuild:lib-$(CONFIG_DU) += du.o | ||
| 38 | |||
| 39 | /* BB_AUDIT SUSv3 compliant (unless default blocksize set to 1k) */ | ||
| 40 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/du.html */ | ||
| 25 | 41 | ||
| 26 | //usage:#define du_trivial_usage | 42 | //usage:#define du_trivial_usage |
| 27 | //usage: "[-aHLdclsx" IF_FEATURE_HUMAN_READABLE("hm") "k] [FILE]..." | 43 | //usage: "[-aHLdclsx" IF_FEATURE_HUMAN_READABLE("hm") "k] [FILE]..." |
diff --git a/coreutils/echo.c b/coreutils/echo.c index 1c4174559..fd0d9b780 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
| @@ -9,10 +9,6 @@ | |||
| 9 | * | 9 | * |
| 10 | * Original copyright notice is retained at the end of this file. | 10 | * Original copyright notice is retained at the end of this file. |
| 11 | */ | 11 | */ |
| 12 | |||
| 13 | /* BB_AUDIT SUSv3 compliant -- unless configured as fancy echo. */ | ||
| 14 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html */ | ||
| 15 | |||
| 16 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 12 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 17 | * | 13 | * |
| 18 | * Because of behavioral differences, implemented configurable SUSv3 | 14 | * Because of behavioral differences, implemented configurable SUSv3 |
| @@ -22,6 +18,26 @@ | |||
| 22 | * 2) SUSv3 specifies that octal escapes are of the form \0{#{#{#}}}. | 18 | * 2) SUSv3 specifies that octal escapes are of the form \0{#{#{#}}}. |
| 23 | * The previous version did not allow 4-digit octals. | 19 | * The previous version did not allow 4-digit octals. |
| 24 | */ | 20 | */ |
| 21 | //config:config ECHO | ||
| 22 | //config: bool "echo (basic SuSv3 version taking no options)" | ||
| 23 | //config: default y | ||
| 24 | //config: help | ||
| 25 | //config: echo is used to print a specified string to stdout. | ||
| 26 | //config: | ||
| 27 | //config:# this entry also appears in shell/Config.in, next to the echo builtin | ||
| 28 | //config:config FEATURE_FANCY_ECHO | ||
| 29 | //config: bool "Enable echo options (-n and -e)" | ||
| 30 | //config: default y | ||
| 31 | //config: depends on ECHO || ASH_BUILTIN_ECHO || HUSH | ||
| 32 | //config: help | ||
| 33 | //config: This adds options (-n and -e) to echo. | ||
| 34 | |||
| 35 | //applet:IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) | ||
| 36 | |||
| 37 | //kbuild:lib-$(CONFIG_ECHO) += echo.o | ||
| 38 | |||
| 39 | /* BB_AUDIT SUSv3 compliant -- unless configured as fancy echo. */ | ||
| 40 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html */ | ||
| 25 | 41 | ||
| 26 | //usage:#define echo_trivial_usage | 42 | //usage:#define echo_trivial_usage |
| 27 | //usage: IF_FEATURE_FANCY_ECHO("[-neE] ") "[ARG]..." | 43 | //usage: IF_FEATURE_FANCY_ECHO("[-neE] ") "[ARG]..." |
diff --git a/coreutils/env.c b/coreutils/env.c index cdfc30e14..e91eddb5c 100644 --- a/coreutils/env.c +++ b/coreutils/env.c | |||
| @@ -11,16 +11,11 @@ | |||
| 11 | * | 11 | * |
| 12 | * Modified for BusyBox by Erik Andersen <andersen@codepoet.org> | 12 | * Modified for BusyBox by Erik Andersen <andersen@codepoet.org> |
| 13 | */ | 13 | */ |
| 14 | |||
| 15 | /* BB_AUDIT SUSv3 compliant */ | ||
| 16 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/env.html */ | ||
| 17 | |||
| 18 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 14 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 19 | * | 15 | * |
| 20 | * Fixed bug involving exit return codes if execvp fails. Also added | 16 | * Fixed bug involving exit return codes if execvp fails. Also added |
| 21 | * output error checking. | 17 | * output error checking. |
| 22 | */ | 18 | */ |
| 23 | |||
| 24 | /* | 19 | /* |
| 25 | * Modified by Vladimir Oleynik <dzo@simtreas.ru> (C) 2003 | 20 | * Modified by Vladimir Oleynik <dzo@simtreas.ru> (C) 2003 |
| 26 | * - correct "-" option usage | 21 | * - correct "-" option usage |
| @@ -28,8 +23,27 @@ | |||
| 28 | * - GNU long option support | 23 | * - GNU long option support |
| 29 | * - use xfunc_error_retval | 24 | * - use xfunc_error_retval |
| 30 | */ | 25 | */ |
| 26 | //config:config ENV | ||
| 27 | //config: bool "env" | ||
| 28 | //config: default y | ||
| 29 | //config: help | ||
| 30 | //config: env is used to set an environment variable and run | ||
| 31 | //config: a command; without options it displays the current | ||
| 32 | //config: environment. | ||
| 33 | //config: | ||
| 34 | //config:config FEATURE_ENV_LONG_OPTIONS | ||
| 35 | //config: bool "Enable long options" | ||
| 36 | //config: default y | ||
| 37 | //config: depends on ENV && LONG_OPTS | ||
| 38 | //config: help | ||
| 39 | //config: Support long options for the env applet. | ||
| 31 | 40 | ||
| 32 | /* This is a NOEXEC applet. Be very careful! */ | 41 | //applet:IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) |
| 42 | |||
| 43 | //kbuild:lib-$(CONFIG_ENV) += env.o | ||
| 44 | |||
| 45 | /* BB_AUDIT SUSv3 compliant */ | ||
| 46 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/env.html */ | ||
| 33 | 47 | ||
| 34 | //usage:#define env_trivial_usage | 48 | //usage:#define env_trivial_usage |
| 35 | //usage: "[-iu] [-] [name=value]... [PROG ARGS]" | 49 | //usage: "[-iu] [-] [name=value]... [PROG ARGS]" |
diff --git a/coreutils/expand.c b/coreutils/expand.c index 8d376ff4e..bb59af46d 100644 --- a/coreutils/expand.c +++ b/coreutils/expand.c | |||
| @@ -20,6 +20,37 @@ | |||
| 20 | * | 20 | * |
| 21 | * Caveat: this versions of expand and unexpand don't accept tab lists. | 21 | * Caveat: this versions of expand and unexpand don't accept tab lists. |
| 22 | */ | 22 | */ |
| 23 | //config:config EXPAND | ||
| 24 | //config: bool "expand" | ||
| 25 | //config: default y | ||
| 26 | //config: help | ||
| 27 | //config: By default, convert all tabs to spaces. | ||
| 28 | //config: | ||
| 29 | //config:config FEATURE_EXPAND_LONG_OPTIONS | ||
| 30 | //config: bool "Enable long options" | ||
| 31 | //config: default y | ||
| 32 | //config: depends on EXPAND && LONG_OPTS | ||
| 33 | //config: help | ||
| 34 | //config: Support long options for the expand applet. | ||
| 35 | //config: | ||
| 36 | //config:config UNEXPAND | ||
| 37 | //config: bool "unexpand" | ||
| 38 | //config: default y | ||
| 39 | //config: help | ||
| 40 | //config: By default, convert only leading sequences of blanks to tabs. | ||
| 41 | //config: | ||
| 42 | //config:config FEATURE_UNEXPAND_LONG_OPTIONS | ||
| 43 | //config: bool "Enable long options" | ||
| 44 | //config: default y | ||
| 45 | //config: depends on UNEXPAND && LONG_OPTS | ||
| 46 | //config: help | ||
| 47 | //config: Support long options for the unexpand applet. | ||
| 48 | |||
| 49 | //applet:IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 50 | //applet:IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) | ||
| 51 | |||
| 52 | //kbuild:lib-$(CONFIG_EXPAND) += expand.o | ||
| 53 | //kbuild:lib-$(CONFIG_UNEXPAND) += expand.o | ||
| 23 | 54 | ||
| 24 | //usage:#define expand_trivial_usage | 55 | //usage:#define expand_trivial_usage |
| 25 | //usage: "[-i] [-t N] [FILE]..." | 56 | //usage: "[-i] [-t N] [FILE]..." |
diff --git a/coreutils/expr.c b/coreutils/expr.c index efc435443..5d2fbf2f7 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | * | 13 | * |
| 14 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 14 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 15 | */ | 15 | */ |
| 16 | |||
| 17 | /* This program evaluates expressions. Each token (operator, operand, | 16 | /* This program evaluates expressions. Each token (operator, operand, |
| 18 | * parenthesis) of the expression must be a separate argument. The | 17 | * parenthesis) of the expression must be a separate argument. The |
| 19 | * parser used is a reasonably general one, though any incarnation of | 18 | * parser used is a reasonably general one, though any incarnation of |
| @@ -21,9 +20,27 @@ | |||
| 21 | * | 20 | * |
| 22 | * No parse tree is needed; a new node is evaluated immediately. | 21 | * No parse tree is needed; a new node is evaluated immediately. |
| 23 | * One function can handle multiple operators all of equal precedence, | 22 | * One function can handle multiple operators all of equal precedence, |
| 24 | * provided they all associate ((x op x) op x). */ | 23 | * provided they all associate ((x op x) op x). |
| 25 | 24 | */ | |
| 26 | /* no getopt needed */ | 25 | //config:config EXPR |
| 26 | //config: bool "expr" | ||
| 27 | //config: default y | ||
| 28 | //config: help | ||
| 29 | //config: expr is used to calculate numbers and print the result | ||
| 30 | //config: to standard output. | ||
| 31 | //config: | ||
| 32 | //config:config EXPR_MATH_SUPPORT_64 | ||
| 33 | //config: bool "Extend Posix numbers support to 64 bit" | ||
| 34 | //config: default y | ||
| 35 | //config: depends on EXPR | ||
| 36 | //config: help | ||
| 37 | //config: Enable 64-bit math support in the expr applet. This will make | ||
| 38 | //config: the applet slightly larger, but will allow computation with very | ||
| 39 | //config: large numbers. | ||
| 40 | |||
| 41 | //applet:IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 42 | |||
| 43 | //kbuild:lib-$(CONFIG_EXPR) += expr.o | ||
| 27 | 44 | ||
| 28 | //usage:#define expr_trivial_usage | 45 | //usage:#define expr_trivial_usage |
| 29 | //usage: "EXPRESSION" | 46 | //usage: "EXPRESSION" |
diff --git a/coreutils/false.c b/coreutils/false.c index 0591a6cdc..b8f17c6a6 100644 --- a/coreutils/false.c +++ b/coreutils/false.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config FALSE | ||
| 10 | //config: bool "false" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: false returns an exit code of FALSE (1). | ||
| 14 | |||
| 15 | //applet:IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_FALSE) += false.o | ||
| 9 | 18 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 19 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/000095399/utilities/false.html */ | 20 | /* http://www.opengroup.org/onlinepubs/000095399/utilities/false.html */ |
diff --git a/coreutils/fold.c b/coreutils/fold.c index 0e7306377..01f9bce74 100644 --- a/coreutils/fold.c +++ b/coreutils/fold.c | |||
| @@ -9,6 +9,15 @@ | |||
| 9 | 9 | ||
| 10 | Licensed under GPLv2 or later, see file LICENSE in this source tree. | 10 | Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 11 | */ | 11 | */ |
| 12 | //config:config FOLD | ||
| 13 | //config: bool "fold" | ||
| 14 | //config: default y | ||
| 15 | //config: help | ||
| 16 | //config: Wrap text to fit a specific width. | ||
| 17 | |||
| 18 | //applet:IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) | ||
| 19 | |||
| 20 | //kbuild:lib-$(CONFIG_FOLD) += fold.o | ||
| 12 | 21 | ||
| 13 | //usage:#define fold_trivial_usage | 22 | //usage:#define fold_trivial_usage |
| 14 | //usage: "[-bs] [-w WIDTH] [FILE]..." | 23 | //usage: "[-bs] [-w WIDTH] [FILE]..." |
diff --git a/coreutils/fsync.c b/coreutils/fsync.c index 652a41c33..596a2bcaf 100644 --- a/coreutils/fsync.c +++ b/coreutils/fsync.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config FSYNC | ||
| 10 | //config: bool "fsync" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: fsync is used to flush file-related cached blocks to disk. | ||
| 14 | |||
| 15 | //applet:IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_FSYNC) += fsync.o | ||
| 9 | 18 | ||
| 10 | //usage:#define fsync_trivial_usage | 19 | //usage:#define fsync_trivial_usage |
| 11 | //usage: "[-d] FILE..." | 20 | //usage: "[-d] FILE..." |
diff --git a/coreutils/head.c b/coreutils/head.c index 9388b026a..176e91e3a 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
| @@ -6,13 +6,28 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config HEAD | ||
| 10 | //config: bool "head" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: head is used to print the first specified number of lines | ||
| 14 | //config: from files. | ||
| 15 | //config: | ||
| 16 | //config:config FEATURE_FANCY_HEAD | ||
| 17 | //config: bool "Enable head options (-c, -q, and -v)" | ||
| 18 | //config: default y | ||
| 19 | //config: depends on HEAD | ||
| 20 | //config: help | ||
| 21 | //config: This enables the head options (-c, -q, and -v). | ||
| 22 | |||
| 23 | //applet:IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) | ||
| 24 | |||
| 25 | //kbuild:lib-$(CONFIG_HEAD) += head.o | ||
| 9 | 26 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 27 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */ | 28 | /* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */ |
| 12 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/head.html */ | 29 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/head.html */ |
| 13 | 30 | ||
| 14 | //kbuild:lib-$(CONFIG_HEAD) += head.o | ||
| 15 | |||
| 16 | //usage:#define head_trivial_usage | 31 | //usage:#define head_trivial_usage |
| 17 | //usage: "[OPTIONS] [FILE]..." | 32 | //usage: "[OPTIONS] [FILE]..." |
| 18 | //usage:#define head_full_usage "\n\n" | 33 | //usage:#define head_full_usage "\n\n" |
diff --git a/coreutils/hostid.c b/coreutils/hostid.c index e5b1f5188..5b47de1bc 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c | |||
| @@ -6,9 +6,6 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | ||
| 11 | |||
| 12 | //config:config HOSTID | 9 | //config:config HOSTID |
| 13 | //config: bool "hostid" | 10 | //config: bool "hostid" |
| 14 | //config: default y | 11 | //config: default y |
| @@ -20,6 +17,8 @@ | |||
| 20 | 17 | ||
| 21 | //kbuild:lib-$(CONFIG_HOSTID) += hostid.o | 18 | //kbuild:lib-$(CONFIG_HOSTID) += hostid.o |
| 22 | 19 | ||
| 20 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | ||
| 21 | |||
| 23 | //usage:#define hostid_trivial_usage | 22 | //usage:#define hostid_trivial_usage |
| 24 | //usage: "" | 23 | //usage: "" |
| 25 | //usage:#define hostid_full_usage "\n\n" | 24 | //usage:#define hostid_full_usage "\n\n" |
diff --git a/coreutils/id.c b/coreutils/id.c index 1f3e1c4c2..ab7ac1e55 100644 --- a/coreutils/id.c +++ b/coreutils/id.c | |||
| @@ -7,31 +7,30 @@ | |||
| 7 | * | 7 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 9 | */ |
| 10 | |||
| 11 | /* BB_AUDIT SUSv3 compliant. */ | ||
| 12 | /* Hacked by Tito Ragusa (C) 2004 to handle usernames of whatever | 10 | /* Hacked by Tito Ragusa (C) 2004 to handle usernames of whatever |
| 13 | * length and to be more similar to GNU id. | 11 | * length and to be more similar to GNU id. |
| 14 | * -Z option support: by Yuichi Nakamura <ynakam@hitachisoft.jp> | 12 | * -Z option support: by Yuichi Nakamura <ynakam@hitachisoft.jp> |
| 15 | * Added -G option Tito Ragusa (C) 2008 for SUSv3. | 13 | * Added -G option Tito Ragusa (C) 2008 for SUSv3. |
| 16 | */ | 14 | */ |
| 17 | |||
| 18 | //config:config ID | 15 | //config:config ID |
| 19 | //config: bool "id" | 16 | //config: bool "id" |
| 20 | //config: default y | 17 | //config: default y |
| 21 | //config: help | 18 | //config: help |
| 22 | //config: id displays the current user and group ID names. | 19 | //config: id displays the current user and group ID names. |
| 23 | 20 | //config: | |
| 24 | //config:config GROUPS | 21 | //config:config GROUPS |
| 25 | //config: bool "groups" | 22 | //config: bool "groups" |
| 26 | //config: default y | 23 | //config: default y |
| 27 | //config: help | 24 | //config: help |
| 28 | //config: Print the group names associated with current user id. | 25 | //config: Print the group names associated with current user id. |
| 29 | 26 | ||
| 27 | //applet:IF_GROUPS(APPLET_NOEXEC(groups, id, BB_DIR_USR_BIN, BB_SUID_DROP, groups)) | ||
| 28 | //applet:IF_ID( APPLET_NOEXEC(id, id, BB_DIR_USR_BIN, BB_SUID_DROP, id )) | ||
| 29 | |||
| 30 | //kbuild:lib-$(CONFIG_GROUPS) += id.o | 30 | //kbuild:lib-$(CONFIG_GROUPS) += id.o |
| 31 | //kbuild:lib-$(CONFIG_ID) += id.o | 31 | //kbuild:lib-$(CONFIG_ID) += id.o |
| 32 | 32 | ||
| 33 | //applet:IF_GROUPS(APPLET_NOEXEC(groups, id, BB_DIR_USR_BIN, BB_SUID_DROP, groups)) | 33 | /* BB_AUDIT SUSv3 compliant. */ |
| 34 | //applet:IF_ID( APPLET_NOEXEC(id, id, BB_DIR_USR_BIN, BB_SUID_DROP, id )) | ||
| 35 | 34 | ||
| 36 | //usage:#define id_trivial_usage | 35 | //usage:#define id_trivial_usage |
| 37 | //usage: "[OPTIONS] [USER]" | 36 | //usage: "[OPTIONS] [USER]" |
diff --git a/coreutils/install.c b/coreutils/install.c index 8aa51cc34..e68589229 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
| @@ -5,6 +5,22 @@ | |||
| 5 | * | 5 | * |
| 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 7 | */ | 7 | */ |
| 8 | //config:config INSTALL | ||
| 9 | //config: bool "install" | ||
| 10 | //config: default y | ||
| 11 | //config: help | ||
| 12 | //config: Copy files and set attributes. | ||
| 13 | //config: | ||
| 14 | //config:config FEATURE_INSTALL_LONG_OPTIONS | ||
| 15 | //config: bool "Enable long options" | ||
| 16 | //config: default y | ||
| 17 | //config: depends on INSTALL && LONG_OPTS | ||
| 18 | //config: help | ||
| 19 | //config: Support long options for the install applet. | ||
| 20 | |||
| 21 | //applet:IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 22 | |||
| 23 | //kbuild:lib-$(CONFIG_INSTALL) += install.o | ||
| 8 | 24 | ||
| 9 | /* -v, -b, -c are ignored */ | 25 | /* -v, -b, -c are ignored */ |
| 10 | //usage:#define install_trivial_usage | 26 | //usage:#define install_trivial_usage |
diff --git a/coreutils/length.c.disabled b/coreutils/length.c.disabled deleted file mode 100644 index aee898d22..000000000 --- a/coreutils/length.c.disabled +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | ||
| 2 | /* | ||
| 3 | * Licensed under GPLv2, see file LICENSE in this source tree. | ||
| 4 | */ | ||
| 5 | |||
| 6 | /* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ | ||
| 7 | |||
| 8 | //usage:#define length_trivial_usage | ||
| 9 | //usage: "STRING" | ||
| 10 | //usage:#define length_full_usage "\n\n" | ||
| 11 | //usage: "Print STRING's length" | ||
| 12 | //usage: | ||
| 13 | //usage:#define length_example_usage | ||
| 14 | //usage: "$ length Hello\n" | ||
| 15 | //usage: "5\n" | ||
| 16 | |||
| 17 | #include "libbb.h" | ||
| 18 | |||
| 19 | /* This is a NOFORK applet. Be very careful! */ | ||
| 20 | |||
| 21 | int length_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | ||
| 22 | int length_main(int argc, char **argv) | ||
| 23 | { | ||
| 24 | if ((argc != 2) || (**(++argv) == '-')) { | ||
| 25 | bb_show_usage(); | ||
| 26 | } | ||
| 27 | |||
| 28 | printf("%u\n", (unsigned)strlen(*argv)); | ||
| 29 | |||
| 30 | return fflush_all(); | ||
| 31 | } | ||
diff --git a/coreutils/ln.c b/coreutils/ln.c index 168814801..0e2abace4 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config LN | ||
| 10 | //config: bool "ln" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: ln is used to create hard or soft links between files. | ||
| 14 | |||
| 15 | //applet:IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_LN) += ln.o | ||
| 9 | 18 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 19 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* BB_AUDIT GNU options missing: -d, -F, -i, and -v. */ | 20 | /* BB_AUDIT GNU options missing: -d, -F, -i, and -v. */ |
diff --git a/coreutils/logname.c b/coreutils/logname.c index 10b9615a1..a9b1c956d 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c | |||
| @@ -6,10 +6,6 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 compliant */ | ||
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/logname.html */ | ||
| 12 | |||
| 13 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 14 | * | 10 | * |
| 15 | * SUSv3 specifies the string used is that returned from getlogin(). | 11 | * SUSv3 specifies the string used is that returned from getlogin(). |
| @@ -19,6 +15,18 @@ | |||
| 19 | * correct course of action wrt SUSv3 for a failing getlogin() is | 15 | * correct course of action wrt SUSv3 for a failing getlogin() is |
| 20 | * a diagnostic message and an error return. | 16 | * a diagnostic message and an error return. |
| 21 | */ | 17 | */ |
| 18 | //config:config LOGNAME | ||
| 19 | //config: bool "logname" | ||
| 20 | //config: default y | ||
| 21 | //config: help | ||
| 22 | //config: logname is used to print the current user's login name. | ||
| 23 | |||
| 24 | //applet:IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) | ||
| 25 | |||
| 26 | //kbuild:lib-$(CONFIG_LOGNAME) += logname.o | ||
| 27 | |||
| 28 | /* BB_AUDIT SUSv3 compliant */ | ||
| 29 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/logname.html */ | ||
| 22 | 30 | ||
| 23 | //usage:#define logname_trivial_usage | 31 | //usage:#define logname_trivial_usage |
| 24 | //usage: "" | 32 | //usage: "" |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 344b4e61e..0f35c70d5 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | * | 4 | * |
| 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 6 | */ | 6 | */ |
| 7 | |||
| 8 | /* [date unknown. Perhaps before year 2000] | 7 | /* [date unknown. Perhaps before year 2000] |
| 9 | * To achieve a small memory footprint, this version of 'ls' doesn't do any | 8 | * To achieve a small memory footprint, this version of 'ls' doesn't do any |
| 10 | * file sorting, and only has the most essential command line switches | 9 | * file sorting, and only has the most essential command line switches |
| @@ -28,6 +27,75 @@ | |||
| 28 | * [2009-03] | 27 | * [2009-03] |
| 29 | * ls sorts listing now, and supports almost all options. | 28 | * ls sorts listing now, and supports almost all options. |
| 30 | */ | 29 | */ |
| 30 | //config:config LS | ||
| 31 | //config: bool "ls" | ||
| 32 | //config: default y | ||
| 33 | //config: help | ||
| 34 | //config: ls is used to list the contents of directories. | ||
| 35 | //config: | ||
| 36 | //config:config FEATURE_LS_FILETYPES | ||
| 37 | //config: bool "Enable filetyping options (-p and -F)" | ||
| 38 | //config: default y | ||
| 39 | //config: depends on LS | ||
| 40 | //config: help | ||
| 41 | //config: Enable the ls options (-p and -F). | ||
| 42 | //config: | ||
| 43 | //config:config FEATURE_LS_FOLLOWLINKS | ||
| 44 | //config: bool "Enable symlinks dereferencing (-L)" | ||
| 45 | //config: default y | ||
| 46 | //config: depends on LS | ||
| 47 | //config: help | ||
| 48 | //config: Enable the ls option (-L). | ||
| 49 | //config: | ||
| 50 | //config:config FEATURE_LS_RECURSIVE | ||
| 51 | //config: bool "Enable recursion (-R)" | ||
| 52 | //config: default y | ||
| 53 | //config: depends on LS | ||
| 54 | //config: help | ||
| 55 | //config: Enable the ls option (-R). | ||
| 56 | //config: | ||
| 57 | //config:config FEATURE_LS_SORTFILES | ||
| 58 | //config: bool "Sort the file names" | ||
| 59 | //config: default y | ||
| 60 | //config: depends on LS | ||
| 61 | //config: help | ||
| 62 | //config: Allow ls to sort file names alphabetically. | ||
| 63 | //config: | ||
| 64 | //config:config FEATURE_LS_TIMESTAMPS | ||
| 65 | //config: bool "Show file timestamps" | ||
| 66 | //config: default y | ||
| 67 | //config: depends on LS | ||
| 68 | //config: help | ||
| 69 | //config: Allow ls to display timestamps for files. | ||
| 70 | //config: | ||
| 71 | //config:config FEATURE_LS_USERNAME | ||
| 72 | //config: bool "Show username/groupnames" | ||
| 73 | //config: default y | ||
| 74 | //config: depends on LS | ||
| 75 | //config: help | ||
| 76 | //config: Allow ls to display username/groupname for files. | ||
| 77 | //config: | ||
| 78 | //config:config FEATURE_LS_COLOR | ||
| 79 | //config: bool "Allow use of color to identify file types" | ||
| 80 | //config: default y | ||
| 81 | //config: depends on LS && LONG_OPTS | ||
| 82 | //config: help | ||
| 83 | //config: This enables the --color option to ls. | ||
| 84 | //config: | ||
| 85 | //config:config FEATURE_LS_COLOR_IS_DEFAULT | ||
| 86 | //config: bool "Produce colored ls output by default" | ||
| 87 | //config: default y | ||
| 88 | //config: depends on FEATURE_LS_COLOR | ||
| 89 | //config: help | ||
| 90 | //config: Saying yes here will turn coloring on by default, | ||
| 91 | //config: even if no "--color" option is given to the ls command. | ||
| 92 | //config: This is not recommended, since the colors are not | ||
| 93 | //config: configurable, and the output may not be legible on | ||
| 94 | //config: many output screens. | ||
| 95 | |||
| 96 | //applet:IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) | ||
| 97 | |||
| 98 | //kbuild:lib-$(CONFIG_LS) += ls.o | ||
| 31 | 99 | ||
| 32 | //usage:#define ls_trivial_usage | 100 | //usage:#define ls_trivial_usage |
| 33 | //usage: "[-1AaCxd" | 101 | //usage: "[-1AaCxd" |
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 6f7b004dd..3afe76c28 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
| @@ -6,18 +6,32 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 compliant */ | ||
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/mkdir.html */ | ||
| 12 | |||
| 13 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 14 | * | 10 | * |
| 15 | * Fixed broken permission setting when -p was used; especially in | 11 | * Fixed broken permission setting when -p was used; especially in |
| 16 | * conjunction with -m. | 12 | * conjunction with -m. |
| 17 | */ | 13 | */ |
| 18 | |||
| 19 | /* Nov 28, 2006 Yoshinori Sato <ysato@users.sourceforge.jp>: Add SELinux Support. | 14 | /* Nov 28, 2006 Yoshinori Sato <ysato@users.sourceforge.jp>: Add SELinux Support. |
| 20 | */ | 15 | */ |
| 16 | //config:config MKDIR | ||
| 17 | //config: bool "mkdir" | ||
| 18 | //config: default y | ||
| 19 | //config: help | ||
| 20 | //config: mkdir is used to create directories with the specified names. | ||
| 21 | //config: | ||
| 22 | //config:config FEATURE_MKDIR_LONG_OPTIONS | ||
| 23 | //config: bool "Enable long options" | ||
| 24 | //config: default y | ||
| 25 | //config: depends on MKDIR && LONG_OPTS | ||
| 26 | //config: help | ||
| 27 | //config: Support long options for the mkdir applet. | ||
| 28 | |||
| 29 | //applet:IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) | ||
| 30 | |||
| 31 | //kbuild:lib-$(CONFIG_MKDIR) += mkdir.o | ||
| 32 | |||
| 33 | /* BB_AUDIT SUSv3 compliant */ | ||
| 34 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/mkdir.html */ | ||
| 21 | 35 | ||
| 22 | //usage:#define mkdir_trivial_usage | 36 | //usage:#define mkdir_trivial_usage |
| 23 | //usage: "[OPTIONS] DIRECTORY..." | 37 | //usage: "[OPTIONS] DIRECTORY..." |
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index ef58325b3..66509a9c0 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c | |||
| @@ -6,6 +6,16 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config MKFIFO | ||
| 10 | //config: bool "mkfifo" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: mkfifo is used to create FIFOs (named pipes). | ||
| 14 | //config: The 'mknod' program can also create FIFOs. | ||
| 15 | |||
| 16 | //applet:IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_MKFIFO) += mkfifo.o | ||
| 9 | 19 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 20 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/mkfifo.html */ | 21 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/mkfifo.html */ |
diff --git a/coreutils/mknod.c b/coreutils/mknod.c index aa0450481..466ef5c06 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c | |||
| @@ -6,6 +6,16 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config MKNOD | ||
| 10 | //config: bool "mknod" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: mknod is used to create FIFOs or block/character special | ||
| 14 | //config: files with the specified names. | ||
| 15 | |||
| 16 | //applet:IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_MKNOD) += mknod.o | ||
| 9 | 19 | ||
| 10 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | 20 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ |
| 11 | 21 | ||
diff --git a/coreutils/mv.c b/coreutils/mv.c index 50571755b..1cc318fd1 100644 --- a/coreutils/mv.c +++ b/coreutils/mv.c | |||
| @@ -7,14 +7,26 @@ | |||
| 7 | * | 7 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 9 | */ |
| 10 | |||
| 11 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 10 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 12 | * | 11 | * |
| 13 | * Size reduction and improved error checking. | 12 | * Size reduction and improved error checking. |
| 14 | */ | 13 | */ |
| 15 | 14 | //config:config MV | |
| 16 | #include "libbb.h" | 15 | //config: bool "mv" |
| 17 | #include "libcoreutils/coreutils.h" | 16 | //config: default y |
| 17 | //config: help | ||
| 18 | //config: mv is used to move or rename files or directories. | ||
| 19 | //config: | ||
| 20 | //config:config FEATURE_MV_LONG_OPTIONS | ||
| 21 | //config: bool "Enable long options" | ||
| 22 | //config: default y | ||
| 23 | //config: depends on MV && LONG_OPTS | ||
| 24 | //config: help | ||
| 25 | //config: Support long options for the mv applet. | ||
| 26 | |||
| 27 | //applet:IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 28 | |||
| 29 | //kbuild:lib-$(CONFIG_MV) += mv.o | ||
| 18 | 30 | ||
| 19 | //usage:#define mv_trivial_usage | 31 | //usage:#define mv_trivial_usage |
| 20 | //usage: "[-fin] SOURCE DEST\n" | 32 | //usage: "[-fin] SOURCE DEST\n" |
| @@ -28,6 +40,9 @@ | |||
| 28 | //usage:#define mv_example_usage | 40 | //usage:#define mv_example_usage |
| 29 | //usage: "$ mv /tmp/foo /bin/bar\n" | 41 | //usage: "$ mv /tmp/foo /bin/bar\n" |
| 30 | 42 | ||
| 43 | #include "libbb.h" | ||
| 44 | #include "libcoreutils/coreutils.h" | ||
| 45 | |||
| 31 | #if ENABLE_FEATURE_MV_LONG_OPTIONS | 46 | #if ENABLE_FEATURE_MV_LONG_OPTIONS |
| 32 | static const char mv_longopts[] ALIGN1 = | 47 | static const char mv_longopts[] ALIGN1 = |
| 33 | "interactive\0" No_argument "i" | 48 | "interactive\0" No_argument "i" |
diff --git a/coreutils/nice.c b/coreutils/nice.c index ce759916f..3676ee663 100644 --- a/coreutils/nice.c +++ b/coreutils/nice.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config NICE | ||
| 10 | //config: bool "nice" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: nice runs a program with modified scheduling priority. | ||
| 14 | |||
| 15 | //applet:IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_NICE) += nice.o | ||
| 9 | 18 | ||
| 10 | //usage:#define nice_trivial_usage | 19 | //usage:#define nice_trivial_usage |
| 11 | //usage: "[-n ADJUST] [PROG ARGS]" | 20 | //usage: "[-n ADJUST] [PROG ARGS]" |
diff --git a/coreutils/nohup.c b/coreutils/nohup.c index 63853fd55..d8489686d 100644 --- a/coreutils/nohup.c +++ b/coreutils/nohup.c | |||
| @@ -9,6 +9,15 @@ | |||
| 9 | * | 9 | * |
| 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 11 | */ | 11 | */ |
| 12 | //config:config NOHUP | ||
| 13 | //config: bool "nohup" | ||
| 14 | //config: default y | ||
| 15 | //config: help | ||
| 16 | //config: run a command immune to hangups, with output to a non-tty. | ||
| 17 | |||
| 18 | //applet:IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 19 | |||
| 20 | //kbuild:lib-$(CONFIG_NOHUP) += nohup.o | ||
| 12 | 21 | ||
| 13 | //usage:#define nohup_trivial_usage | 22 | //usage:#define nohup_trivial_usage |
| 14 | //usage: "PROG ARGS" | 23 | //usage: "PROG ARGS" |
diff --git a/coreutils/od.c b/coreutils/od.c index fb11fcfe3..4b05ee77c 100644 --- a/coreutils/od.c +++ b/coreutils/od.c | |||
| @@ -10,6 +10,15 @@ | |||
| 10 | * | 10 | * |
| 11 | * Original copyright notice is retained at the end of this file. | 11 | * Original copyright notice is retained at the end of this file. |
| 12 | */ | 12 | */ |
| 13 | //config:config OD | ||
| 14 | //config: bool "od" | ||
| 15 | //config: default y | ||
| 16 | //config: help | ||
| 17 | //config: od is used to dump binary files in octal and other formats. | ||
| 18 | |||
| 19 | //applet:IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 20 | |||
| 21 | //kbuild:lib-$(CONFIG_OD) += od.o | ||
| 13 | 22 | ||
| 14 | //usage:#if !ENABLE_DESKTOP | 23 | //usage:#if !ENABLE_DESKTOP |
| 15 | //usage:#define od_trivial_usage | 24 | //usage:#define od_trivial_usage |
diff --git a/coreutils/printenv.c b/coreutils/printenv.c index bd5db7073..fbd64945d 100644 --- a/coreutils/printenv.c +++ b/coreutils/printenv.c | |||
| @@ -7,6 +7,15 @@ | |||
| 7 | * | 7 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 9 | */ |
| 10 | //config:config PRINTENV | ||
| 11 | //config: bool "printenv" | ||
| 12 | //config: default y | ||
| 13 | //config: help | ||
| 14 | //config: printenv is used to print all or part of environment. | ||
| 15 | |||
| 16 | //applet:IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_PRINTENV) += printenv.o | ||
| 10 | 19 | ||
| 11 | //usage:#define printenv_trivial_usage | 20 | //usage:#define printenv_trivial_usage |
| 12 | //usage: "[VARIABLE]..." | 21 | //usage: "[VARIABLE]..." |
diff --git a/coreutils/printf.c b/coreutils/printf.c index 9ee7350d0..6c8e115d8 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c | |||
| @@ -38,6 +38,17 @@ | |||
| 38 | 38 | ||
| 39 | /* 19990508 Busy Boxed! Dave Cinege */ | 39 | /* 19990508 Busy Boxed! Dave Cinege */ |
| 40 | 40 | ||
| 41 | //config:config PRINTF | ||
| 42 | //config: bool "printf" | ||
| 43 | //config: default y | ||
| 44 | //config: help | ||
| 45 | //config: printf is used to format and print specified strings. | ||
| 46 | //config: It's similar to `echo' except it has more options. | ||
| 47 | |||
| 48 | //applet:IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) | ||
| 49 | |||
| 50 | //kbuild:lib-$(CONFIG_PRINTF) += printf.o | ||
| 51 | |||
| 41 | //usage:#define printf_trivial_usage | 52 | //usage:#define printf_trivial_usage |
| 42 | //usage: "FORMAT [ARG]..." | 53 | //usage: "FORMAT [ARG]..." |
| 43 | //usage:#define printf_full_usage "\n\n" | 54 | //usage:#define printf_full_usage "\n\n" |
diff --git a/coreutils/pwd.c b/coreutils/pwd.c index bb3ad04fc..05dee497b 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config PWD | ||
| 10 | //config: bool "pwd" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: pwd is used to print the current directory. | ||
| 14 | |||
| 15 | //applet:IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_PWD) += pwd.o | ||
| 9 | 18 | ||
| 10 | //usage:#define pwd_trivial_usage | 19 | //usage:#define pwd_trivial_usage |
| 11 | //usage: "" | 20 | //usage: "" |
| @@ -18,8 +27,6 @@ | |||
| 18 | 27 | ||
| 19 | #include "libbb.h" | 28 | #include "libbb.h" |
| 20 | 29 | ||
| 21 | /* This is a NOFORK applet. Be very careful! */ | ||
| 22 | |||
| 23 | static int logical_getcwd(void) | 30 | static int logical_getcwd(void) |
| 24 | { | 31 | { |
| 25 | struct stat st1; | 32 | struct stat st1; |
diff --git a/coreutils/readlink.c b/coreutils/readlink.c index d73ef4ddb..1b223b3c5 100644 --- a/coreutils/readlink.c +++ b/coreutils/readlink.c | |||
| @@ -6,6 +6,23 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config READLINK | ||
| 10 | //config: bool "readlink" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: This program reads a symbolic link and returns the name | ||
| 14 | //config: of the file it points to | ||
| 15 | //config: | ||
| 16 | //config:config FEATURE_READLINK_FOLLOW | ||
| 17 | //config: bool "Enable canonicalization by following all symlinks (-f)" | ||
| 18 | //config: default y | ||
| 19 | //config: depends on READLINK | ||
| 20 | //config: help | ||
| 21 | //config: Enable the readlink option (-f). | ||
| 22 | |||
| 23 | //applet:IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 24 | |||
| 25 | //kbuild:lib-$(CONFIG_READLINK) += readlink.o | ||
| 9 | 26 | ||
| 10 | //usage:#define readlink_trivial_usage | 27 | //usage:#define readlink_trivial_usage |
| 11 | //usage: IF_FEATURE_READLINK_FOLLOW("[-fnv] ") "FILE" | 28 | //usage: IF_FEATURE_READLINK_FOLLOW("[-fnv] ") "FILE" |
diff --git a/coreutils/realpath.c b/coreutils/realpath.c index c513b5549..0c2d544e4 100644 --- a/coreutils/realpath.c +++ b/coreutils/realpath.c | |||
| @@ -1,7 +1,4 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | |||
| 3 | /* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ | ||
| 4 | |||
| 5 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 2 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 6 | * | 3 | * |
| 7 | * Now does proper error checking on output and returns a failure exit code | 4 | * Now does proper error checking on output and returns a failure exit code |
| @@ -9,6 +6,18 @@ | |||
| 9 | * | 6 | * |
| 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 11 | */ | 8 | */ |
| 9 | //config:config REALPATH | ||
| 10 | //config: bool "realpath" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: Return the canonicalized absolute pathname. | ||
| 14 | //config: This isn't provided by GNU shellutils, but where else does it belong. | ||
| 15 | |||
| 16 | //applet:IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_REALPATH) += realpath.o | ||
| 19 | |||
| 20 | /* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ | ||
| 12 | 21 | ||
| 13 | //usage:#define realpath_trivial_usage | 22 | //usage:#define realpath_trivial_usage |
| 14 | //usage: "FILE..." | 23 | //usage: "FILE..." |
diff --git a/coreutils/rm.c b/coreutils/rm.c index d0ad81dfc..cec34cb9d 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c | |||
| @@ -6,14 +6,22 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 compliant */ | ||
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/rm.html */ | ||
| 12 | |||
| 13 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 14 | * | 10 | * |
| 15 | * Size reduction. | 11 | * Size reduction. |
| 16 | */ | 12 | */ |
| 13 | //config:config RM | ||
| 14 | //config: bool "rm" | ||
| 15 | //config: default y | ||
| 16 | //config: help | ||
| 17 | //config: rm is used to remove files or directories. | ||
| 18 | |||
| 19 | //applet:IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) | ||
| 20 | |||
| 21 | //kbuild:lib-$(CONFIG_RM) += rm.o | ||
| 22 | |||
| 23 | /* BB_AUDIT SUSv3 compliant */ | ||
| 24 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/rm.html */ | ||
| 17 | 25 | ||
| 18 | //usage:#define rm_trivial_usage | 26 | //usage:#define rm_trivial_usage |
| 19 | //usage: "[-irf] FILE..." | 27 | //usage: "[-irf] FILE..." |
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 0792a1c8e..8979941ce 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c | |||
| @@ -6,6 +6,23 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config RMDIR | ||
| 10 | //config: bool "rmdir" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: rmdir is used to remove empty directories. | ||
| 14 | //config: | ||
| 15 | //config:config FEATURE_RMDIR_LONG_OPTIONS | ||
| 16 | //config: bool "Enable long options" | ||
| 17 | //config: default y | ||
| 18 | //config: depends on RMDIR && LONG_OPTS | ||
| 19 | //config: help | ||
| 20 | //config: Support long options for the rmdir applet, including | ||
| 21 | //config: --ignore-fail-on-non-empty for compatibility with GNU rmdir. | ||
| 22 | |||
| 23 | //applet:IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) | ||
| 24 | |||
| 25 | //kbuild:lib-$(CONFIG_RMDIR) += rmdir.o | ||
| 9 | 26 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 27 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */ | 28 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */ |
diff --git a/coreutils/seq.c b/coreutils/seq.c index 898619293..ed4946b05 100644 --- a/coreutils/seq.c +++ b/coreutils/seq.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config SEQ | ||
| 10 | //config: bool "seq" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: print a sequence of numbers | ||
| 14 | |||
| 15 | //applet:IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_SEQ) += seq.o | ||
| 9 | 18 | ||
| 10 | //usage:#define seq_trivial_usage | 19 | //usage:#define seq_trivial_usage |
| 11 | //usage: "[-w] [-s SEP] [FIRST [INC]] LAST" | 20 | //usage: "[-w] [-s SEP] [FIRST [INC]] LAST" |
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 0ffbd16eb..ad2d6b526 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c | |||
| @@ -6,17 +6,48 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 compliant */ | ||
| 11 | /* BB_AUDIT GNU issues -- fancy version matches except args must be ints. */ | ||
| 12 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/sleep.html */ | ||
| 13 | |||
| 14 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 15 | * | 10 | * |
| 16 | * Rewritten to do proper arg and error checking. | 11 | * Rewritten to do proper arg and error checking. |
| 17 | * Also, added a 'fancy' configuration to accept multiple args with | 12 | * Also, added a 'fancy' configuration to accept multiple args with |
| 18 | * time suffixes for seconds, minutes, hours, and days. | 13 | * time suffixes for seconds, minutes, hours, and days. |
| 19 | */ | 14 | */ |
| 15 | //config:config SLEEP | ||
| 16 | //config: bool "sleep" | ||
| 17 | //config: default y | ||
| 18 | //config: help | ||
| 19 | //config: sleep is used to pause for a specified number of seconds. | ||
| 20 | //config: It comes in 3 versions: | ||
| 21 | //config: - small: takes one integer parameter | ||
| 22 | //config: - fancy: takes multiple integer arguments with suffixes: | ||
| 23 | //config: sleep 1d 2h 3m 15s | ||
| 24 | //config: - fancy with fractional numbers: | ||
| 25 | //config: sleep 2.3s 4.5h sleeps for 16202.3 seconds | ||
| 26 | //config: Last one is "the most compatible" with coreutils sleep, | ||
| 27 | //config: but it adds around 1k of code. | ||
| 28 | //config: | ||
| 29 | //config:config FEATURE_FANCY_SLEEP | ||
| 30 | //config: bool "Enable multiple arguments and s/m/h/d suffixes" | ||
| 31 | //config: default y | ||
| 32 | //config: depends on SLEEP | ||
| 33 | //config: help | ||
| 34 | //config: Allow sleep to pause for specified minutes, hours, and days. | ||
| 35 | //config: | ||
| 36 | //config:config FEATURE_FLOAT_SLEEP | ||
| 37 | //config: bool "Enable fractional arguments" | ||
| 38 | //config: default y | ||
| 39 | //config: depends on FEATURE_FANCY_SLEEP | ||
| 40 | //config: help | ||
| 41 | //config: Allow for fractional numeric parameters. | ||
| 42 | |||
| 43 | /* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells */ | ||
| 44 | //applet:IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 45 | |||
| 46 | //kbuild:lib-$(CONFIG_SLEEP) += sleep.o | ||
| 47 | |||
| 48 | /* BB_AUDIT SUSv3 compliant */ | ||
| 49 | /* BB_AUDIT GNU issues -- fancy version matches except args must be ints. */ | ||
| 50 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/sleep.html */ | ||
| 20 | 51 | ||
| 21 | //usage:#define sleep_trivial_usage | 52 | //usage:#define sleep_trivial_usage |
| 22 | //usage: IF_FEATURE_FANCY_SLEEP("[") "N" IF_FEATURE_FANCY_SLEEP("]...") | 53 | //usage: IF_FEATURE_FANCY_SLEEP("[") "N" IF_FEATURE_FANCY_SLEEP("]...") |
| @@ -35,9 +66,6 @@ | |||
| 35 | 66 | ||
| 36 | #include "libbb.h" | 67 | #include "libbb.h" |
| 37 | 68 | ||
| 38 | /* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells */ | ||
| 39 | |||
| 40 | |||
| 41 | #if ENABLE_FEATURE_FANCY_SLEEP || ENABLE_FEATURE_FLOAT_SLEEP | 69 | #if ENABLE_FEATURE_FANCY_SLEEP || ENABLE_FEATURE_FLOAT_SLEEP |
| 42 | static const struct suffix_mult sfx[] = { | 70 | static const struct suffix_mult sfx[] = { |
| 43 | { "s", 1 }, | 71 | { "s", 1 }, |
diff --git a/coreutils/sort.c b/coreutils/sort.c index 34a41999b..1ccce93c5 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
| @@ -11,6 +11,27 @@ | |||
| 11 | * See SuS3 sort standard at: | 11 | * See SuS3 sort standard at: |
| 12 | * http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html | 12 | * http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html |
| 13 | */ | 13 | */ |
| 14 | //config:config SORT | ||
| 15 | //config: bool "sort" | ||
| 16 | //config: default y | ||
| 17 | //config: help | ||
| 18 | //config: sort is used to sort lines of text in specified files. | ||
| 19 | //config: | ||
| 20 | //config:config FEATURE_SORT_BIG | ||
| 21 | //config: bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" | ||
| 22 | //config: default y | ||
| 23 | //config: depends on SORT | ||
| 24 | //config: help | ||
| 25 | //config: Without this, sort only supports -r, -u, and an integer version | ||
| 26 | //config: of -n. Selecting this adds sort keys, floating point support, and | ||
| 27 | //config: more. This adds a little over 3k to a nonstatic build on x86. | ||
| 28 | //config: | ||
| 29 | //config: The SuSv3 sort standard is available at: | ||
| 30 | //config: http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html | ||
| 31 | |||
| 32 | //applet:IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) | ||
| 33 | |||
| 34 | //kbuild:lib-$(CONFIG_SORT) += sort.o | ||
| 14 | 35 | ||
| 15 | //usage:#define sort_trivial_usage | 36 | //usage:#define sort_trivial_usage |
| 16 | //usage: "[-nru" | 37 | //usage: "[-nru" |
diff --git a/coreutils/split.c b/coreutils/split.c index 19d58a21b..50918a1ce 100644 --- a/coreutils/split.c +++ b/coreutils/split.c | |||
| @@ -5,6 +5,25 @@ | |||
| 5 | * | 5 | * |
| 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 7 | */ | 7 | */ |
| 8 | //config:config SPLIT | ||
| 9 | //config: bool "split" | ||
| 10 | //config: default y | ||
| 11 | //config: help | ||
| 12 | //config: split a file into pieces. | ||
| 13 | //config: | ||
| 14 | //config:config FEATURE_SPLIT_FANCY | ||
| 15 | //config: bool "Fancy extensions" | ||
| 16 | //config: default y | ||
| 17 | //config: depends on SPLIT | ||
| 18 | //config: help | ||
| 19 | //config: Add support for features not required by SUSv3. | ||
| 20 | //config: Supports additional suffixes 'b' for 512 bytes, | ||
| 21 | //config: 'g' for 1GiB for the -b option. | ||
| 22 | |||
| 23 | //applet:IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 24 | |||
| 25 | //kbuild:lib-$(CONFIG_SPLIT) += split.o | ||
| 26 | |||
| 8 | /* BB_AUDIT: SUSv3 compliant | 27 | /* BB_AUDIT: SUSv3 compliant |
| 9 | * SUSv3 requirements: | 28 | * SUSv3 requirements: |
| 10 | * http://www.opengroup.org/onlinepubs/009695399/utilities/split.html | 29 | * http://www.opengroup.org/onlinepubs/009695399/utilities/split.html |
diff --git a/coreutils/stat.c b/coreutils/stat.c index f608045d7..109b5258c 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
| @@ -35,6 +35,9 @@ | |||
| 35 | //config: Without this, stat will not support the '-f' option to display | 35 | //config: Without this, stat will not support the '-f' option to display |
| 36 | //config: information about filesystem status. | 36 | //config: information about filesystem status. |
| 37 | 37 | ||
| 38 | //applet:IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 39 | |||
| 40 | //kbuild:lib-$(CONFIG_STAT) += stat.o | ||
| 38 | 41 | ||
| 39 | //usage:#define stat_trivial_usage | 42 | //usage:#define stat_trivial_usage |
| 40 | //usage: "[OPTIONS] FILE..." | 43 | //usage: "[OPTIONS] FILE..." |
diff --git a/coreutils/stty.c b/coreutils/stty.c index 52967ea8f..e818d579c 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
| @@ -18,8 +18,16 @@ | |||
| 18 | David MacKenzie <djm@gnu.ai.mit.edu> | 18 | David MacKenzie <djm@gnu.ai.mit.edu> |
| 19 | 19 | ||
| 20 | Special for busybox ported by Vladimir Oleynik <dzo@simtreas.ru> 2001 | 20 | Special for busybox ported by Vladimir Oleynik <dzo@simtreas.ru> 2001 |
| 21 | */ | ||
| 22 | //config:config STTY | ||
| 23 | //config: bool "stty" | ||
| 24 | //config: default y | ||
| 25 | //config: help | ||
| 26 | //config: stty is used to change and print terminal line settings. | ||
| 27 | |||
| 28 | //applet:IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 21 | 29 | ||
| 22 | */ | 30 | //kbuild:lib-$(CONFIG_STTY) += stty.o |
| 23 | 31 | ||
| 24 | //usage:#define stty_trivial_usage | 32 | //usage:#define stty_trivial_usage |
| 25 | //usage: "[-a|g] [-F DEVICE] [SETTING]..." | 33 | //usage: "[-a|g] [-F DEVICE] [SETTING]..." |
diff --git a/coreutils/sum.c b/coreutils/sum.c index ec9ed2a11..c55293dc9 100644 --- a/coreutils/sum.c +++ b/coreutils/sum.c | |||
| @@ -12,6 +12,15 @@ | |||
| 12 | * | 12 | * |
| 13 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 13 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 14 | */ | 14 | */ |
| 15 | //config:config SUM | ||
| 16 | //config: bool "sum" | ||
| 17 | //config: default y | ||
| 18 | //config: help | ||
| 19 | //config: checksum and count the blocks in a file | ||
| 20 | |||
| 21 | //applet:IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 22 | |||
| 23 | //kbuild:lib-$(CONFIG_SUM) += sum.o | ||
| 15 | 24 | ||
| 16 | //usage:#define sum_trivial_usage | 25 | //usage:#define sum_trivial_usage |
| 17 | //usage: "[-rs] [FILE]..." | 26 | //usage: "[-rs] [FILE]..." |
diff --git a/coreutils/sync.c b/coreutils/sync.c index e65d9cd8d..5e189f6f4 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | * | 7 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 9 | */ |
| 10 | |||
| 11 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | ||
| 12 | //config:config SYNC | 10 | //config:config SYNC |
| 13 | //config: bool "sync" | 11 | //config: bool "sync" |
| 14 | //config: default y | 12 | //config: default y |
| @@ -22,9 +20,12 @@ | |||
| 22 | //config: sync -d FILE... executes fdatasync() on each FILE. | 20 | //config: sync -d FILE... executes fdatasync() on each FILE. |
| 23 | //config: sync -f FILE... executes syncfs() on each FILE. | 21 | //config: sync -f FILE... executes syncfs() on each FILE. |
| 24 | 22 | ||
| 25 | //kbuild:lib-$(CONFIG_SYNC) += sync.o | ||
| 26 | //applet:IF_SYNC(APPLET_NOFORK(sync, sync, BB_DIR_BIN, BB_SUID_DROP, sync)) | 23 | //applet:IF_SYNC(APPLET_NOFORK(sync, sync, BB_DIR_BIN, BB_SUID_DROP, sync)) |
| 27 | 24 | ||
| 25 | //kbuild:lib-$(CONFIG_SYNC) += sync.o | ||
| 26 | |||
| 27 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | ||
| 28 | |||
| 28 | //usage:#define sync_trivial_usage | 29 | //usage:#define sync_trivial_usage |
| 29 | //usage: ""IF_FEATURE_SYNC_FANCY("[-df] [FILE]...") | 30 | //usage: ""IF_FEATURE_SYNC_FANCY("[-df] [FILE]...") |
| 30 | //usage:#define sync_full_usage "\n\n" | 31 | //usage:#define sync_full_usage "\n\n" |
diff --git a/coreutils/tac.c b/coreutils/tac.c index 94d669de1..ca5617c83 100644 --- a/coreutils/tac.c +++ b/coreutils/tac.c | |||
| @@ -1,20 +1,26 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* | 2 | /* |
| 3 | * tac implementation for busybox | 3 | * tac implementation for busybox |
| 4 | * tac - concatenate and print files in reverse | ||
| 4 | * | 5 | * |
| 5 | * Copyright (C) 2003 Yang Xiaopeng <yxp at hanwang.com.cn> | 6 | * Copyright (C) 2003 Yang Xiaopeng <yxp at hanwang.com.cn> |
| 6 | * Copyright (C) 2007 Natanael Copa <natanael.copa@gmail.com> | 7 | * Copyright (C) 2007 Natanael Copa <natanael.copa@gmail.com> |
| 7 | * Copyright (C) 2007 Tito Ragusa <farmatito@tiscali.it> | 8 | * Copyright (C) 2007 Tito Ragusa <farmatito@tiscali.it> |
| 8 | * | 9 | * |
| 9 | * Licensed under GPLv2, see file LICENSE in this source tree. | 10 | * Licensed under GPLv2, see file LICENSE in this source tree. |
| 10 | * | ||
| 11 | */ | 11 | */ |
| 12 | |||
| 13 | /* tac - concatenate and print files in reverse */ | ||
| 14 | |||
| 15 | /* Based on Yang Xiaopeng's (yxp at hanwang.com.cn) patch | 12 | /* Based on Yang Xiaopeng's (yxp at hanwang.com.cn) patch |
| 16 | * http://www.uclibc.org/lists/busybox/2003-July/008813.html | 13 | * http://www.uclibc.org/lists/busybox/2003-July/008813.html |
| 17 | */ | 14 | */ |
| 15 | //config:config TAC | ||
| 16 | //config: bool "tac" | ||
| 17 | //config: default y | ||
| 18 | //config: help | ||
| 19 | //config: tac is used to concatenate and print files in reverse. | ||
| 20 | |||
| 21 | //applet:IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) | ||
| 22 | |||
| 23 | //kbuild:lib-$(CONFIG_TAC) += tac.o | ||
| 18 | 24 | ||
| 19 | //usage:#define tac_trivial_usage | 25 | //usage:#define tac_trivial_usage |
| 20 | //usage: "[FILE]..." | 26 | //usage: "[FILE]..." |
diff --git a/coreutils/tail.c b/coreutils/tail.c index 57ad0f3b7..99f58ddd8 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
| @@ -6,11 +6,6 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 compliant (need fancy for -c) */ | ||
| 11 | /* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */ | ||
| 12 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/tail.html */ | ||
| 13 | |||
| 14 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 15 | * | 10 | * |
| 16 | * Pretty much rewritten to fix numerous bugs and reduce realloc() calls. | 11 | * Pretty much rewritten to fix numerous bugs and reduce realloc() calls. |
| @@ -23,9 +18,34 @@ | |||
| 23 | * 6) no check for lseek error | 18 | * 6) no check for lseek error |
| 24 | * 7) lseek attempted when count==0 even if arg was +0 (from top) | 19 | * 7) lseek attempted when count==0 even if arg was +0 (from top) |
| 25 | */ | 20 | */ |
| 21 | //config:config TAIL | ||
| 22 | //config: bool "tail" | ||
| 23 | //config: default y | ||
| 24 | //config: help | ||
| 25 | //config: tail is used to print the last specified number of lines | ||
| 26 | //config: from files. | ||
| 27 | //config: | ||
| 28 | //config:config FEATURE_FANCY_TAIL | ||
| 29 | //config: bool "Enable extra tail options (-q, -s, -v, and -F)" | ||
| 30 | //config: default y | ||
| 31 | //config: depends on TAIL | ||
| 32 | //config: help | ||
| 33 | //config: The options (-q, -s, -v and -F) are provided by GNU tail, but | ||
| 34 | //config: are not specific in the SUSv3 standard. | ||
| 35 | //config: | ||
| 36 | //config: -q Never output headers giving file names | ||
| 37 | //config: -s SEC Wait SEC seconds between reads with -f | ||
| 38 | //config: -v Always output headers giving file names | ||
| 39 | //config: -F Same as -f, but keep retrying | ||
| 40 | |||
| 41 | //applet:IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 26 | 42 | ||
| 27 | //kbuild:lib-$(CONFIG_TAIL) += tail.o | 43 | //kbuild:lib-$(CONFIG_TAIL) += tail.o |
| 28 | 44 | ||
| 45 | /* BB_AUDIT SUSv3 compliant (need fancy for -c) */ | ||
| 46 | /* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */ | ||
| 47 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/tail.html */ | ||
| 48 | |||
| 29 | //usage:#define tail_trivial_usage | 49 | //usage:#define tail_trivial_usage |
| 30 | //usage: "[OPTIONS] [FILE]..." | 50 | //usage: "[OPTIONS] [FILE]..." |
| 31 | //usage:#define tail_full_usage "\n\n" | 51 | //usage:#define tail_full_usage "\n\n" |
diff --git a/coreutils/tee.c b/coreutils/tee.c index a68e9446f..602d06737 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c | |||
| @@ -6,6 +6,23 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config TEE | ||
| 10 | //config: bool "tee" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: tee is used to read from standard input and write | ||
| 14 | //config: to standard output and files. | ||
| 15 | //config: | ||
| 16 | //config:config FEATURE_TEE_USE_BLOCK_IO | ||
| 17 | //config: bool "Enable block I/O (larger/faster) instead of byte I/O" | ||
| 18 | //config: default y | ||
| 19 | //config: depends on TEE | ||
| 20 | //config: help | ||
| 21 | //config: Enable this option for a faster tee, at expense of size. | ||
| 22 | |||
| 23 | //applet:IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 24 | |||
| 25 | //kbuild:lib-$(CONFIG_TEE) += tee.o | ||
| 9 | 26 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 27 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/tee.html */ | 28 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/tee.html */ |
diff --git a/coreutils/test.c b/coreutils/test.c index b8a5d798c..df42590e4 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
| @@ -19,11 +19,6 @@ | |||
| 19 | * Original copyright notice states: | 19 | * Original copyright notice states: |
| 20 | * "This program is in the Public Domain." | 20 | * "This program is in the Public Domain." |
| 21 | */ | 21 | */ |
| 22 | |||
| 23 | //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o | ||
| 24 | //kbuild:lib-$(CONFIG_ASH) += test.o test_ptr_hack.o | ||
| 25 | //kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o | ||
| 26 | |||
| 27 | //config:config TEST | 22 | //config:config TEST |
| 28 | //config: bool "test" | 23 | //config: bool "test" |
| 29 | //config: default y | 24 | //config: default y |
| @@ -32,13 +27,35 @@ | |||
| 32 | //config: returning an appropriate exit code. The bash shell | 27 | //config: returning an appropriate exit code. The bash shell |
| 33 | //config: has test built in, ash can build it in optionally. | 28 | //config: has test built in, ash can build it in optionally. |
| 34 | //config: | 29 | //config: |
| 30 | //config:config TEST1 | ||
| 31 | //config: bool "test as [" | ||
| 32 | //config: default y | ||
| 33 | //config: help | ||
| 34 | //config: Provide test command in the "[ EXPR ]" form | ||
| 35 | //config: | ||
| 36 | //config:config TEST2 | ||
| 37 | //config: bool "test as [[" | ||
| 38 | //config: default y | ||
| 39 | //config: help | ||
| 40 | //config: Provide test command in the "[[ EXPR ]]" form | ||
| 41 | //config: | ||
| 35 | //config:config FEATURE_TEST_64 | 42 | //config:config FEATURE_TEST_64 |
| 36 | //config: bool "Extend test to 64 bit" | 43 | //config: bool "Extend test to 64 bit" |
| 37 | //config: default y | 44 | //config: default y |
| 38 | //config: depends on TEST || ASH_BUILTIN_TEST || HUSH | 45 | //config: depends on TEST || TEST1 || TEST2 || ASH_BUILTIN_TEST || HUSH |
| 39 | //config: help | 46 | //config: help |
| 40 | //config: Enable 64-bit support in test. | 47 | //config: Enable 64-bit support in test. |
| 41 | 48 | ||
| 49 | //applet:IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | ||
| 50 | //applet:IF_TEST1(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | ||
| 51 | //applet:IF_TEST2(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | ||
| 52 | |||
| 53 | //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o | ||
| 54 | //kbuild:lib-$(CONFIG_TEST1) += test.o test_ptr_hack.o | ||
| 55 | //kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o | ||
| 56 | //kbuild:lib-$(CONFIG_ASH_BUILTIN_TEST) += test.o test_ptr_hack.o | ||
| 57 | //kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o | ||
| 58 | |||
| 42 | /* "test --help" is special-cased to ignore --help */ | 59 | /* "test --help" is special-cased to ignore --help */ |
| 43 | //usage:#define test_trivial_usage NOUSAGE_STR | 60 | //usage:#define test_trivial_usage NOUSAGE_STR |
| 44 | //usage:#define test_full_usage "" | 61 | //usage:#define test_full_usage "" |
| @@ -839,7 +856,9 @@ int test_main(int argc, char **argv) | |||
| 839 | const char *arg0; | 856 | const char *arg0; |
| 840 | 857 | ||
| 841 | arg0 = bb_basename(argv[0]); | 858 | arg0 = bb_basename(argv[0]); |
| 842 | if (arg0[0] == '[') { | 859 | if ((ENABLE_TEST1 || ENABLE_TEST2 || ENABLE_ASH_BUILTIN_TEST || ENABLE_HUSH) |
| 860 | && (arg0[0] == '[') | ||
| 861 | ) { | ||
| 843 | --argc; | 862 | --argc; |
| 844 | if (!arg0[1]) { /* "[" ? */ | 863 | if (!arg0[1]) { /* "[" ? */ |
| 845 | if (NOT_LONE_CHAR(argv[argc], ']')) { | 864 | if (NOT_LONE_CHAR(argv[argc], ']')) { |
diff --git a/coreutils/touch.c b/coreutils/touch.c index 293a96890..92d5a718a 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c | |||
| @@ -6,19 +6,12 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m not supported. */ | ||
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/touch.html */ | ||
| 12 | |||
| 13 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 14 | * | 10 | * |
| 15 | * Previous version called open() and then utime(). While this will be | 11 | * Previous version called open() and then utime(). While this will be |
| 16 | * be necessary to implement -r and -t, it currently only makes things bigger. | 12 | * be necessary to implement -r and -t, it currently only makes things bigger. |
| 17 | * Also, exiting on a failure was a bug. All args should be processed. | 13 | * Also, exiting on a failure was a bug. All args should be processed. |
| 18 | */ | 14 | */ |
| 19 | |||
| 20 | #include "libbb.h" | ||
| 21 | |||
| 22 | //config:config TOUCH | 15 | //config:config TOUCH |
| 23 | //config: bool "touch" | 16 | //config: bool "touch" |
| 24 | //config: default y | 17 | //config: default y |
| @@ -45,6 +38,9 @@ | |||
| 45 | 38 | ||
| 46 | //kbuild:lib-$(CONFIG_TOUCH) += touch.o | 39 | //kbuild:lib-$(CONFIG_TOUCH) += touch.o |
| 47 | 40 | ||
| 41 | /* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m not supported. */ | ||
| 42 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/touch.html */ | ||
| 43 | |||
| 48 | //usage:#define touch_trivial_usage | 44 | //usage:#define touch_trivial_usage |
| 49 | //usage: "[-c]" IF_FEATURE_TOUCH_SUSV3(" [-d DATE] [-t DATE] [-r FILE]") " FILE..." | 45 | //usage: "[-c]" IF_FEATURE_TOUCH_SUSV3(" [-d DATE] [-t DATE] [-r FILE]") " FILE..." |
| 50 | //usage:#define touch_full_usage "\n\n" | 46 | //usage:#define touch_full_usage "\n\n" |
| @@ -66,8 +62,6 @@ | |||
| 66 | //usage: "$ ls -l /tmp/foo\n" | 62 | //usage: "$ ls -l /tmp/foo\n" |
| 67 | //usage: "-rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo\n" | 63 | //usage: "-rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo\n" |
| 68 | 64 | ||
| 69 | /* This is a NOFORK applet. Be very careful! */ | ||
| 70 | |||
| 71 | /* coreutils implements: | 65 | /* coreutils implements: |
| 72 | * -a change only the access time | 66 | * -a change only the access time |
| 73 | * -c, --no-create | 67 | * -c, --no-create |
| @@ -85,6 +79,8 @@ | |||
| 85 | * change the specified time: WORD is access, atime, or use | 79 | * change the specified time: WORD is access, atime, or use |
| 86 | */ | 80 | */ |
| 87 | 81 | ||
| 82 | #include "libbb.h" | ||
| 83 | |||
| 88 | int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 84 | int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 89 | int touch_main(int argc UNUSED_PARAM, char **argv) | 85 | int touch_main(int argc UNUSED_PARAM, char **argv) |
| 90 | { | 86 | { |
diff --git a/coreutils/tr.c b/coreutils/tr.c index 2f49d5a86..f552096f3 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
| @@ -18,9 +18,6 @@ | |||
| 18 | /* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html | 18 | /* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html |
| 19 | * TODO: graph, print | 19 | * TODO: graph, print |
| 20 | */ | 20 | */ |
| 21 | |||
| 22 | //kbuild:lib-$(CONFIG_TR) += tr.o | ||
| 23 | |||
| 24 | //config:config TR | 21 | //config:config TR |
| 25 | //config: bool "tr" | 22 | //config: bool "tr" |
| 26 | //config: default y | 23 | //config: default y |
| @@ -47,6 +44,10 @@ | |||
| 47 | //config: useful for cases when no other way of expressing a character | 44 | //config: useful for cases when no other way of expressing a character |
| 48 | //config: is possible. | 45 | //config: is possible. |
| 49 | 46 | ||
| 47 | //applet:IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 48 | |||
| 49 | //kbuild:lib-$(CONFIG_TR) += tr.o | ||
| 50 | |||
| 50 | //usage:#define tr_trivial_usage | 51 | //usage:#define tr_trivial_usage |
| 51 | //usage: "[-cds] STRING1 [STRING2]" | 52 | //usage: "[-cds] STRING1 [STRING2]" |
| 52 | //usage:#define tr_full_usage "\n\n" | 53 | //usage:#define tr_full_usage "\n\n" |
diff --git a/coreutils/true.c b/coreutils/true.c index 89f892961..6a9493f9d 100644 --- a/coreutils/true.c +++ b/coreutils/true.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config TRUE | ||
| 10 | //config: bool "true" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: true returns an exit code of TRUE (0). | ||
| 14 | |||
| 15 | //applet:IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_TRUE) += true.o | ||
| 9 | 18 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 19 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/true.html */ | 20 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/true.html */ |
diff --git a/coreutils/truncate.c b/coreutils/truncate.c index 8d845f218..253fe0015 100644 --- a/coreutils/truncate.c +++ b/coreutils/truncate.c | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | * | 5 | * |
| 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 7 | */ | 7 | */ |
| 8 | |||
| 9 | //config:config TRUNCATE | 8 | //config:config TRUNCATE |
| 10 | //config: bool "truncate" | 9 | //config: bool "truncate" |
| 11 | //config: default y | 10 | //config: default y |
| @@ -13,9 +12,10 @@ | |||
| 13 | //config: truncate truncates files to a given size. If a file does | 12 | //config: truncate truncates files to a given size. If a file does |
| 14 | //config: not exist, it is created unless told otherwise. | 13 | //config: not exist, it is created unless told otherwise. |
| 15 | 14 | ||
| 16 | //kbuild:lib-$(CONFIG_TRUNCATE) += truncate.o | ||
| 17 | //applet:IF_TRUNCATE(APPLET_NOFORK(truncate, truncate, BB_DIR_USR_BIN, BB_SUID_DROP, truncate)) | 15 | //applet:IF_TRUNCATE(APPLET_NOFORK(truncate, truncate, BB_DIR_USR_BIN, BB_SUID_DROP, truncate)) |
| 18 | 16 | ||
| 17 | //kbuild:lib-$(CONFIG_TRUNCATE) += truncate.o | ||
| 18 | |||
| 19 | //usage:#define truncate_trivial_usage | 19 | //usage:#define truncate_trivial_usage |
| 20 | //usage: "[-c] -s SIZE FILE..." | 20 | //usage: "[-c] -s SIZE FILE..." |
| 21 | //usage:#define truncate_full_usage "\n\n" | 21 | //usage:#define truncate_full_usage "\n\n" |
diff --git a/coreutils/tty.c b/coreutils/tty.c index 45175054e..359e5bc93 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c | |||
| @@ -6,6 +6,16 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config TTY | ||
| 10 | //config: bool "tty" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: tty is used to print the name of the current terminal to | ||
| 14 | //config: standard output. | ||
| 15 | |||
| 16 | //applet:IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_TTY) += tty.o | ||
| 9 | 19 | ||
| 10 | /* BB_AUDIT SUSv4 compliant */ | 20 | /* BB_AUDIT SUSv4 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/tty.html */ | 21 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/tty.html */ |
diff --git a/coreutils/uname.c b/coreutils/uname.c index fd677d27c..4d98fde25 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
| @@ -4,10 +4,6 @@ | |||
| 4 | * | 4 | * |
| 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 6 | */ | 6 | */ |
| 7 | |||
| 8 | /* BB_AUDIT SUSv3 compliant */ | ||
| 9 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ | ||
| 10 | |||
| 11 | /* Option Example | 7 | /* Option Example |
| 12 | * -s, --sysname SunOS | 8 | * -s, --sysname SunOS |
| 13 | * -n, --nodename rocky8 | 9 | * -n, --nodename rocky8 |
| @@ -37,7 +33,6 @@ | |||
| 37 | * -a, --all: all of the above, in the order shown. | 33 | * -a, --all: all of the above, in the order shown. |
| 38 | * If -p or -i is not known, don't show them | 34 | * If -p or -i is not known, don't show them |
| 39 | */ | 35 | */ |
| 40 | |||
| 41 | /* Busyboxed by Erik Andersen | 36 | /* Busyboxed by Erik Andersen |
| 42 | * | 37 | * |
| 43 | * Before 2003: Glenn McGrath and Manuel Novoa III | 38 | * Before 2003: Glenn McGrath and Manuel Novoa III |
| @@ -47,6 +42,26 @@ | |||
| 47 | * Jan 2009: | 42 | * Jan 2009: |
| 48 | * Fix handling of -a to not print "unknown", add -o and -i support. | 43 | * Fix handling of -a to not print "unknown", add -o and -i support. |
| 49 | */ | 44 | */ |
| 45 | //config:config UNAME | ||
| 46 | //config: bool "uname" | ||
| 47 | //config: default y | ||
| 48 | //config: help | ||
| 49 | //config: uname is used to print system information. | ||
| 50 | //config: | ||
| 51 | //config:config UNAME_OSNAME | ||
| 52 | //config: string "Operating system name" | ||
| 53 | //config: default "GNU/Linux" | ||
| 54 | //config: depends on UNAME | ||
| 55 | //config: help | ||
| 56 | //config: Sets the operating system name reported by uname -o. The | ||
| 57 | //config: default is "GNU/Linux". | ||
| 58 | |||
| 59 | //applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 60 | |||
| 61 | //kbuild:lib-$(CONFIG_UNAME) += uname.o | ||
| 62 | |||
| 63 | /* BB_AUDIT SUSv3 compliant */ | ||
| 64 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ | ||
| 50 | 65 | ||
| 51 | //usage:#define uname_trivial_usage | 66 | //usage:#define uname_trivial_usage |
| 52 | //usage: "[-amnrspvio]" | 67 | //usage: "[-amnrspvio]" |
diff --git a/coreutils/uniq.c b/coreutils/uniq.c index ec7bde418..be550b5cd 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config UNIQ | ||
| 10 | //config: bool "uniq" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: uniq is used to remove duplicate lines from a sorted file. | ||
| 14 | |||
| 15 | //applet:IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_UNIQ) += uniq.o | ||
| 9 | 18 | ||
| 10 | /* BB_AUDIT SUSv3 compliant */ | 19 | /* BB_AUDIT SUSv3 compliant */ |
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/uniq.html */ | 20 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/uniq.html */ |
diff --git a/coreutils/unlink.c b/coreutils/unlink.c index 3b7d0fb2b..2879638d3 100644 --- a/coreutils/unlink.c +++ b/coreutils/unlink.c | |||
| @@ -5,17 +5,16 @@ | |||
| 5 | * | 5 | * |
| 6 | * Licensed under GPLv2, see LICENSE in this source tree | 6 | * Licensed under GPLv2, see LICENSE in this source tree |
| 7 | */ | 7 | */ |
| 8 | |||
| 9 | //config:config UNLINK | 8 | //config:config UNLINK |
| 10 | //config: bool "unlink" | 9 | //config: bool "unlink" |
| 11 | //config: default y | 10 | //config: default y |
| 12 | //config: help | 11 | //config: help |
| 13 | //config: unlink deletes a file by calling unlink() | 12 | //config: unlink deletes a file by calling unlink() |
| 14 | 13 | ||
| 15 | //kbuild:lib-$(CONFIG_UNLINK) += unlink.o | ||
| 16 | |||
| 17 | //applet:IF_UNLINK(APPLET(unlink, BB_DIR_USR_BIN, BB_SUID_DROP)) | 14 | //applet:IF_UNLINK(APPLET(unlink, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 18 | 15 | ||
| 16 | //kbuild:lib-$(CONFIG_UNLINK) += unlink.o | ||
| 17 | |||
| 19 | //usage:#define unlink_trivial_usage | 18 | //usage:#define unlink_trivial_usage |
| 20 | //usage: "FILE" | 19 | //usage: "FILE" |
| 21 | //usage:#define unlink_full_usage "\n\n" | 20 | //usage:#define unlink_full_usage "\n\n" |
diff --git a/coreutils/usleep.c b/coreutils/usleep.c index 2e4eb5721..7bc30c2a2 100644 --- a/coreutils/usleep.c +++ b/coreutils/usleep.c | |||
| @@ -6,6 +6,15 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config USLEEP | ||
| 10 | //config: bool "usleep" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: usleep is used to pause for a specified number of microseconds. | ||
| 14 | |||
| 15 | //applet:IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) | ||
| 16 | |||
| 17 | //kbuild:lib-$(CONFIG_USLEEP) += usleep.o | ||
| 9 | 18 | ||
| 10 | /* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ | 19 | /* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ |
| 11 | 20 | ||
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 37b254d30..ddce2548b 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
| @@ -10,6 +10,15 @@ | |||
| 10 | * Bugs: the spec doesn't mention anything about "`\n`\n" prior to the | 10 | * Bugs: the spec doesn't mention anything about "`\n`\n" prior to the |
| 11 | * "end" line | 11 | * "end" line |
| 12 | */ | 12 | */ |
| 13 | //config:config UUDECODE | ||
| 14 | //config: bool "uudecode" | ||
| 15 | //config: default y | ||
| 16 | //config: help | ||
| 17 | //config: uudecode is used to decode a uuencoded file. | ||
| 18 | |||
| 19 | //applet:IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 20 | |||
| 21 | //kbuild:lib-$(CONFIG_UUDECODE) += uudecode.o | ||
| 13 | 22 | ||
| 14 | //usage:#define uudecode_trivial_usage | 23 | //usage:#define uudecode_trivial_usage |
| 15 | //usage: "[-o OUTFILE] [INFILE]" | 24 | //usage: "[-o OUTFILE] [INFILE]" |
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 673ef36e7..917cdaea5 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
| @@ -7,6 +7,15 @@ | |||
| 7 | * | 7 | * |
| 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 9 | */ | 9 | */ |
| 10 | //config:config UUENCODE | ||
| 11 | //config: bool "uuencode" | ||
| 12 | //config: default y | ||
| 13 | //config: help | ||
| 14 | //config: uuencode is used to uuencode a file. | ||
| 15 | |||
| 16 | //applet:IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_UUENCODE) += uuencode.o | ||
| 10 | 19 | ||
| 11 | //usage:#define uuencode_trivial_usage | 20 | //usage:#define uuencode_trivial_usage |
| 12 | //usage: "[-m] [FILE] STORED_FILENAME" | 21 | //usage: "[-m] [FILE] STORED_FILENAME" |
diff --git a/coreutils/wc.c b/coreutils/wc.c index a410e407a..73837141e 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c | |||
| @@ -6,10 +6,6 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 compliant. */ | ||
| 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/wc.html */ | ||
| 12 | |||
| 13 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 14 | * | 10 | * |
| 15 | * Rewritten to fix a number of problems and do some size optimizations. | 11 | * Rewritten to fix a number of problems and do some size optimizations. |
| @@ -36,6 +32,27 @@ | |||
| 36 | * | 32 | * |
| 37 | * for which 'wc -c' should output '0'. | 33 | * for which 'wc -c' should output '0'. |
| 38 | */ | 34 | */ |
| 35 | //config:config WC | ||
| 36 | //config: bool "wc" | ||
| 37 | //config: default y | ||
| 38 | //config: help | ||
| 39 | //config: wc is used to print the number of bytes, words, and lines, | ||
| 40 | //config: in specified files. | ||
| 41 | //config: | ||
| 42 | //config:config FEATURE_WC_LARGE | ||
| 43 | //config: bool "Support very large files in wc" | ||
| 44 | //config: default y | ||
| 45 | //config: depends on WC | ||
| 46 | //config: help | ||
| 47 | //config: Use "unsigned long long" in wc for counter variables. | ||
| 48 | |||
| 49 | //applet:IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
| 50 | |||
| 51 | //kbuild:lib-$(CONFIG_WC) += wc.o | ||
| 52 | |||
| 53 | /* BB_AUDIT SUSv3 compliant. */ | ||
| 54 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/wc.html */ | ||
| 55 | |||
| 39 | #include "libbb.h" | 56 | #include "libbb.h" |
| 40 | #include "unicode.h" | 57 | #include "unicode.h" |
| 41 | 58 | ||
diff --git a/coreutils/who.c b/coreutils/who.c index f694d0c60..ac19dc720 100644 --- a/coreutils/who.c +++ b/coreutils/who.c | |||
| @@ -16,15 +16,13 @@ | |||
| 16 | * | 16 | * |
| 17 | *---------------------------------------------------------------------- | 17 | *---------------------------------------------------------------------- |
| 18 | */ | 18 | */ |
| 19 | /* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */ | ||
| 20 | |||
| 21 | //config:config WHO | 19 | //config:config WHO |
| 22 | //config: bool "who" | 20 | //config: bool "who" |
| 23 | //config: default y | 21 | //config: default y |
| 24 | //config: depends on FEATURE_UTMP | 22 | //config: depends on FEATURE_UTMP |
| 25 | //config: help | 23 | //config: help |
| 26 | //config: who is used to show who is logged on. | 24 | //config: who is used to show who is logged on. |
| 27 | 25 | //config: | |
| 28 | //config:config USERS | 26 | //config:config USERS |
| 29 | //config: bool "users" | 27 | //config: bool "users" |
| 30 | //config: default y | 28 | //config: default y |
| @@ -33,11 +31,13 @@ | |||
| 33 | //config: Print users currently logged on. | 31 | //config: Print users currently logged on. |
| 34 | 32 | ||
| 35 | //applet:IF_USERS(APPLET_ODDNAME(users, who, BB_DIR_USR_BIN, BB_SUID_DROP, users)) | 33 | //applet:IF_USERS(APPLET_ODDNAME(users, who, BB_DIR_USR_BIN, BB_SUID_DROP, users)) |
| 36 | //applet:IF_WHO( APPLET( who, BB_DIR_USR_BIN, BB_SUID_DROP)) | 34 | //applet:IF_WHO(APPLET(who, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 37 | 35 | ||
| 38 | //kbuild:lib-$(CONFIG_USERS) += who.o | 36 | //kbuild:lib-$(CONFIG_USERS) += who.o |
| 39 | //kbuild:lib-$(CONFIG_WHO) += who.o | 37 | //kbuild:lib-$(CONFIG_WHO) += who.o |
| 40 | 38 | ||
| 39 | /* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */ | ||
| 40 | |||
| 41 | //usage:#define users_trivial_usage | 41 | //usage:#define users_trivial_usage |
| 42 | //usage: "" | 42 | //usage: "" |
| 43 | //usage:#define users_full_usage "\n\n" | 43 | //usage:#define users_full_usage "\n\n" |
diff --git a/coreutils/whoami.c b/coreutils/whoami.c index 30b17cab3..635712829 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c | |||
| @@ -6,6 +6,16 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config WHOAMI | ||
| 10 | //config: bool "whoami" | ||
| 11 | //config: default y | ||
| 12 | //config: help | ||
| 13 | //config: whoami is used to print the username of the current | ||
| 14 | //config: user id (same as id -un). | ||
| 15 | |||
| 16 | //applet:IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_WHOAMI) += whoami.o | ||
| 9 | 19 | ||
| 10 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | 20 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ |
| 11 | 21 | ||
| @@ -16,8 +26,6 @@ | |||
| 16 | 26 | ||
| 17 | #include "libbb.h" | 27 | #include "libbb.h" |
| 18 | 28 | ||
| 19 | /* This is a NOFORK applet. Be very careful! */ | ||
| 20 | |||
| 21 | int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 29 | int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 22 | int whoami_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | 30 | int whoami_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) |
| 23 | { | 31 | { |
diff --git a/coreutils/yes.c b/coreutils/yes.c index c3d3e8288..ce6a90fc0 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c | |||
| @@ -6,23 +6,30 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | |||
| 10 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | ||
| 11 | |||
| 12 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) | 9 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) |
| 13 | * | 10 | * |
| 14 | * Size reductions and removed redundant applet name prefix from error messages. | 11 | * Size reductions and removed redundant applet name prefix from error messages. |
| 15 | */ | 12 | */ |
| 13 | //config:config YES | ||
| 14 | //config: bool "yes" | ||
| 15 | //config: default y | ||
| 16 | //config: help | ||
| 17 | //config: yes is used to repeatedly output a specific string, or | ||
| 18 | //config: the default string `y'. | ||
| 16 | 19 | ||
| 17 | #include "libbb.h" | 20 | //applet:IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) |
| 18 | 21 | ||
| 19 | /* This is a NOFORK applet. Be very careful! */ | 22 | //kbuild:lib-$(CONFIG_YES) += yes.o |
| 23 | |||
| 24 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ | ||
| 20 | 25 | ||
| 21 | //usage:#define yes_trivial_usage | 26 | //usage:#define yes_trivial_usage |
| 22 | //usage: "[STRING]" | 27 | //usage: "[STRING]" |
| 23 | //usage:#define yes_full_usage "\n\n" | 28 | //usage:#define yes_full_usage "\n\n" |
| 24 | //usage: "Repeatedly output a line with STRING, or 'y'" | 29 | //usage: "Repeatedly output a line with STRING, or 'y'" |
| 25 | 30 | ||
| 31 | #include "libbb.h" | ||
| 32 | |||
| 26 | int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 33 | int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 27 | int yes_main(int argc UNUSED_PARAM, char **argv) | 34 | int yes_main(int argc UNUSED_PARAM, char **argv) |
| 28 | { | 35 | { |
