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

abort git-alias when too many arguments given. #426

Merged
merged 2 commits into from
Aug 9, 2015

Conversation

spacewander
Copy link
Collaborator

Avoid incorrect usage probably because of the missing quotes, like "git
alias cm checkout master"

@hemanth
Copy link
Collaborator

hemanth commented Aug 8, 2015

👍

@nicolaiskogheim
Copy link
Collaborator

This is a good idea.

Maybe we could just print a usage message instead?

@spacewander spacewander force-pushed the update-for-new-version branch from ef97960 to caff332 Compare August 9, 2015 07:05
@spacewander
Copy link
Collaborator Author

Just add a "usage" banner

@nicolaiskogheim
Copy link
Collaborator

I'm sorry I didn't just do this straight away. I was thinking we should do it like i.e git rebase does it.

error: unknown option `fsjljksldf'
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
   or: git-rebase --continue | --abort | --skip | --edit-todo

etc..

as in

error: too many arguments
usage: git alias                         # list all aliases
  or: git alias <search-pattern>         # show aliases matching pattern
  or: git alias <alias-name> <command>   # alias a command

( I think the comments was nice so I left them in, although git doesn't usually do it that way)

And maybe we should call it <search-pattern>, because it is a regex. Then you can edit the man page to say search-pattern instead of search-term as well.

Avoid incorrect usage probably because of the missing quotes, like "git
alias cm checkout master"
@spacewander spacewander force-pushed the update-for-new-version branch from caff332 to 9859396 Compare August 9, 2015 11:35
@spacewander
Copy link
Collaborator Author

All right, updated it.

@hemanth
Copy link
Collaborator

hemanth commented Aug 9, 2015

👍

hemanth added a commit that referenced this pull request Aug 9, 2015
abort git-alias when too many arguments given.
@hemanth hemanth merged commit 3632ad9 into tj:master Aug 9, 2015
@qw3rtman qw3rtman mentioned this pull request Dec 27, 2015
tardypad pushed a commit to tardypad/git-extras that referenced this pull request Jul 13, 2016
abort git-alias when too many arguments given.
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.

4 participants