Code Monkey home page Code Monkey logo

aliases's People

Contributors

artdevjs avatar bennidi avatar coolbrg avatar felixwiemuth avatar guilherme avatar katrinleinweber avatar mapanett avatar sebglazebrook avatar zsprackett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aliases's Issues

man pages

Proposal: man pages to enhance the documenation

Problem

The cli command descriptions only allow 1 line of text

Solution

Using man pages will allow us to describe the commands in more detail and provide clear examples of how you can use the commands in different situations.

Thread `main` Panicked

OS: Ubuntu 20.04.1 LTS on Windows 10 x86_64

I am getting this error while initiating

❯ aliases init
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }', /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:845
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Redhat support?

any chance for rhel, centos, and fedora support?

if not, any chance on build instructions

Error on 'eval "$(aliases init --global)"'

Hello,

I have been using aliases for a few weeks now, but recently noticed an error when I reload my shell:

thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: MissingFieldError("users")', ../src/libcore/result.rs:746
note: Run with `RUST_BACKTRACE=1` for a backtrace.

When attempting to use aliases in my project directory I receive the same error as above, and any aliases set with the .alias file returns the error -bash: archive: command not found

Here is my alias file for reference:

archive:
  command: . archive-project.sh
  backout_seconds: 3
new:
  command: . new-project.sh
  backout_seconds: 3

And I am on OSX 10.10.5

Please let me know if you need any additional information from me. Thanks!

Not loading on Ubuntu 15.10

Hi, after installing the deb file in the repository, I created a simple .aliases file in a directory. I could see the alias by running aliases and aliases list but it did not seem like the alias was actually loaded into the environment even after running aliases rehash. I can run the command by typing aliases exec . "cmd" but this is inconvenient and not the default behavior, I assume. Is there anything I'm missing or need to run in order to fix this and get default behavior?

Deb Package Installation Fails

Installation of deb package fails with this method;

sudo dpkg -i aliases_0.8.1.deb

Output as below:

dpkg-deb: error: 'aliases_0.8.1.deb' is not a debian format archive
dpkg: error processing archive aliases_0.8.1.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 aliases_0.8.1.deb

Homebrew install warning

Running brew install sebglazebrook/aliases/aliases results in the following warning:

