Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an output mode with network-absolute paths #1497

Closed
rc9000 opened this issue Feb 19, 2024 · 2 comments
Closed

Adding an output mode with network-absolute paths #1497

rc9000 opened this issue Feb 19, 2024 · 2 comments

Comments

@rc9000
Copy link

rc9000 commented Feb 19, 2024

I often scp files between hosts and I'd find it very handy for find or fd to have a option to directly output results in this format

$HOSTNAME:/path/to/file.txt

I'm also learning rust so I gave it a quick try, it could somewhat look like this:

rc@hackbookpro:~/git/fd $ ./target/debug/fd --network-path -c never fd 
hackbookpro.home.local:/Users/rc/git/fd/contrib/completion/_fd
hackbookpro.home.local:/Users/rc/git/fd/doc/fd.1
                                                                   
rc@hackbookpro:~/git/fd $ ./target/debug/fd -h | grep network-path      
  -N, --network-path               Prepend hostname for scp copy/paste, implies -a

Would you think this is of general interest? If yes I could clean it up and submit a PR. Otherwise no hard feelings :)

@tmccombs
Copy link
Collaborator

Once #1043 is merged, you could do:

fd --format "$HOSTNAME:{}" --absolute-path -c never

Would that work?

@rc9000
Copy link
Author

rc9000 commented Feb 20, 2024

@tmccombs that's actually better than my variant, nice!

@rc9000 rc9000 closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants