gpt4 book ai didi

ruby-on-rails - 与雷神的互动提示

转载 作者:数据小太阳 更新时间:2023-10-29 06:45:35 25 4
gpt4 key购买 nike

我想以某种方式要求用户说出他们的 flickr_id、flickr_apikey 和那些东西,但 id' 最乐意在我的安装命令下这样做,这样它就不会因为所有的原因而变得如此冗长和粗重论点。

类似的东西

$ thor PhotoonRails:install
We're about to install your system.. blaa, blaa, blaa...
We have to know you're Flick ID, get i here http://idgettr.com/
Flickr ID: {here you should type your id}

We also has to know you're flick api key, make one here ...
API Key: {here you should type your key}

等等?你明白这个想法了吗?可以实现吗?

最佳答案

确实可以!

您正在寻找ask .

一个例子:

class PhotoonRails < Thor
desc "install", "install my cool stuff"
def install
say("We're about to install your system.. blaa, blaa, blaa... We have to know you're Flick ID, get i here http://idgettr.com")
flickr_id = ask("Flickr ID: ")

say("We also has to know you're flick api key, make one here ...")
flickr_api_key = ask("API Key: ")

# validate flickr creds
# do cool stuff

say("Complete!", GREEN)
end
end

关于ruby-on-rails - 与雷神的互动提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4604905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com