Comments (6)
This is a cool idea, and it also tackles an issue with the current setup, in that if you edit a directory name things can fail. Getting rid of directory names avoids that. Filename being the same in two directories shouldn't be an issue, all that happens behind the scenes is matching up line numbers, so should be fine.
Somewhat related, the /home/my_user problem could be fixed by actually parsing the incoming files and printing them out in a way that would use ~
. But if we decide to do file name only then that won't matter
from pipe-rename.
I created a PR for this (#69)! @bew and/or @assarbad could I have you make sure the code looks good to you?
from pipe-rename.
I merged it anyway 😛 Reopen if you run into any problems
from pipe-rename.
Just a note on ~
, that's again shell behavior (like glob expansion from #39). And what's more there's not just ~
for yourself but also ~jdoe
to refer to the home directory of user jdoe
. In other words, you can also use a (Bash etc) shell builtin like echo ~
and you'll see the already expanded path. So that's what your program really gets to see in the main function. In order to show a ~
inside the editor you'd have to revert that preprocessing by the shell (ending up with the behavior that is being bemoaned in #39 as "Windows behavior"). Not sure you'll want to open this can of worms.
Simply stripping leading paths seems like introducing less complexity all the while solving already existing problems (when changing directory names).
PS: IIRC the ~
part is based on the same lookups getent
uses through glibc/libnss in Bash, whereas $HOME
could be overridden. I don't know how consistent different shells across different Unix flavors behave in that regard.
from pipe-rename.
Started working on this.
I second the idea that this ought to show the /path/to/original -> /path/to/renamed
preferably as /path/to/original -> renamed
(or even original -> renamed
) ... in fact I am wondering why we don't do that already, since renamer
doesn't allow changes to intermediate path elements as far as I could see.
FYI: for now I have gone with the option names -n
and --name-only
.
from pipe-rename.
Sorry, a bit late to the party. I'll have a look anyway ;)
from pipe-rename.
Related Issues (20)
- Customize the editor command HOT 3
- Error: Nonexisting input files. Aborting. HOT 5
- Error: Nonexisting input files. Aborting. @FreeBSD HOT 14
- Create missing directories? HOT 2
- About tagging the releases HOT 2
- using pipe-rename in a pipe seems to misconfigure terminal HOT 6
- Crashing when editor closes, after editing a given line HOT 4
- Misbehaving on Windows without %EDITOR% HOT 2
- Sharing violation between Notepad and renamer on Windows HOT 3
- Idea: post-processing of certain characters HOT 2
- Can't pipe file names to pipe-rename without -y HOT 5
- `--rename-command` is broken for commands with arguments
- Provide binaries, please HOT 8
- Fix git workflows to automatically create binaries HOT 1
- About 1.6.5 release HOT 2
- Found an issue when renaming overwrites existing file HOT 2
- Doesn't seem to work with VSCode HOT 11
- Odd error message when attempting to pass full path to --editor HOT 5
- Renaming on a drive with case-insensitive file system (or a file system placed into that mode) HOT 1
- LICENSE file? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pipe-rename.