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

z: add -c parameter to the command description #5262

Merged
merged 6 commits into from
Feb 18, 2021

Conversation

crs1138
Copy link
Contributor

@crs1138 crs1138 commented Feb 12, 2021

Details:

  • add the -c parameter to the z command that enables user to go to a subdirectory of the current directory
  • The page (if new), does not already exist in the repo.
  • The page is in the correct platform directory (common/, linux/, etc.)
  • The page has 8 or fewer examples.
  • The PR title conforms to the recommended templates.
  • The page follows the content guidelines.
  • The page description includes a link to documentation or a homepage (if applicable).

Details:
---
* add the `-c` parameter to go to a subdirectory of the current
  directory
@CLAassistant
Copy link

CLAassistant commented Feb 12, 2021

CLA assistant check
All committers have signed the CLA.

@tldr-bot
Copy link

The build for this PR failed with the following error(s):

pages/common/z.md:30: TLDR005 Example descriptions should end in a colon with no trailing characters

Please fix the error(s) and push again.

@bl-ue bl-ue added the page edit Changes to an existing page(s). label Feb 12, 2021
@@ -26,3 +26,7 @@
- Remove the current directory from `z`'s database:

`z -x .`

- Go to the directory that is a subdirectory of the current directory.
Copy link
Contributor

@bl-ue bl-ue Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crs1138 it appears that z -c is the equivalent of cd. If (and only if) this is true, please apply this suggestion:

Suggested change
- Go to the directory that is a subdirectory of the current directory.
- Go to the directory that is a subdirectory of the current directory (equivalent of `cd`):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback. I've applied the changes you requested. Not sure how to proceed now. Can I resubmit this PR or better to make a new one?

@bl-ue
Copy link
Contributor

bl-ue commented Feb 12, 2021

@crs1138 the CLA isn't working because the email address that you used for the commit (jpozivil@leadtech.com) isn't added to your GitHub account. To fix this, you can either:

  1. Change the email you used for the commit† to one of the emails attached to your GitHub account,

  2. Or, preferrably (and much easier), add the email you used for this commit (jpozivil@leadtech.com) to your GitHub account.

†To change the email address of the last commit, run this command:

git commit --amend --author="Jan Honza Pozivil <email addres that you want to use instead>"

Details:
---
* add the `-c` parameter to go to a subdirectory of the current
  directory
Details:
---
* applied requested changes
* committed with my an email matching my Github username
@bl-ue
Copy link
Contributor

bl-ue commented Feb 12, 2021

@crs1138 Thank you. Now please sign the CLA.

@crs1138 crs1138 requested a review from bl-ue February 12, 2021 13:45
Copy link
Contributor

@bl-ue bl-ue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The man page says about -c: restrict matches to subdirectories of the current directory. But it seems to me that it's just cd. 🤔

LGTM!

@crs1138
Copy link
Contributor Author

crs1138 commented Feb 12, 2021

Not quite it can cd much deeper with a simple syntax:
z -c foo can be equivalent of cd bar/car/dar/food-whatever. I keep looking it up frequently as I have two projects with similar tree structure and sometimes I want to stay in the project that is less frequently used. And there's no man z and z --help only lists the parameters with no explanation of what they do.

@bl-ue
Copy link
Contributor

bl-ue commented Feb 12, 2021

Hmm...I can't figure how to use -c then.

$ pwd
/Users/me/a
$ tree
.
└── b
    └── c
        └── d
            └── e
                └── f
                    └── g

6 directories, 0 files
$ z -c g
$ pwd
/Users/me/a
$ z g -c .
$ pwd
/Users/me/a
$

Also, however I installed it, I have the manpage.

@crs1138
Copy link
Contributor Author

crs1138 commented Feb 12, 2021

Hmm, I used brew to install it if I'm not mistaken. I just assumed no one had the man pages.

You gotta navigate to the g folder first so there's a record of that folder in z's frecent records.

@crs1138
Copy link
Contributor Author

crs1138 commented Feb 12, 2021

frecent

That stands for frequently recent, it's not a typo.

@bl-ue
Copy link
Contributor

bl-ue commented Feb 12, 2021

Ah I see, that works well! Thank you. Maybe the example description should be reworded.

@sbrl
Copy link
Member

sbrl commented Feb 12, 2021

Ah, frecent is a thing I've seen around. It's an algorithm for ranking things. Firefox switched to it a while back for ranking items in the list of suggestions when you're typing into the address bar of the browser. We should keep the word as-is.

Example further reading: https://github.com/johnsylvain/frecent

Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Copy link
Member

@sbrl sbrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @crs1138!

@sbrl sbrl merged commit 49852ef into tldr-pages:master Feb 18, 2021
@crs1138 crs1138 deleted the z-command branch February 19, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
page edit Changes to an existing page(s).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants