Skip to content

Implementing rename subcommand - #179

Merged
thomaslaurenson merged 4 commits into
thegraydot:mainfrom
sjoblomj:rename-subcommand
Aug 22, 2026
Merged

Implementing rename subcommand#179
thomaslaurenson merged 4 commits into
thegraydot:mainfrom
sjoblomj:rename-subcommand

Conversation

@sjoblomj

Copy link
Copy Markdown
Contributor

No description provided.

@thomaslaurenson

Copy link
Copy Markdown
Collaborator

Made a few commits, hope that is ok. I am in the swing of working on mpqcli at the moment.

  • Path separators: rename now converts / to \ in the new name, so folder1/file.txt stores as folder1\file.txt like add does - I how this is ok, and you specifically did not add the check as it is user input
  • Completions: rename added to bash (was absent) and PowerShell and fish guards
  • Docs: rename added to the help string and introduction.md

Leaving the PR open for review and feedback 😄

@sjoblomj

sjoblomj commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Great additions, thanks for fixing the gaps I apparently made. <3

I like that it by default converts from / to \ - and maybe we should do more file name sanitizing in addition? But it would be nice if the user could be in complete control and override that sanitizing.

But then again, we already have many flags (at least to add), and it'd be unfortunate to introduce even more... But I always go for allowing user control rather than de facto forbidding valid file name characters. I'd recommend we add a --no-filename-sanitizing flag (maybe with a better, shorter name) to add and rename.

@sjoblomj

sjoblomj commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Or, one alternative could be to add such a flag only to rename, since add has so many flags already. Users ought to very seldomly want to use weird characters anyway, and if they do they can then rename the file instead. But that is perhaps rather unintuitive and a bit of a "UX gotcha". Just thinking out loud here 🙃

@MikaMika

Copy link
Copy Markdown

converts from / to \

That sounds good to me.
If this is a default behavior, I'd enjoy remove to be updated with it. Currently this is what I do:

find "Trash" -type f | cut -d'/' -f2- | tr '/' '\\' | mpqcli remove "$mpq" -

Thanks for your continuously amazing work.

@thomaslaurenson

Copy link
Copy Markdown
Collaborator

Thanks for the feedback 👍 I am going to merge this PR, and work on the the path separator slashing issue in another PR (see #181) - as it affects multiple other subcommands. Many thanks @sjoblomj 🥇

@thomaslaurenson
thomaslaurenson merged commit 35485d9 into thegraydot:main Aug 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants