aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
Commit message (Collapse)AuthorAgeFilesLines
* Support empty XDG_CACHE_HOME environmental variableLuca Matei Pintilie 2023-09-181-9/+19
| | | | | | | | | | | Follow-up from e5b6e24a621, fixes a scenario in which XDG_CACHE_HOME is set, but it's set to an empty string instead of a path. From the documentation >If $XDG_CACHE_HOME is [...] empty, a default equal to $HOME/.cache should be used. https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html Signed-off-by: Luca Matei Pintilie <luca@lucamatei.com>
* Run ‘cargo fmt’Thomas Voss 2023-09-181-3/+8
|
* Reword error messageThomas Voss 2023-09-181-1/+1
|
* Add default cache path if XDG_CACHE_HOME does not existLuca Matei Pintilie 2023-09-181-4/+12
| | | | | | | | | | | If the XDG_CACHE_HOME environmental variable does not exist then mmv will default to "$HOME/.cache"[1] If HOME does not exist then it will panic like before [1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html Signed-off-by: Luca Matei Pintilie <luca@lucamatei.com>
* Add MMV_NAME and MCP_NAME compile-time variablesv1.3.0Luca Matei Pintilie 2023-09-141-3/+10
| | | | | | | | | | | | | | | Due to the sheer popularity of the "mmv" name it might conflict with other programs installed on the user's computer. As such the MMV_NAME and MCP_NAME environmental variables can control the program's name at compile time, allowing the user to avoid name conflicts with other programs. If the variables are not set then they will silently default back to "mmv" and "mcp" respectively. Signed-off-by: Luca Matei Pintilie <luca@lucamatei.com> Co-authored-by: Thomas Voss <mail@thomasvoss.com>
* Add support for copying filesThomas Voss 2023-08-251-8/+38
|
* Use nanosecs for backup dirnameThomas Voss 2023-08-151-1/+1
| | | | | | The user doesn’t need this level of precision, but using seconds might cause problems if two processes are spawned in quick succession to each other. Since we have the options, why not use the most precise one?
* Name backup directories after current epochThomas Voss 2023-08-151-2/+5
|
* We can terminate with EOF when using -iv1.0.1Thomas Voss 2023-08-121-9/+0
|
* Print to stderr with -dThomas Voss 2023-08-121-1/+1
|
* Run ‘cargo fmt’Thomas Voss 2023-08-121-5/+20
|
* When using -e, swap back to newlines from nulThomas Voss 2023-08-121-5/+5
|
* Change --dryrun to --dry-runThomas Voss 2023-08-121-1/+1
|
* Make -v 500x betterThomas Voss 2023-08-121-11/+34
|
* Swap flags.nobackup for flags.backupThomas Voss 2023-08-121-5/+17
|
* Remove the cache directory after successful operationThomas Voss 2023-08-121-2/+7
|
* Add the -n optionThomas Voss 2023-08-121-11/+15
|
* Backup the files being renamedThomas Voss 2023-08-121-0/+31
|
* Update cerm to v1.1.1Thomas Voss 2023-08-121-26/+8
|
* Add a helper ‘disp()’ functionThomas Voss 2023-08-071-3/+7
|
* Take greater advantage of itertoolsThomas Voss 2023-08-071-6/+8
|
* Add an ‘is_terminal’ predicateThomas Voss 2023-08-071-2/+6
|
* Use block comments like a C-chadThomas Voss 2023-08-061-3/+3
|
* Fix comment formattingThomas Voss 2023-08-061-1/+1
|
* Get -0 and -i to play nice with each otherThomas Voss 2023-08-061-31/+61
|
* Fix retarded rustfmt shitThomas Voss 2023-08-061-2/+2
|
* Implement the -i flagThomas Voss 2023-08-061-48/+112
|
* Add missing flag to usage stringThomas Voss 2023-08-061-1/+1
|
* Move args parsing to Flags::parseThomas Voss 2023-08-061-25/+28
|
* Improve the -d flagThomas Voss 2023-08-061-9/+12
| | | | | | | Now when performing a dry run, you are shown the direct move from src to dst. This is a lot more helpful since the end user doesn’t really care about whatever temporary folder we store things in; the user just wants to make sure the command he’s about to execute will do what he expects.
* Make the -e flag work as intendedThomas Voss 2023-08-061-8/+18
|
* Formart the codebaseThomas Voss 2023-08-061-20/+19
|
* Remove the error module and use cermThomas Voss 2023-08-021-48/+66
| | | | Fuck proxit, all my homies hate proxit.
* Use my new “proxit” crateThomas Voss 2023-08-011-4/+6
|
* Move some code out to move_path()Thomas Voss 2023-07-291-15/+14
|
* Support -v, and make -d imply -vThomas Voss 2023-07-291-5/+12
|
* Build a 3-tuple intead of mutating a 2-tupleThomas Voss 2023-07-291-19/+15
|
* Copy+Delete because filesystemsThomas Voss 2023-07-291-2/+13
| | | | | | | | | | | | Turns out that ‘fs::rename()’ calls ‘rename(2)’ under the hood. This is a problem because the temporary directory we use is typically located on a different filesystem than your home directory for example, and so this would fail. The shitty workaround here is to copy the files and then delete them. But it just keeps getting better! Turns out that despite the fact that ‘everything is a file’ on *NIX, we cannot just call ‘fs::copy()’ or ‘fs::remove_file()’ on directories; that would be too smart.
* Minor comment reformatThomas Voss 2023-07-291-2/+1
|
* Reorder imports, and remove unused onesThomas Voss 2023-07-291-2/+3
|
* Genesis commitThomas Voss 2023-07-291-0/+255