命令行剪贴板实用程序和代码段目录
snipco的Python项目详细描述
将保存的寄存器、文件或stdin的内容复制到剪贴板,或 操纵注册表。在
安装它
要从pypi安装:
pip install snipco
从来源来看,有两种方法:
如果您有make,请运行:
^{pr2}$ 在否则,运行:
./setup.py install --user
在
使用
snipco [-h] [-g [name_or_path]] [-s [name]] [-x [name]] [-l] [-p [name]] [-f [path]] [-t [text]] [-v]
snipco [-h] [-g [name_or_path]] [-s [name]] [-x [name]] [-l] [-p [name]] [-f [path]] [-v]
要获得命令行帮助,只需运行:
snipco --help
参数
所有参数都是可选的;如果没有提供参数,则snipco将复制 stdin到剪贴板。如果-file或-text是给定的唯一参数,则 文件或引用的文本将分别复制到剪贴板。在
-h, –help | show help and exit |
-g [name_or_path], –get [name_or_path] | Copy the contents of the saved register. The named key must exist. |
-s [register_name], –set [register_name] | Save the input to a named register. Uses stdin as input unless either –file or –text is specified. |
-f [path], –file [path] | Specify a file to use instead of stdin for –set. If no other arguments are supplied, copies the contents of the given file directly to the clipboard. |
-t “text to save”, –text “text to save” | Specify quote-delimited text on the command-line instead of stdin. If no other arguments are supplied, copies the text directly to the clipboard. |
-l, –list | List the existing registers |
-p [name], –print [name] | Print the contents of the named register. The registry key must exist. |
-x [register_name], –unset [register_name] | Unset the named register. |
-v, –version | show program’s version number and exit |
示例
将文件中的文本直接保存到剪贴板:
snipco --file path/to/file.txt
或者:
cat path/to/file.txt | snipco
将文本保存到命名寄存器:
snipco --set myregister --text "Hello, world!"
将文本从注册表复制到剪贴板:
snipco --get myregister
将寄存器中的文本打印到标准输出:
snipco --print myregister
取消设置寄存器:
snipco --unset myregister
列出已保存的寄存器:
snipco --list
- 项目
标签: