-
Notifications
You must be signed in to change notification settings - Fork 2k
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
replace history --command
with history command
#3367
Comments
Note that there is one backward incompatible aspect to this proposal: |
I agree with the sentiment of this issue, though it is unfortunate that the change would be backward incompatible. I will add that switching to a subcommand pattern isn't mutually exclusive to having (or not having) shorthand syntax. eg. Tab completion is a good argument against the need for shorthand syntax though. |
Yes, but how often do you search for the word "search" or "delete"? Also, the long option form (e.g., |
Also, note that supporting short versions of the keywords increases the number of words that cannot be implicitly searched for without having to say |
Agreed. Also I'm just one user of fish, but I almost exclusively use archaic form |
Note that due to how flags are parsed by the P.S., It's also a good example of why I feel very strongly that other places where fish allows flags to appear anyplace on the command line should be changed to stop processing flags after the first non-flag argument. |
I believe the POSIXLY_CORRECT behaviour of GNU getopts behaves in a similar way. Making fish more POSIXy aligns nicely with high level goals of fish as a well. |
Overly strict argument requirements which reject the user when we could otherwise figure it out don't strike me as a particularly worthy goal. It's something we might be stuck with if we can't "figure it out" - but for instance not being able to handle It'd be nice if we are changing up the syntax here to see what we can do to loosen it up. |
I strongly dislike the
You, @floam, on the other hand like that behavior. Given that almost all of our Too, note that the POSIX mandated behavior is my preferred behavior. It's also what is easiest to implement in a fish script such as share/functions/history.fish. I'll open another issue to discuss this and whether we should modify fish C++ code to uniformly use a leading |
One thing that's wrong in So this will really not work if the user hoped to get details about This was kind of a surprise given the length of the manpage. We'll want to get that right for this.
I didn't suggest removing the good ones.
(And if |
@krader1961 Wait, do you mean short options aliased to subcommands? My reply above assumed you meant that they'd not work when following a subcommand/always - I didn't see |
@floam, I meant that this change will remove the short option equivalent for the flags that represent subcommands. For example, Regarding your example involving grep there are good arguments for both behaviors with respect to recognizing, or not, the |
I'm on 2.4b1 and actually wanted to delete all uses of the "--delete" from my history. (Why should it even be added to the history in the first place? If you want to delete a certain operation from your history it implies that you probably don't want the delete operation, mentioning the terms you wanted to delete in the first place, to show up in your history.) |
@olbrew: Tried |
@olbrew: @faho's suggestion will work. All fish commands (but not necessarily all commands on your system) support As for why it's added to the history in the first place it's a question of consistency and what is least surprising to a user. As soon as you start special-casing things like |
@faho Thank you, that worked indeed.
That makes sense I'll remember it for the future!
Didn't think about it like that but I definitely have to agree now. I'll just keep manually deleting them then :). |
@olbrew Handy tip, if you don't want a command to show in your history (at least under default conditions), just add a space to the start of it. So when you do a |
The use of long options for history subcommands is an anti-pattern (i.e., so unusual it serves as an example of what not to do). It appears the original justification for doing so was to allow invoking more than one subcommand with a single
history
command. However, no one liked that as it was ambiguous, confusing, and made it too easy to shoot yourself in the foot. So a recent change was merged that only allows one of the long options that specifies a subcommand.This issue is to take the next logical step and actually introduce subcommands; e.g.,
history search
rather thanhistory --search
. The long option form will still be supported for the foreseeable future but will be deprecated. As part of this change we'll also remove the short options for the subcommands per this comment. That includes removing, for consistency,history -s
to meanhistory --search
orhistory search
.The text was updated successfully, but these errors were encountered: