命令行工具 CLIKit

码农软件 · 软件分类 · 其他(Others) · 2019-07-22 15:44:13

软件介绍

CLIKit 可以帮助你用最快的方式编写一个命令行工具。

特性
    • 指定命令和子命令
    • 参数 (edit 22)
    • Boolean flags (coffee make --sugar --no-milk)
    • Options (open --title=foo --author=bar)

示例:

var manager = Manager()
manager.register("issue", "Options for issue") { argv in
    println("Say `open`, `close` or `edit`")
}
manager.register("issue open", "Opens a new issue") { argv in
    println("A new issue has been created!")
}
manager.register("issue close", "Closes an open issue") { argv in
    println("Issue has been closed.")
}
manager.register("issue edit", "Edits an issue") { argv in
    if let id = argv.shift() {
        var alert = "Editing issue #\(id). "
        if let assignee = argv.option("assignee") {
            alert += "\(assignee) will be the new assignee. "
        }
        if let milestone = argv.option("milestone") {
            alert += "The issue must be completed before \(milestone). "
        }
        println(alert)
    } else {
        println("Issue id not specified")
    }
}
manager.run()

Result:

$ ./my_cli issue open
A new issue has been created!
$ ./my_cli issue edit 22 --assignee=radex --milestone=2.0
Editing issue #22. radex will be the new assignee. The issue must be completed before 2.0. 
$ ./my_cli issue
Say `open`, `close` or `edit`




本文地址:https://codercto.com/soft/d/10699.html

上瘾

上瘾

[美] 尼尔·埃亚尔、[美] 瑞安·胡佛 / 钟莉婷、杨晓红 / 中信出版集团 / 2017-5 / 49.00元

——为什么我们会习惯性地点开某个App? ——这种使用习惯到底是如何养成的? ——为什么有些产品能让我们戒不掉,而其他的产品却不行? ——是否有什么秘诀能让用户对你的产品形成使用习惯,欲罢不能? 《上瘾》揭示了很多让用户形成使用习惯,甚至“上瘾”的互联网产品服务背后的基 本设计原理,告诉你怎样打造一款让用户欲罢不能的产品。作者根据自己多年的研究、咨询及实际经验,提出了新颖而......一起来看看 《上瘾》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具