Warning: Calling <<-EOS.undent is deprecated!
Use <<~EOS instead.
/usr/local/Homebrew/Library/Taps/sebglazebrook/homebrew-aliases/aliases.rb:21:in `caveats'
Please report this to the sebglazebrook/aliases tap!

Thought you might like to know.

alias prioritisation not working properly

To replicate:

mkdir /tmp/test-dir
cd /tmp/test-dir
aliases init --user foo

# now add an alias in the .aliases-foo file with the name 'bar' command: "hello from /tmp/test-dir"

cd ~

# now add an alias in the .aliases file named 'bar' command: "hello from home"

aliases rehash

cd /tmp/test-dir

aliases list --directory ${PWD}
=> returns nothing

bar
=> "hello from home"

Nested aliases or reference to other alias.

Currently to achieve nested aliases we have to embed entire case switch statement inside the .aliases file that pick up the aliasing parts. Might be awesome to be able to create nested aliases? Would allow us to create very advanced aliases.

Warn the user if he already have an alias

As a User
I want to know when I am adding an alias that is already defined
So that I don't add one on top of the other

The other frame from this is:
As a User
I want to have the ability to overwrite aliases
So that I can refine one alias that was defined before (made a mistake typing, or want to improve the command)

executing alias gives "bash: command not found"

Hi,

Trying to add some simple aliases with your plugin.

  1. $cd ~ && aliases init
  2. $vim .aliases
  3. added
la: 
  command: ls -la

to .aliases file
4. $aliases rehash
5. $la

Getting: -bash: alias: la: not found
Only way I could execute the alias is with $aliases exec . la
Am I doing something wrong or?

Handle when removing aliases from root level aliases file

I'm getting this error when I do: aliases remove with an alias that was previously defined in the ~/.aliases.

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-mac/build/src/libcollections/vec.rs:1392
note: Run with `RUST_BACKTRACE=1` for a backtrace.

I'll work on this PR soon

Add the ability to remove aliases dynamically

Currently you can add dynamically an alias. It would be nice to remove it dynamically as well.

As a User
I want to remove an aliases dynamically
So I don't have to edit the file, having the risk of making a typo and also having a quicker feedback.

Remove aliases via cli for different users and directories

Proposal: Increased cli for aliases remove

Currently aliases remove only takes an alias name.

User story

As a user
I want to be able to remove user aliases or directory specific aliases via the cli
So I don't have to manually edit the .aliases file

Suggested cli enhancements

# remove for a user
aliases remove --user superman fly

# remove for a directory, this does not allow a --local option
aliases remove --directory ~/code/superman fly

# remove for local directory, this does not allow a --directory option
aliases remove --local fly

# remove for directory and user, this does not allow a --local option
aliases remove --directory ~/code/superman --user superman fly

# remove for local dir and user, this does not allow a --directory option
aliases remove --local --user superman fly

aliases rehash not working?

I truly hope I understand this tool

So I run "aliases rehash" and get a '0' return code and no output
I assume my aliases should be available bu when I try to run them I get nothing. the only way they run
is with the aliases exec . command

what am i missing here?

Cloning a user repo doesn't "just work"

When I try to clone repo it blows up saying "user not found"

It looks like the code first checks to see if the user exists and if not found it blows up.

It should be able to clone a repo for a user that doesn't exist and then simply create the user afterwards

Allow user's to search for aliases across external alias repos

Proposal: aliases search

So this is just documenting mu thought process around this.

Given you can clone a user and it automatically looks for user's in github.com/username/dot-aliases

Example command/usage"

aliases search git commit introduced string

This under the covers makes an external request to an aliases search server which caches all known external aliases and returns results that match the query string.

How does the cache get built?

When a user aliases clone successfully a ping is sent to the aliases search server to index that user.

What does the search search use as search data?

It uses all the current data about an alias but we also add a description field to allow for free text.

What can a user do once they have found an alias they want to use?

  • Copy it locally
    • straight copy of the alias to a local user/directory
  • Clone it
    • clone the user's alias and there can a further update process that can keep it in sync, with prompts to confirm as this could be dangerous.
  • Use it once
    • maybe copy it to clipboard or something

Installation Instructions

Hey there, this looks like such a cool project and I'd like to check it out. However, the Compile from Source section hasn't been deplaceholdered yet, and I'm not sure I can figure out how to run a ruby project on my own... Any chance you could give us some instructions in the near future?
Great Work! (I think)

P.S. I'm on Arch Linux

Error when adding alias confirmation

~.aliases

gp:
  command: git push
  confirm: true

aliases rehash

RUST_BACKTRACE=1 aliases rehash
thread '<unnamed>' panicked at 'failed to execute child: Too many open files (os error 24)', src/aliases/factories/mod.rs:34
stack backtrace:
   1:        0x10758b26a - std::sys::backtrace::tracing::imp::write::h4b09e6e8c01db097
   2:        0x10759069f - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:        0x10758f645 - std::panicking::default_hook::h96c288d728df3ebf
   4:        0x10758fc56 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:        0x10758faf4 - std::panicking::begin_panic::hfbeda5aad583dc32
   6:        0x10758fa12 - std::panicking::begin_panic_fmt::h4fe9fb9d5109c4bf
   7:        0x1075080c5 - aliases::aliases::factories::ShimFileFactory::create::h74ee660c32ba5fe8
   8:        0x1074f8dd9 - <F as crossbeam::FnBox>::call_box::h1327d96983356799
   9:        0x107590c5a - __rust_maybe_catch_panic
  10:        0x1074fb9a5 - <F as alloc::boxed::FnBox<A>>::call_box::h5e692c65c59383ce
  11:        0x10758eeb4 - std::sys::thread::Thread::new::thread_start::h022e3887023c6290
  12:     0x7fffa822faaa - _pthread_body
  13:     0x7fffa822f9f6 - _pthread_start
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', ../src/libcore/result.rs:799
stack backtrace:
   1:        0x10758b26a - std::sys::backtrace::tracing::imp::write::h4b09e6e8c01db097
   2:        0x10759069f - std::panicking::default_hook::{{closure}}::h1d3243f546573ff4
   3:        0x10758f645 - std::panicking::default_hook::h96c288d728df3ebf
   4:        0x10758fc56 - std::panicking::rust_panic_with_hook::hb1322e5f2588b4db
   5:        0x10758faf4 - std::panicking::begin_panic::hfbeda5aad583dc32
   6:        0x10758fa12 - std::panicking::begin_panic_fmt::h4fe9fb9d5109c4bf
   7:        0x10758f977 - rust_begin_unwind
   8:        0x1075baf70 - core::panicking::panic_fmt::h4395919ece15c671
   9:        0x10750f5a1 - core::result::unwrap_failed::h826d1e65f62f2c7c
  10:        0x10750f952 - crossbeam::scoped::JoinState::join::h9e38daeeb9d6bd47
  11:        0x1074f8eab - <F as crossbeam::FnBox>::call_box::ha25b0713f0de7f23
  12:        0x10750faee - crossbeam::scoped::Scope::drop_all::h3e0a95c5837743d3
  13:        0x107501cf1 - aliases::aliases::commands::rehash::Rehash::execute::ha7c83d1afa68516c
  14:        0x10750cc93 - aliases::aliases::app::App::execute_rehash::h4d407e2fc58f2818
  15:        0x10748f6f5 - aliases::main::h09ef9aae42dcce6b
  16:        0x107590c5a - __rust_maybe_catch_panic
  17:        0x10758f186 - std::rt::lang_start::haaae1186de9de8cb

Alias execution interactive mode

Proposal: Interactive mode when executing an alias

Problem

Depending on how you use aliases things can get quite abstracted.

You can nest aliases, use positional parameters, pass through arguments etc.

An interactive mode would help to break down aliases into each of their steps, with confirmation at each step.

E.g.

Imagine I have an alias:

console

console maps to:

build-container && run-container bundle exec rails console

build-container maps to:

docker build -t my-image .

run-container maps to:

docker run -ti -v ${PWD}:/code my-image

If I want to understand the magic behind the console curtain a user could set:

export ALIASES_INTERACTIVE=true

and then when they run console at each step, before execution the user sees the current stdout and stderr and the proposed command and gets to choose whether they want to continue or not.

This proposed command will include any positional params or arguments included, so basically if the user copied it and run it in another shell it would work.

aliases not recognized

I'm on Mac OS Monterey
GNU bash, version 5.1.12(1)-release (x86_64-apple-darwin19.6.0)

$ aliases

ALIAS  COMMAND                      CONFIRM
build  npm run build                false
debug  grc tail -f ../../debug.log  false
dev    npm run dev                  false

$ dev
bash: dev: command does not exist

Clearly, aliases is installed and working properly, until I actually wanna execute an alias.
I've been scratching my head for the better part of an hour trying to figure this out and I can't make sense of it. It works just fine on my laptop - also a Mac running Monterey.

Anyone else have this issue?

Not executable when installed via brew

Hi. I was just trying out aliases and this happened


aliases init
-bash: /usr/local/bin/aliases: Permission denied
ls -l /usr/local/Cellar/aliases/0.8.1/bin/aliases
-r--r--r--  1 matthewpanetta  admin  5748912 Feb  1 21:23 /usr/local/Cellar/aliases/0.8.1/bin/aliases

Autocompletion of aliases

Proposal: smart/dynamic auto-completion of aliases

Problem

If I have an alias g that completes to 'git' I don't see the git bash completion

Solution

Dynamically work out the command being entered and direct the bash completion to the right command

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.