别名和自定义命令管理器和运行器

alfredcmd的Python项目详细描述


===
alfred cmd
===




图片::https://img.shields.io/pypi/v/alfredcmd.svg
:目标:https://pypi.python.org/pypi/alfredcmd

…图片::https://img.shields.io/travis/gustavokatel/alfredcmd.svg
:目标:https://travis ci.org/gustavokatel/alfredcmd

…图片::https://readthedocs.org/projects/alfredcmd/badge/?version=latest
:目标:https://alfredcmd.readthedocs.io/en/latest/?badge=latest
:alt:documentation status








创建可移植的自定义命令和脚本。



目前处于beta版,但可用。

用法
----


所有配置都位于:code:`$user/.alfred/alfred.toml`

config
~~~~

代码块::toml

[variables]
mode="debug"

[function.branch]
exec="git rev parse--abbrev ref head"

[command.st]
exec="git status"

[command.cc]
exec="git commit-a{@}"

[command.push]
exec="git按{@}"

[command.b]
exec="echo{branch()}"

[command.pythoncall]
exec="~/.alfred/myscript.py::myfunction"
type="python"

run
~~~

代码块::console

$alfred st
$al cc




代码块::toml

[variables]
mode="debug"

[command.print]
exec="echo{mode}"




commands
~exec="echo{mode}"


alfred将执行的预定义命令定义如下


。代码块::toml

[command.command_name]
exec="execution_line"
type="shell"
format=true
echo=false
help="help info"

n_line**是将要调用的代码。alfred接受多行条目,这些条目
将包装在脚本文件中,并使用默认的shell执行器执行。

-**type**命令的类型。alfred当前接受"shell"和"python"命令类型

-**format**标记实例是否应在exec行中应用格式化程序。
如果为false,则不会解释占位符{}在执行之前剪切

-**帮助**将在"alfred@list"中显示的描述性消息


函数
~~~~~~~~~

函数可以创建以增强格式化期间的命令执行,其定义如下:

。代码块::toml

[函数.函数名]
exec="execution_line"
format=true

,其中:

-**函数名**是alfred在格式化程序中用来标识该函数的别名

-**execution_line**是要调用的代码。目前,alfred在函数中只接受一行shell命令。

-**format**标记实例是否应在exec行中应用格式化程序。
如果为false,则不会解释占位符{}/>-` al[fred]@help`show help
-`al[fred]@list`列出所有命令
-`al[fred]@version`show version

----


stable release
~~~~~~~~~~~~~~~~~

>要安装alfred,请在终端中运行此命令:

。代码块::console

$pip install alfredcmd

这是安装alfred的首选方法,因为它总是安装最新的稳定版本。

/>. _ pip:https://pip.pypa.io
_ python安装指南:http://docs.python guide.org/en/latest/starting/installation/



代码块::控制台代码块::console

$curl-ol https://github.com/gustavokatel/alfredcmd/tarball/master

一旦您有了源代码的副本,就可以使用:

代码块::console

$python setup.py install



…_ Github回购协议:https://github.com/gustavokatel/alfredcmd
…_ tarball:https://github.com/gustavokatel/alfredcmd/tarball/master



credits
----


>这个包是用cookiecutter和"audreyr/cookiecutter pypackage"项目模板创建的。

。_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` audreyr/cookiecutter pypackage`:https://github.com/audreyr/cookiecutter pypackage



=
=
历史
==



<0.1.0(2018-03-21)
----

*在pypi上首次发布。



欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java获取textview的文本并将其粘贴到另一个上   java ImageIO。write()不保存文件   java H2数据库排序字符串时间戳,格式为yyyyMMdd'T'hh:mm:ss。SSSSSSS'Z'   java匿名类与静态字段   java将一个句子拆分为字符串数组,并保留特殊字符或空格   JavaBIRT报告引擎。计算Javascript表达式时出错   日志表的java MySQL隔离级别读取未提交   java Android调用意图权限   java如何在iText 7中查找文本位置和边界   从Groovy调用Java类主方法时,避免参数数量不正确   java libGDX:在批处理调用stage constructor时,为舞台上的演员绘制纹理作为背景   java randoop可以利用usermade JUnit测试生成测试吗?   java Eclipse工作区将不再显示我的项目