Fabric icon indicating copy to clipboard operation
Fabric copied to clipboard

[Feature request]: Namespace / prefix for fabric aliases

Open superclarkk opened this issue 1 year ago • 2 comments

What do you need?

Being brand new to the project, this is a very humble request, not meaning to step on Daniel's toes if there are reasons why it's not a good idea. However, there are already 103 patterns, and counting. Although they are amazing, speaking as a linux/bash user, they do tend to pollute the environment. Wouldn't it be better if they all had a common prefix? fab_ seems like a perfect one to me, considering fabric is "fab(ulous)". This would have the added bonus of making tab completion much more useful, because fab_ followed by a would list all the fabric commands/patterns.

superclarkk avatar May 29 '24 21:05 superclarkk

If I understand correctly what you are saying, I tried unsuccessfully ( https://github.com/danielmiessler/fabric/issues/318) twice to address this. I have an updated bash script if you are interested.

On Wed, May 29, 2024 at 5:33 PM superclarkk @.***> wrote:

What do you need?

Being brand new to the project, this is a very humble request, not meaning to step on Daniel's toes if there are reasons why it's not a good idea. However, there are already 103 patterns, and counting. Although they are amazing, speaking as a linux/bash user, they do tend to pollute the environment. Wouldn't it be better if they all had a common prefix? fab_ seems like a perfect one to me, considering fabric is "fab(ulous)". This would have the added bonus of making tab completion much more useful, because fab_ followed by a would list all the fabric commands/patterns.

— Reply to this email directly, view it on GitHub https://github.com/danielmiessler/fabric/issues/447, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPVKQXCNTMGOJNH2AZUJLTZEZCTFAVCNFSM6AAAAABIPXLUW2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZDIMRYGM3DCNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

snafu4 avatar May 30 '24 00:05 snafu4

No. I think what you're looking for in #318 is this...

https://github.com/danielmiessler/fabric/discussions/312

However, I think you'd be better off using aliases. These are sourced from $HOME/.config/fabric/fabric-bootstrap.inc.

I could easily rename the aliases with a prefix, but that would need to be done again with each install. It would be much better to have a standard baked in.

superclarkk avatar May 30 '24 01:05 superclarkk

Regarding #312 and #318

Shell completions for Fabric has been implemented for a while now.

You can even install them using a one-line curl command::

https://github.com/danielmiessler/Fabric?tab=readme-ov-file#quick-install-no-clone-required

I'm closing this old issue. If you have any usability issues with Fabric, feel free to create a new issue and I'll take a look.

ksylvan avatar Aug 31 '25 22:08 ksylvan

@ksylvan Please re-read the original issue. This ticket is not about bash completion. It's about environment pollution. Please re-open.

superclarkk avatar Sep 02 '25 10:09 superclarkk

Actually, hold off on my last request. I haven't used fabric since version 1.2, so maybe it's not applicable now. I'll report back after I've upgraded, and if the original issue hasn't already been addressed.

superclarkk avatar Sep 02 '25 10:09 superclarkk

See Add aliases for all patterns.

"In order to add aliases for all your patterns and use them directly as commands ie. summarize instead of fabric --pattern summarize"

When you make them commands, they pollute the environment, as stated in the original post. If you gave them a common prefix, then they would be much more user friendly and intuitive.

superclarkk avatar Sep 02 '25 11:09 superclarkk

@superclarkk I see what you mean. For example, if all the commands started with "f_"

ksylvan avatar Sep 11 '25 13:09 ksylvan

@superclarkk I changed the README sections about the command aliases like this:

See https://github.com/danielmiessler/Fabric?tab=readme-ov-file#add-aliases-for-all-patterns

ksylvan avatar Sep 11 '25 14:09 ksylvan

This change gives you the ability to prefix all your fabric patterns with "fab_" if you wish, and it's a nonbreaking change.

ksylvan avatar Sep 11 '25 14:09 ksylvan

That's a neat solution. Thank you!

superclarkk avatar Sep 14 '25 15:09 superclarkk