Commit graph

102 commits

Author SHA1 Message Date
Sylvestre Ledru
7f79fef2cd fix various doc warnings 2022-01-29 00:09:09 +01:00
Terts Diepraam
55a47f6fc0
Merge pull request #2863 from tertsdiepraam/clap-3
Clap 3
2022-01-20 23:14:52 +01:00
Roy Ivy III
2e251f91f1 0.0.12 2022-01-19 05:35:00 -06:00
Terts Diepraam
8872485922 Merge branch 'main' into clap-3 2022-01-17 13:25:51 +01:00
Sylvestre Ledru
1fbda8003c coreutils 0.0.8 => 0.0.9, uucore_procs 0.0.7 => 0.0.8, uucore 0.0.10 => 0.0.11 2022-01-16 17:05:48 +01:00
Terts Diepraam
89112fb1c2 install: clap 3 2022-01-11 19:16:47 +01:00
Sylvestre Ledru
43e85ae9ce install: Also import fs from uucore 2021-10-24 00:33:00 +02:00
Sylvestre Ledru
a5bc2211d5 Ignore two question-mark warnings 2021-10-23 20:59:19 +02:00
Sylvestre Ledru
59e9870c56 Prepare version 0.0.8 2021-10-23 19:21:50 +02:00
Jan Verbeek
1edd2bf3a8 Do not discard non-OS error messages 2021-09-14 15:11:54 +02:00
Jan Verbeek
259f18fcab Update message quoting and filename printing 2021-09-07 19:49:01 +02:00
Sylvestre Ledru
0525d9bf6a
Remove useless import of USimpleError 2021-08-28 11:44:34 +02:00
Sylvestre Ledru
0e49913b84
Merge branch 'master' into chmod/compat 2021-08-28 11:21:26 +02:00
Andreas Hartmann
ce0d9bce28 install: Adapt to modified backup_control interface 2021-08-25 16:33:50 +02:00
Michael Debertol
945e57ea22 chmod: show an error if a permission wasn't removed due to umask 2021-08-25 13:52:09 +02:00
Michael Debertol
15b40f6aa2 chmod: implement special handling of directory setuid/setgid 2021-08-25 13:52:09 +02:00
Michael Debertol
7153a595c6 chgrp: forward to chown
chgrp does mostly the same as chown.
By making chown a bit more configurable we can reuse its code for chgrp.
2021-08-24 15:22:05 +02:00
Michael Debertol
252220e9eb refactor/uucore ~ make util_name and execution_phrase functions
Since util_name and execution_phrase no longer rely on features that are
only available to macros, they may as well be plain functions.
2021-08-14 17:55:18 +02:00
Roy Ivy III
c0854000d1 refactor ~ use execution_phrase!() for usage messaging 2021-08-14 14:01:33 +02:00
Roy Ivy III
23b68d80ba refactor ~ usage() instead of get_usage() 2021-08-14 13:58:43 +02:00
Roy Ivy III
c5792c2a0f refactor ~ use util_name!() as clap::app::App name argument for all utils 2021-08-14 13:53:13 +02:00
Sylvestre Ledru
ea5097e4a0
Merge pull request #2562 from tertsdiepraam/uucore/simpler-uerror
`uucore`: simpler `UResult` and `UError`
2021-08-13 01:33:23 +02:00
Michael Debertol
1c30fb42d2 chgrp: handle empty group 2021-08-11 19:03:41 +02:00
Terts Diepraam
1649217116 uucore: remove distinction between common and custom errors
As custom errors are prefered over wrapping around common errors, the
distinction between UCommonError and UCustomError is removed. This
reduces the number of types and makes the error handling easier to
understand.
2021-08-10 17:55:28 +02:00
Andreas Hartmann
ce037bdf55 install: remove obsolete function call
The `copy_file_to_file` function was only a wrapper to a `copy` function with
the exact same interface. It has now beed removed for clarity.
2021-07-31 13:06:37 +02:00
Andreas Hartmann
4f235e9e95 install: Use uio_error to construct errors from std::io::Error
Use new macro to construct UIoError types from `std::io::Error` before
printing. This gives consistent error messages across all utilities as it
prepends custom errors to the error description for the respective application
and error type. This saves the developers from manually appending the
`std::io::Error`-specific error messages.
2021-07-31 13:06:37 +02:00
Andreas Hartmann
0461a45c9a install: Use show! macro for noncritical errors during execution
Drop the previous flags that would tell whether a noncritical error occured
during execution in favor of the `show!` macro from the error submodule.

This allows us to generate regular error types during execution to signify
failures inside the program, but without prematurely aborting program execution
if not needed or specified.

Also make verbose outputs use `print!` and friends instead of `show_error!` to
ensure verbose output is redirected to stdout, not stderr.
2021-07-31 13:06:37 +02:00
Andreas Hartmann
2b18e45ece install: Use UResult
Related to uutils#2464
2021-07-31 13:06:37 +02:00
Terts Diepraam
eae8c72793
Merge pull request #2467 from Funky185540/backup_mode_determination
backup_control: Fix backup mode determination
2021-07-20 13:27:04 +02:00
Andreas Hartmann
e07b4e9f59 install: Adapt to modified backup mode determination 2021-07-19 17:01:49 +02:00
Sylvestre Ledru
26a882551b update the dep to uucore_procs 0.0.6 2021-07-11 21:04:11 +02:00
Sylvestre Ledru
1d8a66b7d3 Update to version 0.0.7 2021-07-11 18:04:56 +02:00
Sylvestre Ledru
d3652cc3c0
Merge pull request #2457 from Funky185540/install-implement-backup
install: implement --backup, -b and -S
2021-07-04 09:57:45 +02:00
Andreas Hartmann
1a43a94e31 install: Apply rustfmt 2021-06-27 17:59:04 +02:00
Michael Debertol
2ebca384c6 all utils: enable wrap_help
This makes clap wrap the help text according to the terminal width,
which improves readability for terminal widths < 120 chars,
because clap defaults to a width of 120 chars without this feature.
2021-06-27 16:17:10 +02:00
Andreas Hartmann
df41fed640 install: Mark '-S', '-b' and '--backup' as implemented
Removes the "unimplemented" notice from the respective help texts. Stop
printing errors if the options are supplied via CLI.
2021-06-27 09:54:55 +02:00
Andreas Hartmann
5437985705 install: Implement '--backup' and '-b'
Adds the ability to perform file backups before installing newer files on top
of existing ones. Adds a status message about backups to stdout if running in
verbose mode.
2021-06-27 09:54:17 +02:00
Andreas Hartmann
49a9f359bb install: Make use of 'backup_controls' for '--backup' opts
Use the methods and types offered by the 'backup_controls' module to implement
the logic for backing up files instead of overwriting.
2021-06-27 09:54:07 +02:00
Andreas Hartmann
a85adf3c3f install: Internally rename short '-b' option
Rename from OPT_BACKUP_2 to a more descriptive name "OPT_BACKUP_NO_ARGS".
2021-06-26 00:27:08 +02:00
Andreas Hartmann
3155cd510f install: Fix argument parsing for '--backup'
The '--backup' option would previously accept arguments separated from the
option either by a space or an equals sign. The GNU implementation strictly
requires an "equals" for argument separation.

As the argument to '--backup' is optional, the equals sign mustn't be ommited
as otherwise there is no way to tell a file argument apart from an argument
that's meant for the '--backup' option. This ensures that if '--backup' is
present it either has no further associated arguments (i.e. fallback to the
default), or the arguments are separated by an equals sign.
2021-06-26 00:27:08 +02:00
Michael Debertol
0531153fa6 uutils: move clap::App creation to separate functions 2021-06-25 21:23:45 +02:00
Michael Debertol
4e62c9db71 install: support target-directory 2021-06-18 16:45:36 +02:00
Jeong YunWon
d329c7c864 install : clean up returning Err 2021-06-11 23:26:58 +09:00
Roy Ivy III
c66d67a0b9 refactor/install ~ fix cargo clippy complaint (clippy::needless_borrow) 2021-06-06 19:28:23 -05:00
Sylvestre Ledru
d8c06dd6bb use clap::crate_version macro instead of the env variable 2021-06-02 19:00:19 +02:00
Roy Ivy III
9c0c8eb59f change ~ remove 'main.rs' spell-checker exceptions 2021-05-31 08:11:31 -05:00
Jan Scheer
3aeccfd802 fix a lot of clippy warnings 2021-05-29 15:11:22 +02:00
Yağız can Değirmenci
c78a7937f8 chore: delete show_info macro and replace with show_error 2021-05-26 02:27:10 +03:00
Sivachandran
0ea35f3fbc
Implement install create leading components(-D) option (#2092)
* Implement install's create leading components(-D) option

* Format changes

* Add install test to check fail on long dir name
2021-04-19 22:03:13 +02:00
Reto Hablützel
d67560c37a fix clippy for unix 2021-04-11 16:34:19 +02:00