Documentation ¶
Overview ¶
Copyright © 2023 Jake Romer <jmromer@tensorconclave.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2023 Jake Romer <jmromer@tensorconclave.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2023 Jake Romer <jmromer@tensorconclave.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeDirectory ¶
func ChangeDirectory(target string)
ChangeDirectory resolves the given path to an absolute path Logs an entry to the history log and refreshes the project listing
func Execute ¶
func Execute()
Execute is called by main.main(). It only needs to happen once to the rootCmd.
func FzfPreview ¶
func FzfPreview(label string)
FzfPreview triggers a preview (file listing) of the directory associated with the given project label.
List the files in the directory associated with the given project label. Used in the FZF preview window. Attempts to do this using exa, then tree if exa is unavailable or fails. Falls back to ls if both fail.
Examples: pd --fzf-preview my-project Documents/projects pd --fzf-preview my-other-project
func RefreshLog ¶
func RefreshLog(searchForProjects bool)
RefreshLog finds all version-controlled projects $HOME and refresh the history. Refreshing the history removes any directories that no longer exist, and re-aggregates and re-ranks entries.
func SelectProject ¶
func SelectProject()
Use FZF to select a project directory, printing to stdout the absolute path to the project directory.
Types ¶
type LogEntry ¶
Each entry in the pd history file consists of a count, an abs path, and the colored project label to be used in the FZF interface.
func (LogEntry) LabelFormatted ¶
Project label, formatted (ansi-color)
func (LogEntry) LogLine ¶
History entry format is CSV with `count`, `absolute path`, and `project label`
func (LogEntry) WriteLogLine ¶
Write the given LogEntry to the given file handle.